Language : csharp
|Different colors in console string||Rick||C#||console||
This is way to get different fg and bg colors inside 1 string. You provide escape like characters to define colors.
This is a fg of #rRed #xand now we're back to normal. This is a bg of $bBlue#x and now we're back to normal. I can combine fg & bg#r$bcolors #xalso.
|Linq Statement to pull all matching values from List||heathbo||C#||
This is a Linq statement to pull all the matching values (123) from the List.
|Numeric input validator behavior||dck11||C#||WPF||
behavior for validating numeric input
|xml test library||ashvin8085hotmail||C#||test||
Simple C# library that can be used to test xml. Test rules are defined in the form of xml file.
|Actions, Predicates and Funcs||azmi||C#||action||
Short sample code on how to create and use Actions, Predicates and Funcs
|Get Windows Service Start Mode||TheSemicolon||C#||windows||
Used to get the service start mode (manual, automatic, disabled, etc) for a given WIndows service. Logging is performed using nLog, but that line can be removed for "other" purposes.
|XmlDocument extension method to create CData sections with CData terminators inside||thedark||C#||xml||
XmlDocument will not behave when you try to CreateCDataSection passing it a string that contains "]]>"
This extension method returns an array of XmlCDataSection, each of which will contain the parts separated by "]]" and ">". Example:
For the string "This string contains ]]>, and ]]> is invalid within CData sections", the return value will be an array containing the following XmlCDataSections:
"This string contains ]]" ">, and ]]" "> is invalid within CData sections"
which works beautifully.
Optimizations are welcome.
Algorithme simple de cryptage
|WPF Custom Styled Button||heathbo||C#||
This code gives you the ability to stylize the buttons background, and borders on events.
Bind and link to a DataGrid.
You first must have a source of data to bind to a DataGrid. For this were using an ObservableCollection of BoxSizes objects.
We are using a DataGrid titled boxGrid;
Note: Use ObservableCollection instead of List because any changes made to the ObservableCollection will automatically be shown in the DataGrid. Not so with List.
|getting invoking url and params||abrady0||C#||Unity||
quick example of how to get invoking URL in unity
|WPF open window||heathbo||C#||
Open a window that's already been created.
You first have to create a new window.xaml by right clicking on project / add / Window. In this instance we will call it WindowNew2.
|WPF menu customization||heathbo||C#||
Add this code inside of the tags in the code behind.
Each Header is what you see. Command is the method that will be run when this menu item is selected. Image Source is an image that shows to the left of the word.