Exemple #1
0
 /// <summary>
 /// Событие изменения свойств удаленного компьютера.
 /// </summary>
 /// <param name="e">Параметры события.</param>
 protected virtual void OnPropertyChanged(HostEventArgs e)
 {
     if (PropertyChanged != null)
         PropertyChanged(this, e);
 }
Exemple #2
0
 /// <summary>
 /// Событие удаления устройства жесткого диска.
 /// </summary>
 /// <param name="e">Параметры события.</param>
 protected virtual void OnDeviceRemoved(HostEventArgs e)
 {
     if (DeviceRemoved != null)
         DeviceRemoved(this, e);
 }
Exemple #3
0
        void Host_DeviceRemoved(object sender, HostEventArgs e)
        {
            if (this.InvokeRequired)
            {
                EventHandler<HostEventArgs> del
                    = new EventHandler<HostEventArgs>(Host_DeviceRemoved);
                Invoke(del, new Object[] { sender, e });
                return;
            }

            DeviceListViewItem devItemToRemove = null;

            foreach (DeviceListViewItem devItem in devicesListView.Items)
                if (devItem.Device == e.Device)
                {
                    devItemToRemove = devItem;
                    break;
                }

            devicesListView.Items.Remove(devItemToRemove);
            Invalidate();
        }
Exemple #4
0
        void Host_DeviceAdded(object sender, HostEventArgs e)
        {
            if (this.InvokeRequired)
            {
                EventHandler<HostEventArgs> del
                    = new EventHandler<HostEventArgs>(Host_DeviceAdded);
                Invoke(del, new Object[] { sender, e });
                return;
            }

            devicesListView.Items.Add(new DeviceListViewItem(e.Device, _computer));

            // ���� ��� ������ ����������� HDD, �� ������ ��� ��������
            if (devicesListView.Items.Count == 1)
                devicesListView.SelectedIndices.Add(0);

            Invalidate();
        }
Exemple #5
0
 protected virtual void OnPropertyChanged(HostEventArgs e)
 {
     new Util.AsyncEventInvoker<HostEventArgs>(PropertyChanged)
         .InvokeAsync(this, e);
 }
Exemple #6
0
 protected virtual void OnDeviceRemoved(HostEventArgs e)
 {
     new Util.AsyncEventInvoker<HostEventArgs>(DeviceRemoved)
         .InvokeAsync(this, e);
 }