Exemplo n.º 1
0
 /// <summary>
 ///     Private implementation of Dispose()
 /// </summary>
 /// <param name="disposing">
 ///     flag to indicate if we should actually perform disposal.  Distinguishes the private method
 ///     signature from the public signature.
 /// </param>
 private void Dispose(bool disposing)
 {
     if (!_isDisposed)
     {
         if (disposing)
         {
             _instance = null;
         }
     }
     _isDisposed = true;
 }
        /// <summary>
        ///     Discovers the physical controls that appear on this device,
        ///     as reported by the PHCC Interface Library, and stores them as an array
        ///     of PhysicalControlInfo objects at the instance level.
        ///     NOT guaranteed to be successful -- if the calls to
        ///     the PHCC Interface Library fail or if the device
        ///     is not currently communicating, then the controls list will remain
        ///     unpopulated.
        /// </summary>
        protected override void LoadControls()
        {
            if (_controlsLoaded)
            {
                return;
            }
            var manager = PHCCDeviceManager.GetInstance();

            if (!PHCCDeviceManager.IsDeviceAttached(this, false))
            {
                return;
            }
            _controls       = PHCCDeviceManager.GetControlsOnDevice(this, false);
            _controlsLoaded = true;
        }
Exemplo n.º 3
0
 public static PHCCDeviceManager GetInstance()
 {
     return(_instance ?? (_instance = new PHCCDeviceManager()));
 }