How do I exit a WPF application programmatically?

To exit your application you can call As described in the documentation to the Application.Shutdown method you can also modify the shutdown behavior of your application by specifying a ShutdownMode: Shutdown is implicitly called by Windows Presentation Foundation (WPF) in the following situations: When ShutdownMode is set to OnLastWindowClose. When the ShutdownMode is set to OnMainWindowClose. When a … Read more

c# Show Windows Form

This creates a new instance of type Form: Which, of course, is a blank form. It would appear that your type is called frmLogin. Normally this sounds like a variable name and not a class name, but the error you’re getting here tells me that it’s a class: Given that, then the quickest way to … Read more

Unexpected character encountered while parsing value

Possibly you are not passing JSON to DeserializeObject. It looks like from File.WriteAllText(tmpfile,… that type of tmpfile is string that contain path to a file. JsonConvert.DeserializeObject takes JSON value, not file path – so it fails trying to convert something like @”c:\temp\fooo” – which is clearly not JSON.

When do we use ANTLR

You would need these dll’s if you are parsing any text at runtime using an antlr grammar. Typically there are two steps. 1) run the java antlr parser over your .g files to generate a C# lexer, C# grammar and possibly C# tree walkers. 2) Build those files into your application. Those files will work … Read more

How can I implement static methods on an interface?

You can’t define static members on an interface in C#. An interface is a contract for instances. I would recommend creating the interface as you are currently, but without the static keyword. Then create a class StaticIInterface that implements the interface and calls the static C++ methods. To do unit testing, create another class FakeIInterface, that also implements the … Read more