Click here to Skip to main content
15,171,729 members

Comments by johannesnestler (Top 200 by date)

johannesnestler 15-Nov-21 10:21am View
   
Whats your problem? To aggregate the result?
Something like this
public Infected GetAllContaminationID(int contaminationID)
{
var isolatedWithContaminationID = isolateds.Where(p => p.ContaminationID.Equals(contaminationID)).ToList();
var infectedWithContaminationID = infecteds.Where(p => p.ContaminationID.Equals(contaminationID)).ToList();

var result = isolatedWithContaminationID.Concat(infectedWithContaminationID).ToList();
return result; ​
​}
btw. you have to change the return type of GetAllContaminationID to the common base class (Infected)
johannesnestler 1-Apr-21 6:46am View
   
make your watcher a member-variable... missing basics of c#?
johannesnestler 29-Sep-20 11:08am View
   
old but simplest solution for this in .NET UI - 5ed
johannesnestler 27-Jul-20 10:28am View
   
I agree with Gerry - I like to develop things myself, but a end-customer Report-Designer is way to "expensive" to build with all features opposed to the price of a commercial solution. Most of them you can try for free and evaluate against your requirements. (I use DevExpress Report Designer (WPF) which has very good customization (for datasources) and so on, so even if you have to develop parts of your designer yourself, it's still better to "customize" an existing product with custom Code/design)
johannesnestler 16-Jul-20 0:52am View
   
you are welcome - good luck with your project!
johannesnestler 15-Jul-20 9:31am View
   
see my "solution"
johannesnestler 14-Jul-20 10:05am View
   
Hi again, It would be quite difficult to guide you through the whole process. If you are a novice to wix you should look at the simple tutorials, wix is not really hard if you "get" the basic idea. But keep in mind that creating good setups for customers is never "easy", but if you do it "once" right you will have professional deployment for your applications (if you got it make a VisualStudio Template Project out of it, so you can reuse it for other applications and never look back).

For the Licence check I would create a custom action (you can write that in many languages, also .NET) to handle the license check (that way you can do it exactly as you want, and you can reuse in other Setups)

For the UI-Part: This is really difficult to get right and the whole process is kind of clumsy, I think it's good enough for adding a few pages, custom configs and so on, but to really redesign one of the default UI's is a lot of work, therefore I would consider other solutions (as I mentioned - Maybe something like this idea https://www.codeproject.com/Articles/5773/Wrapping-the-Windows-Installer-2-0-API)

If you have specific problems feel free to ask, I have some experience with most wix parts (but there is a lot into it, have a look at the very useful extensions!)

Kind regards Johannes


johannesnestler 13-Jul-20 10:55am View
   
Hi DJ Code - I also use wix to make installers, I changed the Mondo_UI a Little (not quite what you have in mind though). Have a look at the wix tutorial how to customize your UI (not so easy...) but it was a great help to just look at (and copy Code) from the Mondo_UI Code (see https://github.com/wixtoolset/wix3). Don't listen to others suggesting "cheap" alternatvie like InstallShield (it's just a better copy tool, doesn't realy solve real "Installation" Problems, doesn't work great with sourcecontrol, ... - but i agree that for most people this is "enough" until problems occure..). I think wix is a great tech ;) - but to if i really Need an "designed" installer UI I would proably make a custom application to "Control" normal msi-packages (which you can create with wix) - just an idea…

Kind regards Johannes



johannesnestler 24-Jun-20 6:06am View
   
I don't know your real requirnment - but I think it's very likely your solution is "Overkill" - If you realy have to do it like this you need a Visitor-Pattern (to avoid rings) to go through all nodes of your graph - this is hard to get right (recursion), and a lot of code. My rule of thumb: If something gets "complicated" like this - take a step back and question your design. E.g you maintain "backlinks" to the parents - is this really needed and so on.
johannesnestler 23-Jun-20 10:21am View
   
you are welcome - good luck with your project!
johannesnestler 23-Jun-20 9:25am View
   
Hi again - As I said - just abstract it away - I use an abstract IUnitOfWork-Interface to implement my dataservices against (with Methods to Commit, Rollback, Save etc.), and have concrete Implementations for EF (SQLTransactions), even if you never change your provider this can be useful to keep the dependencies contained (think about updating to a new version). But if you ask me how likely it is that you really switch from one provider to another - VERY UNLIKELY - if it's not a toy-project…. (I'm an architect for large systems with ~30 years experience - i can't remember any customer who just switched the provider without re-implementing. So: don't abstract if you don't have to! Keep the YAGNI-principle high! - just my 2c... Kind regards Johannes
johannesnestler 28-May-20 3:22am View
   
so in the end a big switch or (if-elseif chain) is the simplest but "ugliest" solution - if you realy have to do something like this (as I said maybe there are other/better solutions to your original problem) I'd stick with "simple" because this kind of code always breaks object orientation and "best practice"...
johannesnestler 28-May-20 3:14am View
   
new example:

class Program
{
class Customer { public void DoTheCustomerThing() { Console.WriteLine("Customer"); } }
class Vendor { public void DoTheVendorThing() { } }
class Importer { public void DoTheImporterThing() { } }
static void Main(string[] args)
{
string strClassName = "ConsoleApp10.Program+Customer"; // note the + in the full type name (it's because I embeded thy type inside the "Program"-class in this example)

Assembly assembly = Assembly.GetAssembly(typeof(Program)); // Get your assembly
Type type = assembly.GetType(strClassName); // search type inside assembly
object objInstance = Activator.CreateInstance(type);

//use instance
// 1. Option cast
// ... (with "is" operator)
if(objInstance is Customer customer)
{
customer.DoTheCustomerThing();
}
// 2. dynamic (check for runtime errors! no compiler check!) somehow you have to know what type the instance has, and what methods are available
try
{
dynamic dynInstance = objInstance;
dynInstance.DoTheCustomerThing();
//dynInstance.CallAMethodThatIsNotAvailableLeadsToRuntimeBinderException(); // this gives you an exception
}
catch(RuntimeBinderException)
{
// Method doesn't exist on type
}
// 3. using reflection again
MethodInfo mi = type.GetMethod("DoTheCustomerThing");
mi.Invoke(objInstance, null);

Console.ReadKey();
// ...
}
johannesnestler 28-May-20 3:04am View
   
using reflection again or "dynamic" or cast to real type (check with "is" or "as" Operator). May I ask what is your "real" Problem (so why you have to do this), maybe there are other solutions - because solutions that are based on strings and heavy reflection are error prone and performance heavy...
johannesnestler 26-May-20 10:50am View
   
This was just an example how to use Activator. You could do it like this:

class Program
{
class Customer { }
class Vendor { }
class Importer { }
static void Main(string[] args)
{
string strClassName = "ConsoleApp10.Program+Customer"; // note the + in the full type name (it's because I embeded thy type inside the "Program"-class in this example)

Assembly assembly = Assembly.GetAssembly(typeof(Program)); // Get your assembly
Type type = assembly.GetType(strClassName); // search type inside assembly
object objInstance = Activator.CreateInstance(type);

Console.ReadKey();
// ...
}
}
johannesnestler 26-May-20 10:47am View
   
Deleted
This was just an example how to use Activator. You could do it like this:

class Program
{
class Customer { }
class Vendor { }
class Importer { }
static void Main(string[] args)
{
string strClassName = "ConsoleApp10.Program+Customer"; // note the + in the full type name (it's because I embeded thy type inside the "Program"-class in this example)

Assembly assembly = Assembly.GetAssembly(typeof(Program)); // Get your assembly
Type type = assembly.GetType(strClassName); // search type inside assembly
object objInstance = Activator.CreateInstance(type);

Console.ReadKey();
// ...
}
}
johannesnestler 12-Mar-20 9:11am View
   
everyone started like that… just do it step by step - big problems will always stay big problems though ;)
johannesnestler 11-Feb-20 10:12am View
   
If you wan't to add "security" to whatever codebase you have now, you really have to understand the implications, it's not an easy topic, but from your question it seems you lack very basic understanding of Private/Public Key encryption. So try first to understand how it works, then implement correct. If you have any Questions feel free to ask.
johannesnestler 11-Feb-20 10:04am View
   
So implement exactly that. Persist the "string" - it should be a file. Show the user the search results from the file, let them replace/jump (Maybe get an inspiration from Notepad++ "search and replace in multiple files" feature). Make a Control to show the changed lines (whatever). But DON'T load the whole text to a Control. Only think about memory consumtion (and everything OriginalGriff mentioned). Really rethink what you want to do, The feature can't be "I show you now million lines of text).
I did a Trace-Viewer back than (full verbosity Level the application (backend/frontend) generated About 400k lines of trace for a single click), that worked like that. But not for a second I thought: Ah I just load the whole thing....
johannesnestler 14-Jan-20 8:06am View
   
don't ;) -> come on: formulate a real question, show code -> expect help. Even this comment was more effort than you put into your question..
johannesnestler 4-Dec-19 6:55am View
   
just use WCF default's datacontract serializer (just do nothing special on your DTO-Class) - so everything should behave naturally. Why did you come up with (the old) Serializable idea…
johannesnestler 27-Nov-19 10:21am View
   
Yes, so what's your question or problem with that? (what Gerry showed was of course just for one timer (you have diffenet start-times, an Array or whatever - you didn't show any code). I think i understand what you want, I don't understand where you stuck...
johannesnestler 18-Nov-19 5:26am View
   
what kind of requirenment lead you to this idea? Maybe we can suggest something doeable if you explain why you want to do that?
johannesnestler 11-Sep-19 7:15am View
   
so you use a dublexchannel? I don't really understand you problem then. So to call a WCF Service on any envent should be easy, but to callback to a client from WCF-Service (could be any kind of application, WPF whatever) you need a dublex channel. So now you say you use a dublexchannel - so your problem is you don't know how to implement the client-side callback-contract? Please show your code or try to reforumlate your question… I answered to "can you please suggest on how can i do a callback from dll to wcf and from wcf to client application." I suggested not to use a dublexchannel…. so your Question is really "how to implement a callback with a dublex-channel"?
johannesnestler 10-Jul-19 9:56am View
   
I know about 10 different ways to do that, worked with 5 different database vendors over the years used 5 different .NET Technologies for UI (I guess you use WPF?) - so you see: Give us context, Code and expect help. I allready put more effort in my comment than you in your question. So please update with relevant information if you expect help.
johannesnestler 10-Jul-19 9:48am View
   
After reading the Solutions and seeing your struggle to understand the answers you get, I'd suggest: forget about this code for a while and go back to a C# tutorial and read 1 hour about arrays and indices. This would help you more than asking Questions about an Exception that tells you exactly what the problem is. Index was outside the Bounds of the Array... Don't run before you walk - and btw. learn to use your Debugger to see what your array-size really is. Useful link: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/
johannesnestler 10-Jul-19 9:41am View
   
what' your error - how should we please help you without knowing anything about your Code? Please put some effort in your question to get better help...
johannesnestler 8-Jul-19 7:27am View
   
No George Swan is right, it doesn't brake MVVM because it's view-only tech (to call the specific close-method). I'm the architect of a large system and we use MVVM too, solved the problem like George Swan described. The "trick" ist to implement it via OnDataContextChanged like this:
void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if (e.NewValue is IRequestClose)
{
((IRequestClose)e.NewValue).RequestClose += (s, ea) =>
{
Dispatcher.Invoke(() =>
{
if (this.IsVisible)
{
this.DialogResult = ((IRequestClose)e.NewValue).DialogResult;
}
this.Close();
});
};
}
}

So you see: we look for DataContexts (ViewModels) to implement IRequestClose and attach to it's RequestClose Event. So we can "trigger" Closing from everywhere and the view knows About it's viewmodel but the viewmodels doesn't know it's view (and ist Technology independend!) - So MMVM pure is saved regarding to this…


Feel free to ask for details.
johannesnestler 26-Jun-19 8:41am View
   
sercurity issues on ISS - I suspect you can't Access the path - add appropiate exception-handling and you don't have to guess...
johannesnestler 18-Jun-19 4:58am View
   
Write to Textfile in 10ms - this won't work. Make it a consumer Producer-pattern and leave timers away. Do it as quickly as you can. "Real-time" Charts are no trivial topic...
johannesnestler 6-Jun-19 10:24am View
   
Great, but Maybe don't do a workarround, make it like it should be. Maybe read Dave's comment again and implement like he told you, shouldn't be that hard… In .NET I use WCF "AdministrationService" hosted inside my windowsservice for IPC - so my Desktop app can connect to the service and vice versa. I do this for all my windowsservice by Default, if nothing else I can monitor the WindowsService and "look inside".
johannesnestler 6-Jun-19 10:15am View
   
In WindowsForms you have to use Events instead.
johannesnestler 27-May-19 9:42am View
   
why not do the same within a static contstructor?
johannesnestler 17-Apr-19 10:38am View
   
I don't understand what you ask for, or what you don't understand. but from the formulation "in one of my classlibrary Project" I assume you are lacking basics about dependency management and the purpose of these patterns (UoW, Repository) in general. Maybe try to get a clearer picture of These topics in your head before your try to "implement" something… Hard to run before you walk - no offense - we all have been there… Maybe a term to look up: Constructor Dependency Injection (this is how your EmployeeService gets its UnitOfWork and Mappers injected) I would suspect you have a corresponding factory somewhere?
johannesnestler 17-Apr-19 10:32am View
   
I thought the same - an easy solution maybe just to use commandline-arguments and start the app in an "console" mode which does the Job without the form. But OP didn't give enough relevant Information as you pointed out...
johannesnestler 17-Apr-19 10:26am View
   
don't - use a vpn!
johannesnestler 17-Apr-19 10:24am View
   
so what's the Problem? Why does your solution not work? a quick Google search lead me to this: https://stackoverflow.com/questions/30648748/syntax-for-sql-trigger-to-insert-data-in-another-db-and-also-to-update-any-field
johannesnestler 2-Apr-19 9:14am View
   
if this Code is for a Card game or something similar I recommend not to really "shuflle" the Array - just pick items (cards) randomly and remove them. No shuffling needed - and more secure - no one will know the shuffled order before you draw an item - just init Random with the actual access time - if this is over network it will be even more unpredictable.
johannesnestler 20-Mar-19 11:46am View
   
so you create unlimited new forms in a loop and used up all your memory... I don't even bother to think about what you are trying to do here, as Gerry Schmitz said "silly stuff". So you thought structuring your code is not needed... We all were there - just learn from it. Give your Code a structure that is easy to follow and you will avoid such pitfalls. E.g split the timer_tick in more reasonable chuncks, make shure your code runs in your interval (100ms really?), secure it against "overtaking", think About what you do with the forms and how you instantiate them (better reuse?) and so on. I'm pretty sure your Problem will just disappear - or just "fix" the memory consumtion and run in the next problem due to bad structure next week… just my 2c
johannesnestler 4-Feb-19 8:48am View
   
so one thing (number of Projects in solution) has nothing to do with the second (wix-Setup Projects). So what failed, and what led you to the conclusion it has something to do with number of Projects?
johannesnestler 23-Jan-19 10:30am View
   
I just checked my templates and they look the same as yours and work… So Maybe have a look at your vstemplate… but as you showed it replaced at least the guid so <Project File="ProjectTemplate.csproj" ReplaceParameters="false"> can't be the Problem...
For ItemTemplates I also had to use a IWizard-Implementation - but I got it working as expected...
johannesnestler 19-Dec-18 8:27am View
   
Reply to myself - read the question's date next time umm...
johannesnestler 19-Dec-18 8:25am View
   
I did .net developer certification - but I would only reccomend to approach this with at least 5years of professional experience in .NET (C# or other language) - because it's very expensive! So if you became an expert one day you may want a piece of paper to proof it - this is the only Thing a certification is good for. In my case it was paid by my Company - it was never useful in any way for me personaly or for my Company...
johannesnestler 3-Dec-18 7:52am View
   
sounds strange, are you shure there is no other problem (missing focus or something like that?)
AFAIK keybd_event was replaced with SendInput (Maybe read the docu remarks for SendInput https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-sendinput)
johannesnestler 12-Nov-18 8:10am View
   
I'd try not to use a base-address, try direct addressing
johannesnestler 6-Nov-18 9:10am View
   
omg - the Question alone shows your lack of knowledge about Browsers, IP, ISP and VPN. Read/Research about this topics and forget about programming for a while...
johannesnestler 6-Nov-18 9:07am View
   
agreed
johannesnestler 6-Nov-18 7:00am View
   
xperf is part of the Windows SDK - so not really 3rd Party. if you have both sides in your Hands you can do the compression/decompression manually - but I think this is what you want to avoid.
johannesnestler 5-Nov-18 7:08am View
   
You mean Microsoft? Seems you don't know ETW - have a look https://docs.microsoft.com/en-us/windows/desktop/etw/event-tracing-portal
johannesnestler 22-Oct-18 10:19am View
   
I don't think you have to use multiple UI-Threads for this case - I support Richards comment - just use Show and Hide (Sounds like you want some sort of Splash or Progress screen..)
But it's technically possible to have multiple UI threads, but many programmer think it's not - because it's a very rare thing to do...)
johannesnestler 22-Oct-18 10:16am View
   
Hi Dave, Sry but this is not true. I can have multiple threads with their own Windows (e.g. WindowsExplorer works like this) See https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.5/ms741870%28v%3dvs.90%29 for an example (it's quite old, just the first I found)
johannesnestler 15-Oct-18 7:27am View
   
"I have an exe file that do not know by what language is written"... [- yes and you won't find out (maybe guessable though with a lot of knowledge) - https://en.wikipedia.org/wiki/.exe ]
"I know variable's (address,type,name) are in memory too." … [ no they are not - it's just an address]
This sentences shows me you should learn alot before you can hack processes or reverse engineer them.
Maybe you tell us your ultimate goal - there may a better way to reach it?
johannesnestler 2-Oct-18 8:24am View
   
Why not just try to port your app to .NET core? - have a look here https://www.microsoft.com/net/learn/dotnet/what-is-dotnet
.NET core runs on Linux and Macs... If it's an UI App I'd use XAMARIN then..
johannesnestler 18-Sep-18 7:15am View
   
compiled output has nothing todo with VS anymore - it's an executable and can't change itself. If you recompile you create a new independend executable - that should be clear in every compiled language. So stop this thinking and try to find the root of your problems. What Errors, what mean's "Stops running", ...
johannesnestler 11-Jul-18 7:06am View
   
It should work by reflection as you showed - so what's your exact Problem with that (it's quite common to set private fields for Tests by reflection).
It maybe the problem that your test doesn't know about your concrete vm-Type?
johannesnestler 28-Jun-18 8:08am View
   
+ btw. from what you have written it just sounds that you don't have good error handling in place - so first I'd question your need for this "monitor" - add just proper error/exception handling...
johannesnestler 28-Jun-18 8:06am View
   
From what you have written here it's not possible to get the context of your problem. But in general: "a mechanism … if the interface is still active" can be created - you are programming so just create a mechanism. Maybe one can help if you tell us your concrete problem, not just some vague "monitor" - it could work from pings, to message-loop inspection or just some events, or a statemachine…. monitor could mean anything...
johannesnestler 28-May-18 9:45am View
   
I don't know who downvoted your "solution" but this is also in my opinion the way to go. I did a lot of windows-forms programming back then (also with VS 2005-2008) and the "scaling" idea sometimes came up (from less experienced developers). A dynamic layout (as you recommendet) is the way to go - all other "automatic" scaling is a nightmare to use and test and dosn't provide the results you need (in WPF this is another Story because of Vector graphics - so such scaling is more likely to work - but even with WPF it's not a good idea… differnet aspect ratio will always be a trade-off - screenspace will be wasted)
johannesnestler 25-Apr-18 7:22am View
   
I'd do it with a layer in between. E.g. A WebService for the Task to report with another part to retrieve the Progress Information. You will have to host this on the Internet/Cloud though....
johannesnestler 23-Apr-18 10:23am View
   
You have to search for the error on server-side, isn't that obvious? If you say the same call works first and then you get the error a good guess would be a problem with async call handling on server side...
johannesnestler 2-Mar-18 5:24am View
   
nice to hear - you are welcome!
johannesnestler 19-Feb-18 9:34am View
   
It's not possible to give a good answer without knowing what Kind of data-export (later Import?) is possible from your windos app. There could be many ways... file, remoting, a stream, scraping, an email send by the app... so how is your "data" represented?
johannesnestler 19-Feb-18 9:22am View
   
so your implementation shows the correct result: 1+2+3 > 1+4+3 == 6 > 8 -> False. So whats wrong is not your code, nor the result. Whats wrong is your understanding of comparsion of triangles. Others explained it but it seems you don't know about the very basic concepts of geometry. You may be a child? No Problem, but I think you can learn what you miss by the Internet - some wiki-reading or YouTube may help. But not asking questions on a programming forum - because you dont't have a coding error here...
johannesnestler 19-Feb-18 9:08am View
   
so all Solutions good and right - but what you have here is just a missunderstanding in how the constructors are callled. so your baseclass constructor should be called with some Default Parameters by the constructor of the derived class. So your baseclass constructor will run and your fields are initialized - So OOP works as you expected - just read about constructors again on MSDN or your favorite book...
johannesnestler 19-Feb-18 9:01am View
   
no, don't do this! - what kind of advice should that be Sarita? You know: when such a question comes up, very likely there is a problem with resource-intensive forms - to reload them (for no reason but not knowing how to do this without reload) - is for shure no "good" advice!
johannesnestler 19-Feb-18 8:44am View
   
So which Client-Tech are you using - WindowsForms? WPF? Should the user draw it our your program and so on. If you want a good answer - formulate a good question.
johannesnestler 14-Feb-18 12:46pm View
   
nice examples John ;)
johannesnestler 14-Feb-18 12:44pm View
   
I have no problem if you hate it - I like to educate and I think it wont't help to write code for someone on this Level. But feel free to do his homework if you like!
johannesnestler 14-Feb-18 10:11am View
   
sounds not normal. Can't offer any help without seeing your "log-method" - Id guess - most likely there is something wrong with it (or the original call to the process). What could also be possible: If the process has an error in creating any static members (maybe you want to initialize some static members form configuration that is not present?), so maybe an exception is thrown BEFORE the Main method is executed.
johannesnestler 14-Feb-18 10:02am View
   
sure anyone with some experience could solve this - for shure all that still bother answering such questions (despite the fact that you ignored the Forum rules) like me or John. But my education is over, I don't do homework anymore - I do work. Homework is for learning - you can only do this for yourself. No solution to your "requirement" can be of any value in the real world. If I give help or advice here, it should be a "real Problem" for someone at least - not just a lazy Student who doesn't want to do his homework. Sry
johannesnestler 6-Feb-18 13:32pm View
   
so what was the exception? btw. you can call SaveChanges outside the Loop - so you don't talk x-times to the database during Looping...
johannesnestler 5-Feb-18 9:53am View
   
Sry, but should we read your mind? What application, what error, where is the Code - what did the Debugger say, what is the real exception?
johannesnestler 5-Feb-18 7:22am View
   
Yes it should be possible (if this is a "good idea" depends on your context - from my experience IO-Bound multithreading may be not so a great thing).
So what's your specific problem? creating the threads? reading the files? You didn't show any code to guess what could be your obstacle.
Anyway: From FileDialog you get a list of file-names, Loop through them create a thread for processing for each. Let them run and syncronize. I'd use TaskParallelLib (Tasks) instead of old style thread creation....
johannesnestler 29-Jan-18 10:35am View
   
So it seems to be a classic "threading and exceptions" problem...
johannesnestler 29-Jan-18 10:23am View
   
Do you know how to debug a VS Extension (via experimental instance)?
johannesnestler 29-Jan-18 10:20am View
   
oops lol - I didn't look - thanks.
johannesnestler 29-Jan-18 7:52am View
   
So how to debug WCF-Services/Services...? Chances are pretty high that your problem has nothing to do with WCF or Windows-Services - it's just a bug in your implementation. So how to test something in general? - in as much Isolation as possible (so you don't confuse yourself).
So write a UnitTest call your Code (just instantiiate the WCF-Service implementation as normal class) and do your Tests.
johannesnestler 25-Jan-18 10:41am View
   
so you don't know variable scoping rules - a Topic every C# tutorial covers on it's first pages.Then you get a perfect problem description from "the boss" for your specific code - and now you think you need a more minimal example? Sry but WTF!
johannesnestler 25-Jan-18 10:26am View
   
I don't think this will work - no Windows-API function will help here. Key-Logging with a global hook, monitoring target application (Shell) and knowledge about possible shortcuts each target application has could work to some degree. Anyway - I would be just interested what kind of benefit or feature is behind your requirement? At the moment I can not imagine any use for such all "commands" logger for all Shell-Kind applications. What you do then with the logged commands - they will always be application specific.... so in useless without further Knowledge of the Shell and it's commands. Maybe one could help if you describe your target?
johannesnestler 23-Jan-18 10:22am View
   
so what's the Problem? You talking about selection so the question maybe has to do with a UI-component/Control Problem because a "list" itself has no selection feature. So please try to formulate a better question and explain your real problem...
johannesnestler 23-Jan-18 10:14am View
   
btw. what you mean with "not work" the code you show has wrong syntax...
johannesnestler 23-Jan-18 10:13am View
   
so you didn't follow the localization recommendations for WinPhone projects and dind'nt use the binding mechanism to load the strings from ressource files? So before doing some more fiddling maybe find out why you didn't use the recommended approach (just because you didn't know?) and what hinders you to rebuild you current solution to the recommended one. Hard to tell what you have now, but I'd think it should be possible to move all you texts to resource files (how it is done in all Windows applications) and then make the needed "Bridge" (class for the strings) to bind to (see any WinPhone book or tutorial). To do this with hundreds of strings shouldn't take to long (If I think about my bigger applications with thousends of strings I would maybe go for an automated solution.... But only if I would assume my application doesn't need localization in the first place - which I never do...)
Another Thing: there are official language codes and iso Standards - better don't use your own like EN_ENGLSH - this would be en-US - see https://msdn.microsoft.com/en-us/library/cc233982.aspx
johannesnestler 27-Nov-17 12:03pm View
   
Maybe read Griff's advice again. Stop messing arround with the Code you have now. Just think about the logical steps involved without writing any code. Also try to to see the Programm from a users perspective - what would you expect (as user) how to enter bytes (not a trivial Problem)... and so on.
Then try to implement it with what you know. But questions like "How to correct nullified variables that as been commented out" shows how far is your understanding of programming - so what you know now is maybe not enough. At least try to understand what you don't understand ;) I think you will have to open your programming book again and learn the basics before going any futher... sorry, but I think at your current "Level of understanding" even some example code won't help you...
johannesnestler 19-Oct-17 8:33am View
   
you must be good a maths... Unlikely if i read you unprecise definition of what you want "find a wav file in other wav file". You wont find files inside of wav-files. What you may find is the same music or sound or part...
johannesnestler 19-Oct-17 8:17am View
   
So you posted several questions to this topic... From what you ask, I'd say you have to move away from your "timed" aproach. If the game-state changes the visual objects should do the same. So I would create a control/view to represent the game-state visually (with bindings) - so no need for an "update-loop". The Loop is only in the logic of the game.
BUT: What I'd question, is the use of WPF for this kind of "game" - why not use something better suited for games (and with much better perfomance) - like "Unity".
For some things maybe WPF-animations (they perform well and use fixed time-Intervalls) could be a good fit - but that depends on the nature of your game...
johannesnestler 19-Oct-17 8:01am View
   
@ hyper-v - you have no Google or what? ist a hypervisor - what else ;)
I don't know what could be your Problem and from your description I can't imagine someone can help you with that in the form of a QA Forum. What I can tell you is that I successfully used xamarin tooling with VS 2017 (maybe you can try for yourself with the free VS community-edition)...
johannesnestler 19-Oct-17 7:54am View
   
I have no clue what you want - can you try to explain a little better? If you use Code-First what would you do witn an edmx-file? (this would be model-first or generated from database-first). From my experience I can tell you: let the edmx-file go - EF-Team will deprecate it with EF7 and on EF-Core it's gone already... If you have to control the mapping for special cases, better use fluent-api.
What you mean with designer.cs file is beyond my imagination...
johannesnestler 3-Oct-17 7:13am View
   
I mean "how to" - could mean a thousend things in this context. Where are you stuck? what is it you don't get? How to set-up TFS (Agents, Controllers) how to create a CD-build... ?? So what's your Problem?
johannesnestler 3-Oct-17 7:11am View
   
so whats the Problem?
johannesnestler 3-Oct-17 7:00am View
   
You realized i showed an example how to use Binding, TemplateBinding and DP, don't you? I didn't write your code for you - So just apply the idea to your solution.
johannesnestler 2-Oct-17 10:43am View
   
you can try all approaches at once just recreate the Project with all the files I showed...
johannesnestler 2-Oct-17 10:01am View
   
step by step Steve - let's first find the right approach for Control behavior then everything should be solved in the same way. Btw. for things like this it's usual to just Control the visibillity of different controls (e.g two textboxes with different font and Color one over the other), a Thing you should never do in WinForms (for Performance reasons). I came the same road and think have a feeling for the "mental traps" - sorry for my english too - I'm austrian...
johannesnestler 2-Oct-17 9:08am View
   
No need for excuse ;) I just wanted to bring you in the right direction...you have to understand how dependencyproperties, Control theming, visual trees and so on work... this will prohibt such a mess for your next Control. So you will have to learn how to do things in WPF. Maybe my "rule of thumb" can be missunderstood... What I wanted to say - there is very seldom need for a "Control" in WPF like you were used from WinForms - because you maybe better work with MVVM pattern there... Things that can not be explained in a short QA-posting...

But I understand you want a quick soluton: I'd start here: I don't see you do anything with the IsChecked-Property inside your Code. so what Magic you expect to happen? In other words how is your Checked stated represented visually? Wait a Little I will try to create an example for you to understand the different approaches you could take here - maybe you can see a solution then...
johannesnestler 2-Oct-17 8:27am View
   
I think you question is confusing. "a custom user control"... "custom Control" and "user Control" are terms with a special meaning in WPF (just the first hit on Google for me: https://stackoverflow.com/questions/1322451/what-is-the-difference-between-user-control-custom-control-and-component ).

What you wanted: A customcontrol with a default (generic) theme (visual tree will be replaceable later)
What you created: A UserControl with code-behind (visual tree will not be replaceable later)

So I suggest to create a customcontrol out of your code and use TemplateBindings inside it's visual tree (the XAML) for things like your "Checked" state on the element that will represent that state inside your control's visual tree. If you don't know what I talk about (very likely - I'd guess you come from WinForms), better read some basics about WPF and controls in the documentation berfore you go any further with this... Rule of thumb: Never make CustomControls if you don't know your WPF in and out, and if you do, do it correctly (behaviors?)
johannesnestler 2-Oct-17 8:14am View
   
"in charge of the development of a platform of video-conference" - and you don't know about sockets? Omg how did they hire you? Shure everyone has something to learn, but without knowledge of basic things like that you will have a hard hob. Better learn the basics quickly - asking such questions on a QA-Forum is for shure not the way to do it...
johannesnestler 12-Sep-17 7:37am View
   
sry, it seems i read over it. so all good ;)
johannesnestler 26-Apr-17 3:57am View
   
