Example #1
0
        /// <summary>
        /// Конструктор класса.
        /// </summary>
        public DeviceControl(DeviceDiagram diagram, IDevice device)
        {
            if (diagram == null)
                throw new ArgumentNullException("diagram");
            if (device == null)
                throw new ArgumentNullException("device");

            _owner = diagram;
            _device = device;

            _device.PropertyChanged += new EventHandler<DeviceEventArgs>(_device_PropertyChanged);
        }
Example #2
0
        /// <summary>
        /// Конструктор класса.
        /// </summary>
        /// <param name="diagram">Родительская диаграмма разделов.</param>
        /// <param name="partition">Модель раздела.</param>
        public PartitionControl(DeviceDiagram diagram, IPartition partition, string hostName)
        {
            if (diagram == null)
                throw new ArgumentNullException("diagram");
            if (partition == null)
                throw new ArgumentNullException("partition");

            _owner = diagram;
            _partition = partition;

            _hostName = hostName;

            _note = new PartitionNoteControl(this, _hostName);

            _partition.PropertyChanged += new EventHandler<PartitionEventArgs>(_partition_PropertyChanged);

            Invalidate();
        }
Example #3
0
        /// <summary>
        /// ������������� ����������, ������� �����
        /// ������������ ����������.
        /// </summary>
        /// <param name="device">����������.</param>
        private void SetActiveDevice(IDevice device)
        {
            if (device == null)
            {
                diagramPanel.Controls.Clear();
                return;
            }

            // ���� ��������� ��� ���� � �����������, �� ������ �������
            // �, ����� ������� ����� � ���������.
            if (!_diagramMap.ContainsKey(device))
            {
                DeviceDiagram diagram = new DeviceDiagram(device, _computer.Hostname);
                diagram.Dock = DockStyle.Fill;
                _diagramMap.Add(device, diagram);
            }

            diagramPanel.Controls.Clear();
            diagramPanel.Controls.Add(_diagramMap[device]);
        }