/// <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(); }
private void Dispose(bool disposing) { if (disposing) { lock (this) { _partition.PropertyChanged -= _partition_PropertyChanged; _partition = null; _owner = null; _note = null; } } }