public class GpsWrapper : System.ComponentModel.Component { #region Singleton private static GpsWrapper instance = null; public static GpsWrapper Instance { get { if(instance == null) instance = new GpsWrapper(); return instance; } } /// <summary> /// Constructor /// Private due to Singleton use /// </summary> private GpsWrapper() { this.Initialize(); } #endregion SingletonNotice the constructor is private so it can't be called from outside the class. When a class makes a call to this it references the singleton like this:
GpsWrapper Gps = GpsWrapper.Instance;If the Gps already exists, the existing instance is passed back, otherwise it is created first.