Submitted by patrick on Sun, 05/05/2013 - 20:45
Submitted by patrick on Sun, 05/05/2013 - 20:43
Sometimes you don't want the user to run more than one instance of a program. But if the user associates a filetype with your programm it shall open the filetype in this first instance. The code below uses interprocess communication to find out if there is already another instance. It further allows the first instance to register an eventhandler which can be called from a second instance in order pass its command line parameters to the first instance.
This is how to use the code:
Submitted by patrick on Sun, 05/05/2013 - 20:17
Closures
If you have code like this:
Submitted by patrick on Sun, 05/05/2013 - 00:58
You can use the following code:
ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
Be aware that this code does just accept every certificate and it is not only active for one request but for all requests. You should think before you use this code. But for development convenience or on a test system it might be ok to make your program easier to install and test.
Submitted by patrick on Tue, 04/30/2013 - 23:29
Put the following code in the partial class of your entity context:
Submitted by patrick on Wed, 03/27/2013 - 23:07
I worked on a wpf window containing some controls that were required and that validated the format of the entered data. Once the user pressed a button I wanted to check if there was any validation error and notify the user with an error message. This is how to do it:
Helper class:
Submitted by patrick on Wed, 02/06/2013 - 00:05
Submitted by patrick on Tue, 02/05/2013 - 23:58
Implementation
Uses a heap for fast retrieval of the smallest element as well as a dictionary for a fast access to an element which is already in the data strucutre. This priority queue is not too bad for implementing a Dijkstra (a fibonacci heap would be perfect...).
Code on Github
Submitted by patrick on Tue, 02/05/2013 - 23:46
Implementation
It is a simple implementation of a priority queue which is based on a SortedDictionary. This makes the implementation quite small.
Code on Github
Submitted by patrick on Sun, 10/07/2012 - 21:00
Databinding in General
If it doesn't work check:
- You can just bind to a property. Check that you are not binding on a field
Databinding for ContextMenus in General
ContextMenus in WPF are somehow special. They exist outside the visual tree of the parent control and therefore they are unable to find for example the root element by name. In the following example the binding doesn't work:
Pages