yes shure - but this has nothing to do with your Setup - ist your "application" code...
What I'd consider "clean" architecture for this kind of application: A Windows-Service to do the work (runs with system). A "Desktop"-application (runs with user) to connect to the Service (by remoting, wcf, pipe, etc.) to view and control it's state (and maybe to do addtional work for the user, like maintenance). - a good example is the remote-desktop software "TeamViewer" - you may know it... I understand you have something running here, but when I hit problems like this, I try to step back and rethink my approach. Maybe a consideration for your next project of this nature. Anyway just my 2c - feel free to ignore ;)
johannesnestler 24-Apr-17 4:40am View
   
then just elevate, user will have to allow it - by clicking - an anoyance. Through the nature of your application I'd question that it has to be a console application... btw. i can run all my services as console application for debug or if i want, just call the Service Start/Stop methods in a wrapper - can post code if you need it.
johannesnestler 21-Apr-17 5:34am View
   
btw. installing a Service with wix is very easy...
johannesnestler 21-Apr-17 5:34am View
   
would be better to make a Service out of it, no? Then you can install it to run as System, admin or whatever + Your web-API would start with the Computer, and not when a specifc user logs-in (what might never happen if the Computer restarts - think Windows updates or whatever)
johannesnestler 28-Mar-17 10:46am View
   
