protected void device_PropertyChanged(object sender, DeviceEventArgs e) { if (this.ListView.InvokeRequired) { EventHandler<DeviceEventArgs> del = new EventHandler<DeviceEventArgs>(device_PropertyChanged); ListView.Invoke(del, new Object[] { sender, e }); return; } SetStatusImage(); }
void _device_PropertyChanged(object sender, DeviceEventArgs e) { if (_device == null) return; if (this.InvokeRequired) { EventHandler<DeviceEventArgs> del = new EventHandler<DeviceEventArgs>(_device_PropertyChanged); Invoke(del, new Object[] { sender, e }); return; } Invalidate(); }
void _device_PartitionRemoved(object sender, DeviceEventArgs e) { if (_device == null) return; if (this.InvokeRequired) { EventHandler<DeviceEventArgs> del = new EventHandler<DeviceEventArgs>(_device_PartitionRemoved); Invoke(del, new Object[] { sender, e }); return; } foreach (PartitionControl partitionControl in _partitionControls) { if (partitionControl.Partition == e.Partition) partitionControl.Dispose(); } _partitionControls.RemoveAll( delegate(PartitionControl partitionControl) { return partitionControl.Partition == e.Partition; } ); }
void _device_PartitionAdded(object sender, DeviceEventArgs e) { if (_device == null) return; if (this.InvokeRequired) { EventHandler<DeviceEventArgs> del = new EventHandler<DeviceEventArgs>(_device_PartitionAdded); Invoke(del, new Object[] { sender, e }); return; } _partitionControls.Add(new PartitionControl(this, e.Partition, _hostName)); RearrangePartitions(); Invalidate(); }
/// <summary> /// Событие смены свойств устройства. /// </summary> /// <param name="e">Параметры события.</param> protected virtual void OnPropertyChanged(DeviceEventArgs e) { if (PropertyChanged != null) PropertyChanged(this, e); }
/// <summary> /// Событие удаления раздела. /// </summary> /// <param name="e">Параметры события.</param> protected virtual void OnPartitionRemoved(DeviceEventArgs e) { if (PartitionRemoved != null) PartitionRemoved(this, e); }
void _device_PropertyChanged(object sender, DeviceEventArgs e) { if (_owner == null) return; if (_owner.InvokeRequired) { EventHandler<DeviceEventArgs> del = new EventHandler<DeviceEventArgs>(_device_PropertyChanged); _owner.Invoke(del, new Object[] { sender, e }); return; } _owner.RearrangePartitions(); _owner.Invalidate(); }
protected virtual void OnPropertyChanged(DeviceEventArgs e) { new Util.AsyncEventInvoker<DeviceEventArgs>(PropertyChanged) .InvokeAsync(this, e); }
protected virtual void OnPartitionRemoved(DeviceEventArgs e) { new Util.AsyncEventInvoker<DeviceEventArgs>(PartitionRemoved) .InvokeAsync(this, e); }