private void DoDispose(bool disposing) { if (disposing) { if (_component != null) { _component.PropertyChanged -= OnComponentPropertyChanged; _component = null; } } }
/// <summary> /// Constructor. /// </summary> public AviExportComponentControl(AviExportComponent component) : base(component) { InitializeComponent(); _component = component; _component.PropertyChanged += OnComponentPropertyChanged; base.AcceptButton = _buttonOk; base.CancelButton = _buttonCancel; _trackBarFrameRate.DataBindings.Add("Minimum", _component, "MinFrameRate", true, DataSourceUpdateMode.OnPropertyChanged); _trackBarFrameRate.DataBindings.Add("Maximum", _component, "MaxFrameRate", true, DataSourceUpdateMode.OnPropertyChanged); _trackBarFrameRate.DataBindings.Add("Value", _component, "FrameRate", true, DataSourceUpdateMode.OnPropertyChanged); Binding binding = new Binding("Text", _component, "FrameRate", true, DataSourceUpdateMode.OnPropertyChanged); binding.Format += new ConvertEventHandler(OnFormatFrameRate); _frameRate.DataBindings.Add(binding); binding = new Binding("Text", _component, "DurationSeconds", true, DataSourceUpdateMode.OnPropertyChanged); binding.Format += new ConvertEventHandler(OnFormatDuration); _duration.DataBindings.Add(binding); _checkOptionWysiwyg.DataBindings.Add("Checked", this, "ExportOptionWysiwyg", true, DataSourceUpdateMode.OnPropertyChanged); _checkOptionCompleteImage.DataBindings.Add("Checked", this, "ExportOptionCompleteImage", true, DataSourceUpdateMode.OnPropertyChanged); _checkOptionScale.DataBindings.Add("Checked", this, "SizeModeScale", true, DataSourceUpdateMode.OnPropertyChanged); _checkOptionFixed.DataBindings.Add("Checked", this, "SizeModeFixed", true, DataSourceUpdateMode.OnPropertyChanged); _pnlScale.DataBindings.Add("Enabled", this, "SizeModeScale", true, DataSourceUpdateMode.Never); _pnlFixedSize.DataBindings.Add("Enabled", this, "SizeModeFixed", true, DataSourceUpdateMode.Never); _scale.DataBindings.Add("Maximum", this, "MaximumScalePercent", true, DataSourceUpdateMode.Never); _scale.DataBindings.Add("Minimum", this, "MinimumScalePercent", true, DataSourceUpdateMode.Never); _scale.DataBindings.Add("Value", this, "ScalePercent", true, DataSourceUpdateMode.OnPropertyChanged); _imageWidth.DataBindings.Add("Maximum", _component, "MaximumDimension", true, DataSourceUpdateMode.Never); _imageWidth.DataBindings.Add("Minimum", _component, "MinimumDimension", true, DataSourceUpdateMode.Never); _imageWidth.DataBindings.Add("Value", _component, "Width", true, DataSourceUpdateMode.OnPropertyChanged); _imageHeight.DataBindings.Add("Maximum", _component, "MaximumDimension", true, DataSourceUpdateMode.Never); _imageHeight.DataBindings.Add("Minimum", _component, "MinimumDimension", true, DataSourceUpdateMode.Never); _imageHeight.DataBindings.Add("Value", _component, "Height", true, DataSourceUpdateMode.OnPropertyChanged); _backgroundColorSwatch.DataBindings.Add("BackColor", _component, "BackgroundColor", true, DataSourceUpdateMode.Never); }
/// <summary> /// Constructor. /// </summary> public AviExportComponentControl(AviExportComponent component) :base(component) { InitializeComponent(); _component = component; _component.PropertyChanged += OnComponentPropertyChanged; base.AcceptButton = _buttonOk; base.CancelButton = _buttonCancel; _trackBarFrameRate.DataBindings.Add("Minimum", _component, "MinFrameRate", true, DataSourceUpdateMode.OnPropertyChanged); _trackBarFrameRate.DataBindings.Add("Maximum", _component, "MaxFrameRate", true, DataSourceUpdateMode.OnPropertyChanged); _trackBarFrameRate.DataBindings.Add("Value", _component, "FrameRate", true, DataSourceUpdateMode.OnPropertyChanged); Binding binding = new Binding("Text", _component, "FrameRate", true, DataSourceUpdateMode.OnPropertyChanged); binding.Format += new ConvertEventHandler(OnFormatFrameRate); _frameRate.DataBindings.Add(binding); binding = new Binding("Text", _component, "DurationSeconds", true, DataSourceUpdateMode.OnPropertyChanged); binding.Format += new ConvertEventHandler(OnFormatDuration); _duration.DataBindings.Add(binding); _checkOptionWysiwyg.DataBindings.Add("Checked", this, "ExportOptionWysiwyg", true, DataSourceUpdateMode.OnPropertyChanged); _checkOptionCompleteImage.DataBindings.Add("Checked", this, "ExportOptionCompleteImage", true, DataSourceUpdateMode.OnPropertyChanged); _checkOptionScale.DataBindings.Add("Checked", this, "SizeModeScale", true, DataSourceUpdateMode.OnPropertyChanged); _checkOptionFixed.DataBindings.Add("Checked", this, "SizeModeFixed", true, DataSourceUpdateMode.OnPropertyChanged); _pnlScale.DataBindings.Add("Enabled", this, "SizeModeScale", true, DataSourceUpdateMode.Never); _pnlFixedSize.DataBindings.Add("Enabled", this, "SizeModeFixed", true, DataSourceUpdateMode.Never); _scale.DataBindings.Add("Maximum", this, "MaximumScalePercent", true, DataSourceUpdateMode.Never); _scale.DataBindings.Add("Minimum", this, "MinimumScalePercent", true, DataSourceUpdateMode.Never); _scale.DataBindings.Add("Value", this, "ScalePercent", true, DataSourceUpdateMode.OnPropertyChanged); _imageWidth.DataBindings.Add("Maximum", _component, "MaximumDimension", true, DataSourceUpdateMode.Never); _imageWidth.DataBindings.Add("Minimum", _component, "MinimumDimension", true, DataSourceUpdateMode.Never); _imageWidth.DataBindings.Add("Value", _component, "Width", true, DataSourceUpdateMode.OnPropertyChanged); _imageHeight.DataBindings.Add("Maximum", _component, "MaximumDimension", true, DataSourceUpdateMode.Never); _imageHeight.DataBindings.Add("Minimum", _component, "MinimumDimension", true, DataSourceUpdateMode.Never); _imageHeight.DataBindings.Add("Value", _component, "Height", true, DataSourceUpdateMode.OnPropertyChanged); _backgroundColorSwatch.DataBindings.Add("BackColor", _component, "BackgroundColor", true, DataSourceUpdateMode.Never); }
/// <summary> /// Called by the host to assign this view to a component. /// </summary> public void SetComponent(IApplicationComponent component) { _component = (AviExportComponent)component; }