I don't get it. So you want to parse the file somehow and "recognize" the out-commented text? I think Regex is your friend here... But maybe you want something else? Anyway no value in doing guesswork - sit down and forumlate a real question, and where you need help. Show what you have now... - it's all written in this Forums rules...
johannesnestler 28-Mar-17 10:39am View
   
so what's the Problem? Take your data as string (and/or parse it into something meaningful) and store it in your mysql db...
johannesnestler 20-Mar-17 11:12am View
   
just my helper class where I put the method - just create a static class and Name it as you like to put the RunServices method there... I thought that was obvious - sorry for that...
johannesnestler 14-Mar-17 10:32am View
   
are functions executed on a separate thread?
johannesnestler 7-Mar-17 9:57am View
   
have you questioned why there is no "DataGrid" in UWP Standard controls? Because I had the same "problem" I thought a little about it... my conclusion: Because it is really difficult to provide a Control with (from user perspective) expected behaviour on all supported platforms (just try it with minimal resolution on a phone...). I ended with a simple listbox and a DataTemplate for one row (per visualstate), and a Header Control to set sort direction... Maybe I try the telerik lib recommendet by Graeme_Grant - the others I tried, didn't meet my expectations... just my 2c
johannesnestler 2-Mar-17 5:15am View
   
no clue what you are talking about...
johannesnestler 2-Mar-17 5:12am View
   
