A Singleton, in software engineering, is a design pattern that is used when you only want/need to allow one instance of a class. This is specifically useful when the class instantiation of the said class is resource expensive (e.g. database connection, graphics driver, network resource and file streams…). Below is a UML describing the implementation details of a […]
Tag: C#
January 18, 2013
keithrull
Here are two ways you can determine what version of Adobe Flash is currently installed in a machine using C#. 1. You can read the Registry entry for Adobe Flash player located in HKEY_LOCAL_MACHINE\SOFTWARE\MACROMEDIA\FLASHPLAYER and read the value for CurrentVersion key
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
private string FindCurrentlyInstalledFlashVersionUsingRegistry() { var result = String.Empty; try { // HKEY_LOCAL_MACHINE var registryHive = RegistryHive.LocalMachine; // Create a registry key pointer to HKEY_LOCAL_MACHINE in the current machine var registryKey = RegistryKey.OpenRemoteBaseKey(registryHive, Environment.MachineName); // Read the key location for Flash using (RegistryKey item = registryKey.OpenSubKey(@"SOFTWARE\Macromedia\FlashPlayer\")) { // Check if the item is null. if (item != null) { // Read the value for CurrentVersion and return an Empty string if it does not exist result = item.GetValue("CurrentVersion", String.Empty) as string; } } } catch (Exception ex) { //TODO: Write your error handling code right here. } // Return the result of our function return result; } |
2. Use Reflection by creating a new SWFObject (Flash Object) and reading its version […]
August 9, 2012
keithrull
A friend of mine asked me the other day about the tools I am using while developing applications and it took me a good few minutes to tell him all of things I used. I figured I should put it online just in case someone ask again in the future since it was a lot […]
Error: The reference assembly could not be resolved because it has a dependency on System.Web
.NET ,ASP.NETJuly 24, 2012
keithrull
I was working on a sample project today when I encountered this error after adding a new Console Application project to my Visual Studio solution that references other Class Library projects contained in the solution: The referenced assembly “C:devcenterdotnetpersonalKeithRull.BibliaKeithRull.Biblia.Service.RepositorybinDebugKeithRull.Biblia.Service.Repository.dll” could not be resolved because it has a dependency on “System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” which is […]
Error: This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
.NETJuly 2, 2012
keithrull
I received this error while deploying a WCF 4.0 service to a newly created virtual directory. Could not load file or assembly ‘KeithRull.Biblia.Service’ or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. Description: An unhandled exception occurred during the execution of […]
January 30, 2011
keithrull
I was working on a prototype application today when I needed to use a BulletList. At first I thought it existed on the toolkit controls but to my surprise it wasn’t so I ended up creating an ItemsControl template that mimics how a BulletList would behave. I wanted to post it here to show you how I […]
My MIX09 10K Contest Entry: Silverlight Pregnancy Calendar
.NET ,All about Keith ,Contest ,Family ,Fun Stuff ,Pregnancy ,Silverlight ,Tutorial ,WCF ,WPFJanuary 8, 2009
keithrull
I had some free time during the holidays and saw at the MIX09 website that they have a contest entitled MIX09 10K Challenge where they ask participant to create a web application that is either using Microsoft® Silverlight™ or Windows Presentation Foundation, as a XAML Browser Application running in Partial Trust or as a ClickOnce application in 10 kilobytes or […]