Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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;
                }
                );
        }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Событие смены свойств устройства.
 /// </summary>
 /// <param name="e">Параметры события.</param>
 protected virtual void OnPropertyChanged(DeviceEventArgs e)
 {
     if (PropertyChanged != null)
         PropertyChanged(this, e);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Событие удаления раздела.
 /// </summary>
 /// <param name="e">Параметры события.</param>
 protected virtual void OnPartitionRemoved(DeviceEventArgs e)
 {
     if (PartitionRemoved != null)
         PartitionRemoved(this, e);
 }
Ejemplo n.º 7
0
        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();
        }
Ejemplo n.º 8
0
 protected virtual void OnPropertyChanged(DeviceEventArgs e)
 {
     new Util.AsyncEventInvoker<DeviceEventArgs>(PropertyChanged)
         .InvokeAsync(this, e);
 }
Ejemplo n.º 9
0
 protected virtual void OnPartitionRemoved(DeviceEventArgs e)
 {
     new Util.AsyncEventInvoker<DeviceEventArgs>(PartitionRemoved)
         .InvokeAsync(this, e);
 }