thank you CHill - maybe I shouldn't be so sarcastic :|
johannesnestler 28-Feb-17 9:17am View
   
Google what? just read the c# docu - did you ever do any programming? It's your x'th question here about this topic - in that time I would have tested all possible cases in a quick console application and found out how the keywords behave without any documentation...
johannesnestler 2-Feb-17 11:34am View
   
there is no "Problem" if you do it this way - just tight coupling. Anyway just re-run your query on your Refresh-(button/Event/whatever) and re-assign the itemssource. If you are new to WPF it won't take long that you "meet" the MVVM pattern somehow - so I'd recommend to read a bit about it to decide if it is what you want...
johannesnestler 2-Feb-17 11:07am View
   
yea, we should implement your comment as automated answer to all these "NullReferenceException" questions... +5
johannesnestler 2-Feb-17 11:01am View
   
What I meant is he should just re-run his query and asign the result as ItemsSource again (the only way I know to "update" in this scenario). But I would never follow such an approach - I use MVVM and bind ObservableCollections to the DataGrid - so updating the underlaying data is enough. So don't bind DataTables directly...
johannesnestler 20-Jan-17 4:29am View
   
remove the binding Redirect from your app.config and set the autogeneratebindings-flag in Project file to false (like described on MSDN)
johannesnestler 17-Jan-17 10:11am View
   
