Reliable bring external process window to foreground with C#

4 Comments

If you want to reliable bring the main window of an external process to the foreground in C#, use the “simulate alt key” technique found at: http://stackoverflow.com/questions/10740346/setforegroundwindow-only-working-while-visual-studio-is-open Just start Notepad, then run the following test

All new C# 6 and beyond features and their status

0 Comments

All new C# 6 and beyond features and their status, can be found at: https://roslyn.codeplex.com/wikipage?title=Language%20Feature%20Status&referringTitle=Home This sight also contains the design meetings, so you are able to predict which direction the creators of C# are

C# snippet: Add CommonAssemblyInfo.cs as link to all C# projects.

0 Comments

We use a CommonAssemblyInfo.cs file, to contain all common AssemblyInfo information for all projects. Like: [assembly: AssemblyVersion("0.0.0.0")] [assembly: AssemblyFileVersion("0.0.0.0")] [assembly: AssemblyCompanyAttribute("ADA ICT")] [assembly: AssemblyCopyrightAttribute("Copyright © ADA ICT 2014")] Our continuous integration system, alters the CommonAssemblyInfo.cs

Casting when dealing with nullable fields in a SqlDataReader

0 Comments

When dealing with nullable fields in a SqlDataReader, use: int? field_a = reader["field_a"] as int?; string field_b = reader["field_a"] as string; instead of: int? field_a = Convert.ToInt32(reader["field_a"]); string field_b = Convert.ToString(reader["field_a"]); http://stackoverflow.com/questions/2141575/how-to-efficiently-convert-cast-a-sqldatareader-field-to-its-corresponding