public frmDeviceVolumeMonitor() { InitializeComponent(); // ----------------------------------- // DeviceVolumeMonitor create instance // ----------------------------------- fNative = new DeviceVolumeMonitor(this.Handle); fNative.OnVolumeInserted += new DeviceVolumeAction(VolumeInserted); fNative.OnVolumeRemoved += new DeviceVolumeAction(VolumeRemoved); UpdateUI(); }
/// <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; } }
/// <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; }