so when you say you want to print "listview items" (you didn't say the data, a Report or something else), and you found the handy .NET function which can print every visualtree in WPF, and you say you don't want this approach, so what is it what you want? Maybe just tell us what's your problem with that and what errors you experienced... Anyway why not create a document, out of your data represented by the ListView-Items, likeyou "want" and print this?
johannesnestler 21-Nov-16 8:47am View
   
you are welcome - everthing clear now and working? (I changed your code out of my head in Notepad...), Feel free to ask futher questions...
johannesnestler 18-Nov-16 6:32am View
   
oh no man - please see my solution...
johannesnestler 17-Nov-16 6:00am View
   
I'd quetion your requirement too - a forced long running app on a phone is not a good idea. Maybe you can give us some hints what you want to achieve, so maybe a better solution can be found?
johannesnestler 17-Nov-16 5:56am View
   
exactly what I spotted
johannesnestler 14-Nov-16 8:25am View
   
sorry for german link - you may better use this one: https://en.wikipedia.org/wiki/Windows_CE
johannesnestler 14-Nov-16 8:24am View
   
you are joking, right? If not, you may want to have a look at https://de.wikipedia.org/wiki/Microsoft_Windows_CE, newest Version of CE would be compact 7 but most companies did the transions to the newer "embedded versions"...
johannesnestler 14-Nov-16 7:51am View
   
You may be right, but you don't know what he need's to do, having a lot of background with CE specific applications and "Software companies" creating them, I'd say someone "lost" the code (maybe the Company died). :D
johannesnestler 5-Nov-16 12:38pm View
   
great answer :D
johannesnestler 3-Nov-16 10:31am View
   
you mean your homework is fun? So just for fun, try to do it yourself - then come back here to the Question&Answer forum and post what you have written (you didn't ask a question now, so no problem if you ask none then) - maybe then it will be fun for us readers here too! :P
johannesnestler 3-Nov-16 7:56am View
   
I don't get what you are trying to tell... we compare times only here - what you mean with "date part". You asked how to check time-overlaps...
johannesnestler 2-Nov-16 10:04am View
   
try MVVM pattern...
johannesnestler 2-Nov-16 10:02am View
   
get the return value from Save call and see if you get the expected '1' (that you list has now one element was done by add call, has nothing todo with save - so check this first.) After that I'd say what Richard meant sounds reasonalbe (you overwrite it somehow - so check your surrounding Code)
johannesnestler 26-Oct-16 6:13am View
   
oh you poor... bad naming is first indicator of bad programming, I'd question the sense of UI-Automation testing on such applications (e.g setting up parameters and getting results should be testable without the UI - e.g. in a MVVM pattern with UnitTests for the ViewModels...). Just my 2c - sorry that I can offer no help...
johannesnestler 26-Oct-16 6:07am View
   
you don't mix up delegates with the .Net event-mechansim (which uses them), do you?
johannesnestler 24-Oct-16 10:41am View
   
would be nice if you vote for solution, or tell us you have solved it...
johannesnestler 24-Oct-16 10:37am View
   
I don't want to read your whole code - better try debug yourself - but a quick look suggests you do no double lock checking - so while aquiring the lock other code may run, no? Anyway, I can't see the point of your whole implementation, what you do here is to sync with the Dispatcher - why bother to derive from ObservableCollection in the first place? just sync the calls with the Dispatcher (you do that anyway in the end if I saw it correctly) - just my 2 c - as I said didn't read your whole code, so maybe I'm wrong...
johannesnestler 24-Oct-16 10:21am View
   
So you want to implement your own Explorer-window? try some googling to get an idea what's involved e.g. https://gargmanoj.wordpress.com/2009/03/27/wpf-101-a-simple-windows-explorer-like-directory-browser/ or http://www.codeproject.com/Articles/21248/A-Simple-WPF-Explorer-Tree - But I'd recommend to rethink your requirement - I'd create a specifc datatemplate for your list-items (Pictures?), read file Information (e.g. from drop source)and present this to the user, you will also need a thumbnail creation-tool/API/code and perfomance maybe an issue - all in all: sounds not like fun...
johannesnestler 24-Oct-16 10:13am View
   
Have you ever considered to use EnityFramework (which has this comparison: automatic and built-in)
johannesnestler 24-Oct-16 9:10am View
   
I have no clue what you are talking about??? "I want a class" .... we don't want define a class of fixed Parameters??? Please try to formulate your problem without assuming we can read your mind - and try to use common technical terms - i never heard of a "class of fixed Parameters"... Start with answering "what's your Problem"? Create a class? a form? a database?
johannesnestler 20-Oct-16 6:50am View
   
so your Problem is not to create a database-driven application to montior employee status, but to read the data from the electronics?
johannesnestler 20-Oct-16 6:46am View
   
pattern is can be the same for winforms - just a little more work to implement... I like to use it, because undo-/redo can be centralized quite easy. but have a look what CPallini recommendet...
johannesnestler 20-Oct-16 6:08am View
   
does your Code work now? why change it? - just don't re-parse the selected value all the time during the loop (do it once outside)
johannesnestler 20-Oct-16 5:16am View
   
Task timeout? i'd say what times out is your underlaying Connection from whatever dc is (have a look at your API)
johannesnestler 20-Oct-16 4:58am View
   
just a comment: I'd strongly recomend you overthink your naming-conventions - maybe to something more .NET-ish? I get eye-cancer when I read your code ;)
johannesnestler 20-Oct-16 4:54am View
   
So this one sentence is now your Problem description. What I'd do:
1. Read formu/QA rules
2. Describe the problem from programmer to programmer - easiest with code, no?
3. Try to find out what's going on with your scrolling, by finding help from nice people like me, who find it nice to help others ;)

Don't:
* Bump your "question"+
* Ignore the QA rules
* Post your "question" as solution
* Assume other can see your screen or read your mind
* Waste your and our time...
johannesnestler 19-Oct-16 10:16am View
   
Deleted
the markup won't show nice here - so here is the whole window file I created for you again:
<window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WpfApplication2" xmlns:system="clr-namespace:System;assembly=mscorlib" x:class="WpfApplication2.MainWindow" mc:ignorable="d" title="MainWindow" height="350" width="525">

<window.resources>
<!--Because we need to convert the visibility enum value to a boolean (the IsSelected property of the TreeViewItem) we need a converter - let's use the default one, we create a window-level resource out of it-->
<booleantovisibilityconverter x:key="BooleanToVisibilityConverter">


<grid>

<treeview>
<!--Define an ItemTemplate like you wish for you tree nodes (could use different ones, for different kind of nodes by setting a DataType for the DataTemplate)-->
<treeview.itemtemplate>
<datatemplate>

<!--As example we use a combination of a TextBlock and a Button stacked horizontally (add margins and so on to get a nicer look)-->
<stackpanel orientation="Horizontal">
<textblock text="{Binding}">
<!--here is the trick: Every added item (in this example just strings) will be wrapped in a TreeViewItem by the Treeview, so we bind the visibility of the button
to the IsSelected property of its "upper" TreeView, the use the converter we defined earlier to convert the boolean value to a meaningful Visibility enum value -->






<treeviewitem>

<!--Just some sample items (in real you will most likely use ItemsSource property to bind data-->
<system:string>bla
<system:string>bla
<system:string>bla
<system:string>bla
<system:string>bla
johannesnestler 19-Oct-16 9:14am View
   
If this was me I wouldn't assume everything is OK - you clearly missing some basics - back to the books (or MSDN)!
Do you know now what was the real problem (hint: it was not relase configuration - you can edit this configuration like you want - it was the flag "optimize Code" wich happens to be set on the default release configuration in VS (look at the your project settings/build tab)
johannesnestler 19-Oct-16 8:52am View
   
So with XML we mean a well formed XML document - lot's of code availabe to deal with this - you don't have XML here so you have to write your own parser - why did you think it was a good idea to treat this as XML in the first place (because it looks like XML from far away?
johannesnestler 19-Oct-16 8:25am View
   
interesting question, but why ask it here? - what you do during programming work if you don't know: Try it! or read MSDN: https://msdn.microsoft.com/en-us/library/dd264739.aspx (have a look at 'overload resolution' at the bottom of the page)
johannesnestler 19-Oct-16 8:15am View
   
you think this is a good question to find help? I assume with "unstable" you mean a problem - so what's the problem?
johannesnestler 17-Oct-16 9:12am View
   
Reason for my vote of 1 \n You may tried, but I see no argument you came up with that "restore goto's reputation" in high-level control flow - other commenters said it... I just want to add that your "in the field/production... and quick solution..." argument is the beginning of evil for most codebases- your code will "die" quickly if first thing you through out under pressure is best practices... So just leave goto where it belongs to: low-level code (as jump instruction) for everything high-level use more "controlled" jumps (you listed them) - period. Btw. I have coding rules in place that wouldn't allow a goto in a codefile for my developers (never had to discuss it, in all years no one needed it or wanted to break the rule). Maybe one reason I'd accept: If you have to port some (very) old c-style code/algorithm to C# (maybe unsafe compiled) which uses goto, you can use goto in C# too - I think this is the only reason they included the keyword in the language - compatibillity with old C/C code..
johannesnestler 12-Oct-16 7:42am View
   
Reason for my vote of 5 \n upvoted after concerns have been discussed, and the solution can be seen in the bigger picture by readers
johannesnestler 10-Oct-16 13:52pm View
   
Reason for my vote of 3 \n interesting idea and code, though I have some doubts about the original problem... because I think the abstraction between view and model - the ViewModel is the essential part of MVVM, so I have some problems with your argument about "your design"
johannesnestler 6-Oct-16 8:02am View
   
that sounds a little odd - Administrator has less rights to do the work than a normal user? Can you name any application where you have seen a behavior like that? If I come up which such 'WTF requirements' I always step back and question what I'm doing... just my 2c...
johannesnestler 4-Oct-16 9:46am View
   
5ed - But, I would always suggest marshal to UI thread from timer not the other way round. That OP wanted a timer in a Background thread is a STRONG HINT he wanted to use something like System.Timers.Timer but didn't know about it...
johannesnestler 19-Sep-16 7:54am View
   
so you do not have a proper deployment system (installer or anything similar) in place, but think about pinning a link to your app at the start-menu... You see what's wrong with your approach?
johannesnestler 15-Sep-16 10:17am View
   
but why don't you let the database generate the key?
johannesnestler 15-Sep-16 10:13am View
   
post your real code - then we see further -this doesn't compile. With that kind of accuracy at work you do better something else then programming...
johannesnestler 14-Sep-16 14:02pm View
   
A question is a sentence with a questionmark at the end... Come on, after all the comments here - sit down and spend 15 minutes to give context and formulate a seriouse question if you want help. Otherwise read the documentation of this asterisk manager thing (whatever this is, from your Code I assume some socket-based command API?), normaly these things come with a manual...
johannesnestler 14-Sep-16 9:37am View
   
let the database generate your key! - so this problem will resolve itself, or remove the key Attribute (or convention) from your model-Code (not recommend that) and handle the keys on your own - but again: DONT!
johannesnestler 13-Sep-16 14:07pm View
   
your are absolutly right about tutorials... ;)
But good that you could solve your problem. I work with wix created installers for some time now, many things needed some fiddling and reading of the examples again and again - but most times only once - if you get how to do it, it seems easy later (How to start services, multilanguage-support, work with registry and custom dialogs, bootstrappers, ...) For me the main reason to use it (other than it's free) is source-control support (because of the simple textfiles) vs. Binary installers where you just see it's changed (on source control)...
johannesnestler 8-Sep-16 8:27am View
   
@ idea with process-id: this ID is unique for every process - so 10 instances of Notepad = 10 different process id's..
johannesnestler 8-Sep-16 8:25am View
   
I don't get what you do with the timer here? start-stop inside a Loop? Can you please explain us what you want to do - because for me your (timer-) code makes no sense... you mentioned (other comments) that your problem is with this timer, but then you say that dublicate Windows are open (another problem, you didn't write correct code for this, other solutions already showed you)...
johannesnestler 7-Sep-16 10:38am View
   
amen
johannesnestler 7-Sep-16 10:35am View
   
When I read your question (or statement, you didn't ask any question - that is a sentence with a questionmark at the end ;-) I thought "Wow, sounds interesting, how is he possibly doing this?" - now I find out you don't have a solution for the basic feature of your app. Sorry, but If I find out how to do that, I will make my own app...
johannesnestler 7-Sep-16 10:31am View
   
Decision for a specific installer technology is difficult to make. It's even more difficult to give specific advice how to handle your Problem because of the different existing solutions for each installer-tech. So maybe tell us about which installer-tech you want to use (or which are on your "list") - so you can ask the experts for the specific tech for a solution. E.g. I use wix ( https://www.firegiant.com/wix/tutorial/ ) - I would probalbly solve this with a custom action and custom dialog form...
johannesnestler 7-Sep-16 10:25am View
   
which program? what is your question again? Even if you ignore the Forum rules, it's you who want help - so I expect you to put at least some effort in formulating your question - even this comment is longer...
johannesnestler 30-Aug-16 13:47pm View
   
funny idea and sounds doable. I think about a VPN Connection, don't know if this could work though... Like karsten I had used DynDNS to make a "fixed" IP from outside my network in the past...
johannesnestler 2-Aug-16 9:34am View
   
Hi Bill!
You are right - it's just a small part of securing your app - but I think it's not the right place to go into this topics here to deep (could say a lot about it...). Anyway Step 1 is "don't make the next card predictable" - think about a real life game - looking to your opponents cards is one kind of cheating, but knowing which card will be drawn next is another level of cheating - don't you agree?
Anyway, I never saw a reason for "shuffling" in the card games I implemented - that was the point I was trying to make. But maybe OP is just doing some homework - if so, your solution is a good fit.
Kind regards Johannes
johannesnestler 29-Jul-16 4:15am View
   
you didn't mention any programming in your question... but I'd start with FileSystemWatcher https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(v=vs.110).aspx
johannesnestler 26-Jul-16 9:54am View
   
examples are for simplicity - I use EntityFramework and OData with a separate DAL - I hope you don't expect Enterprise-Level code in examples and tutorials...
So if you application is "big enough" go for your usual layering I'd say!
johannesnestler 26-Jul-16 9:50am View
   
can you please explain you scenario in more Detail? What you mean with dynamically generated? But if you just mean to create a "working project-file" without VS - it's a plain XML-file - Make a project in VS and have a look at the project-file in a text- or XML-Editor and have a look at the schema docu: https://msdn.microsoft.com/en-US/library/5dy88c2e.aspx
johannesnestler 26-Jul-16 9:45am View
   
What you mean with "not visible"? What you mean with config... "missing"?
So you verified your code compiles and runs (without any WCF context)?
I'd go back a step and rule out all common/possible error sources. Start a simple Hosting, start by calling the Service with WcfTestClient or similar test-app to see if ABC is correct and Service is callable (no networkproblems whatever).
If I have to guess - I'd say serialization Problem (check all your datacontracts-what did you Change?)...
johannesnestler 8-Jul-16 5:12am View
   
ahhhh.... so what's the Problem again? Can ýou please (plz, plz) try to formulate your question/Problem a little better?
johannesnestler 30-Jun-16 9:51am View
   
so what's the problem then - to model a spehere?
johannesnestler 27-Jun-16 10:24am View
   
I tested the exact Code from the blog example OP linked - it didn't work, even with the PInvoke calls instead of System.IO...
johannesnestler 23-Jun-16 9:02am View
   
same as other - don't understand what you want - could do some guesswork of course... anyway..
Sometimes if I have a complicated problem, I try to explain it to someone completly unrelated to tech or the problem domain (like my wife), which forces my to put everthing in easy conceptual terms and a logical order. Then it often happens that I suddenly "see" a possible solution just through "formulating" the problem in another way as I think normally (in tech-terms or Code). Maybe try the same here: Sit down, and take us (here on CP) trough your problem/requirement and your thought process, show what you tried.. So we can come up with some solution together - and the common reader here will give a lot better Feedback/ideas then my wife ;) (sorry darling)
johannesnestler 22-Jun-16 9:32am View
   
open your C# book again (or open an old C++ one where this operator is also used)? No offending, but I just think for basic language syntax questions like this one, it's better to open a book or tutorial or the great MSDN reference where it all is explained in deepth with examples... Shure there are some more esorteric language features where it could make sense to ask the community for advice, but in this case I think you will learn a lot more by the official language reference on MSDN (maybe also read about the other Operators you may never have seen?) - just my 2c
johannesnestler 2-Jun-16 10:34am View
   
What a question... sry man, but better do some tutorial and read a book about C# and/or OOP - People give good answers here but your are just wasting your and their time. But maybe you don't want to learn, just have to know for a Course or whatever - I can understand that. So my short answer is - never use a public field - always use a public property, Keep all fields private to the class. My current project's codebase is not so big, just a few 100k lines of code, but you will never see any pulbic field even if it would have 100M lines of code ;)
johannesnestler 2-May-16 10:38am View
   
Reason for my vote of 5 \n I'm the typed langauge type of programmer, so I like rants against untyped languages type-mess ;)
johannesnestler 14-Apr-16 8:20am View
   
cool - would be interested - don't overcomplicate things if not needed - depends how often do you expect such changes that an automatic solution is satisfied
johannesnestler 14-Apr-16 8:18am View
   
just to mention: your idea now would just solve the Attribute Problem, what you do if new columns are added to the database and core-classes? You have to manually Change your model code anyway - a Generator should generate the whole class - all properties, attributes, Interface implementations, ... better invest some time in that, than in your "fragile" reflection code - reflecting on not referenced types - won't go into that anymore....
johannesnestler 14-Apr-16 8:13am View
   
not as far as I know (I'm quite experienced .NET developer) - only TypeDescriptor can be used - but then you have to use also TypeDescriptor to obtain the attributes later (normal reflection wont see them, automatic "Tools" using TypeDescriptor would "see" them - e.g. PropertyGrid control). What can be done is emitting IL code and attributes to that - but then you Limit yourself to IL-only for this part. (Would be much more effort +complicated code)
johannesnestler 14-Apr-16 8:09am View
   
about reference - do whatever you think is clever - I don't agree because: You HAVE A DEPENDENCY and there is a good reason to express this by giving a reference to the WebApp IF you relay on it anyway.... Desing principle not to add a reference you need sounds a little (...) - also the Project name "Core" would lead me to the opposite "prinicple" - always add a reference to it ;)
johannesnestler 14-Apr-16 8:05am View
   
So I would just generate the model classes from the information in the core classes. Have a look at an OR-Mapper like EntityFramework, how they do it (with T4 templates). As I said it would be easiest to use a Generator for the whole class if deterministic enough (should be true for simple model-classes)...
johannesnestler 14-Apr-16 7:36am View
   
if you question yourself why you don't get answers to your question - I can answer that! - learn to ask questions first!
read http://www.codeproject.com/KB/FAQs/QuickAnswersFAQ.aspx
johannesnestler 22-Mar-16 11:09am View
   
just a thought: I build a new multiuser system at the moment, and went for a lock-free "optimistic concurrency" approach, very good scaling and perfomance so far. no need for "lock-Messages" and all those nasty problems you get if you use a "locking strategy" (deadlocks?). just my 2c...
johannesnestler 22-Mar-16 10:42am View
   
Oh man - this kind of question will not bring you any further...there are no shortcuts to get an understanding of any programming "topic" - work through(!) any decent EF Asp.net-With-Data tutorial (web is full of them, but please goolge yourself). So if you can't work out "the essence" from these tutorials you should maybe use the plain MSDN documentation to work through it. But maybe you can eleborate what you mean with "builtin", cause you are using a FRAMEWORK wich has some functionality builtin - or what did you expect?
I don't know what you know, or where you got stuck -but things should be quite simple... Create an context, add/remove/attach/update the objects in the context, call Save and that's it...
johannesnestler 22-Mar-16 10:33am View
   
maybe you could use Xaml Animations (if you create a UWP,WPF or Silverlight, Phone-XAML, ... - App) and Forget about the maths... - you may want to have a look at at the UWP Example library where you can find animations, transitions build into the samples. Slide effects are very easy to create (just Change the Location, margin, or withd properties over time with animations). But even if you don't do an UWP (but other XAML-app), you can find some good ideas there. Oh - now I see you taged C++ - so what I've written will not be useful for you. But when I think about doing such things in C++ I get flashbacks from my old C++ days - brrrr. So hopefully you are using somekind of "Framework" - DirextX or so?
johannesnestler 17-Mar-16 11:26am View
   
sesssssssssssssion?
johannesnestler 17-Mar-16 11:21am View
   
hmm - so you constructed your XML "by Hand" - a little complicated, but why not.. what stops you to do the same, but write to a csv format (or more complicated an xls)? With "more readable" - you mean "better representation" in Excel? - or about what "reader" are you talking?
johannesnestler 17-Mar-16 11:13am View
   
better read any tutorial on this with a step by step instruction, such answeres are hard to give because we don't know what you know. There are so many tutorials for basic CRUD with EF out there, find one for your version of EF (what's wrong with the article you linked? I found this link there (but didn't look at the code): http://www.codeproject.com/KB/database/EFWinForms/EF6Winforms.zip
johannesnestler 17-Mar-16 11:09am View
   
which query-provider are you using? linqtosql, entityframework?
johannesnestler 17-Mar-16 10:30am View
   
that sounds like absolute nonsense - better explain us what you want to achieve - so we can try to help you with your real problem (the problem that lead you to an "idea" like this). In your example it looks like you want to construct a list of lists of all "possible" (????) strings, so not only "ALL" but many lists with "all possible" strings????
johannesnestler 17-Mar-16 10:25am View
   
I don't see any bolded code.. - but after a quick look I'd guess you can not scroll because your stack-panel will give the listview whatever size it wants, to get the scrolling it needs to be "limited", so just set a maxsize on the ListView, or use a grid with fixed rows/colums instead of the stackpanel, etc...
johannesnestler 17-Mar-16 10:19am View
   
what Folder? you mean you can not open your workbook? Sure, how should Excel know about your uri-pack syntax? give it a proper FILE-PATH and it will work...
johannesnestler 14-Mar-16 11:07am View
   
you are technically IMPLEMENTING interfaces in C# and not INHERITING them, so just forget about your "inner C++ Alarm bells", this problem doesn't apply to C#, cause no real multiple inheritance is possible. - sure, in an example like Kornfeld Eliyahu Peter showed you may get the impression you are "inheriting" because of the syntax used to express that a specific class fullfills an interface. If the interfaces would have conflicting methods/member names you can use explicit Interface implementation to avoid that conflicts...
johannesnestler 3-Mar-16 7:34am View
   
I think you have to learn the basics about the inner workings of .NET first, before you can seriously think about "memory" optimization tricks. The good thing in .NET - you normally don't have to. Don't get me wrong, I assume you come from another prgramming domain where such things are/were important (C++?), and therefore you ask this. If you really want to "know" I would suggest you try to experiment with different code and then look at the intermediate language output. e.g properties will generate methods (set/get) and use vtable memory and so on.. - so my point is: If want to "know" about your (custom) .NET memory Management - you have to dive into a lot of (mostly academic) concepts - and .NET was build to free your mind from these... So if you really need to "know" then better do your Project in another language, or write unsafe (-compiled) .NET-code where you control memory for your self. That's the reason I don't see any value in your question - and to find the "correct" style in an "offer" of different grades of syntactic sugar, has nothing to do with memory or perfomance... (you understand that "Properties" are just syntactic sugar in the first place to avoid writing and calling all These get and set functions we used to do in C++)... So code like this:
using System;

namespace PropertyMemoryTest
{
class Program
{
static void Main(string[] args)
{
var withproperty = new WithProperty();
Console.WriteLine(System.Runtime.InteropServices.Marshal.SizeOf(withproperty));
var variable = new WithVariable();
Console.WriteLine(System.Runtime.InteropServices.Marshal.SizeOf(variable));
Console.ReadKey(true);
}
}

struct WithProperty
{
public int Property { get; set; }
}

struct WithVariable
{
public int Variable;
}
}
Won't tell you which is "better" from (total)memory consumption/perfomance , but I think you will agree that the version with property has much more complex IL code. So get over "Micro-optimization" thinking, and think about other thins like maintenance or extensibillity - you will always go for the property vs. "the variable", even if that means double memory consumption (calculate modern RAM cost to the cost an work hour)... jus my 2 c - happy coding!
johannesnestler 2-Mar-16 4:10am View
   
I can not think of any mechanism to do that...
johannesnestler 11-Feb-16 9:23am View
   
Wich UI Technology are you using - for me it sounds as WPF would be a perfect fit. Can Play Video, animate "controls" - have you tried?
johannesnestler 14-Jan-16 10:19am View
   
Before this question can be answered, just tell us what QueryProvider you want to use. (e.g. OR-Mappers are queryproviders for LINQ). You mentioned DataContext - so I'd assume you mean EntityFramework - but .NET 3.5? Wich version of EF are you using? My opinion? EF + LINQ is great, I don't miss such queries in my code, no SQL anymore...
johannesnestler 13-Jan-16 12:24pm View
   
great you solved it!
johannesnestler 13-Jan-16 10:58am View
   
I think you mix up styles with templates here. It's easy to extend and overwrite styles, because there is a basedon attribute you can use (and also override "Default styles", these are styles with no name, but just the type given - so it will apply to all elements (Downstream) of that type without explicitly assigning it. Templates have to be recreated and can't be based on each other.... Confusion may come from the fact, that normally new templates are set through styles...
johannesnestler 15-Dec-15 10:56am View
   
no answer but chances are high you do something wrong: somethings come to my mind you can look for:
* Did you use strong (normal) references where you should have used WeakReference?
* Do you subscribe to handle events of long living objects (the Provider will hold a reference to every subscriber) wich then can't be GCed (may be solved by unsubscribing if handler is not needed any more)
* Do you load other resources on each Navigation which are then refernced by other parts of the System (maybe a static "global" property or something)
* Do you use any unmanaged "things" which may leak memory?
johannesnestler 15-Dec-15 10:43am View
   
Hi I want to read some good questions here!, plz ffwd me a qstn
(avoid abbrevations?)
johannesnestler 9-Dec-15 8:38am View
   
Yes, I think this would be much more efficent and clean...
johannesnestler 3-Dec-15 9:46am View
   
I'll suggest an approach: Sit down, write a clear specification (in words) what you want to do. Analyse what you have now, and what you expect as the final result. Find a good example with values. Then update your question with the clear problem description and the example.