コード例 #1
0
        public frmDeviceVolumeMonitor()
        {
            InitializeComponent();

            // -----------------------------------
            // DeviceVolumeMonitor create instance
            // -----------------------------------
            fNative = new DeviceVolumeMonitor(this.Handle);
            fNative.OnVolumeInserted += new DeviceVolumeAction(VolumeInserted);
            fNative.OnVolumeRemoved  += new DeviceVolumeAction(VolumeRemoved);
            UpdateUI();
        }
コード例 #2
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);

            // ------------------------------------
            // DeviceVolumeMonitor dispose instance
            // ------------------------------------
            if (fNative != null)
            {
                fNative.Dispose();
                fNative = null;
            }
        }
コード例 #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aMonitor">A DeviceVolumeMonitor instance that ownes the object</param>
 /// <param name="aHandle">The Windows handle to be used</param>
 public _DeviceVolumeMonitor(DeviceVolumeMonitor aMonitor)
 {
     fMonitor = aMonitor;
 }