public AimAnnotationComponentControl(AimAnnotationComponent component) : base(component) { _component = component; InitializeComponent(); _bindingSource = new BindingSource(); _bindingSource.DataSource = _component; SuspendLayout(); var yOffset = 0; foreach (Control ctrl in Controls) { yOffset = Math.Max(yOffset, ctrl.Bottom); } yOffset = Math.Max(5, yOffset); var szTemplate = Size - new Size(Margin.Horizontal, Margin.Vertical + yOffset); _templateCtrlAimTemplate = new Template.TemplateControl(_component); _templateCtrlAimTemplate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; _templateCtrlAimTemplate.Location = new Point(3, yOffset); _templateCtrlAimTemplate.Name = "_templateCtrlAimTemplate"; _templateCtrlAimTemplate.Size = szTemplate; _templateCtrlAimTemplate.TabIndex = 2; Controls.Add(_templateCtrlAimTemplate); ResumeLayout(false); PerformLayout(); InitializeAnnotationTypeCombo(); _templateCtrlAimTemplate.DataBindings.Add("Visible", _bindingSource, "AimTemplateVisible", true, DataSourceUpdateMode.OnPropertyChanged); DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged); }
public AimAnnotationComponentControl(AimAnnotationComponent component) : base(component) { _component = component; InitializeComponent(); _bindingSource = new BindingSource(); _bindingSource.DataSource = _component; SuspendLayout(); var yOffset = 0; foreach(Control ctrl in Controls) yOffset = Math.Max(yOffset, ctrl.Bottom); yOffset = Math.Max(5, yOffset); var szTemplate = Size - new Size(Margin.Horizontal, Margin.Vertical + yOffset); _templateCtrlAimTemplate = new Template.TemplateControl(_component); _templateCtrlAimTemplate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; _templateCtrlAimTemplate.Location = new Point(3, yOffset); _templateCtrlAimTemplate.Name = "_templateCtrlAimTemplate"; _templateCtrlAimTemplate.Size = szTemplate; _templateCtrlAimTemplate.TabIndex = 2; Controls.Add(_templateCtrlAimTemplate); ResumeLayout(false); PerformLayout(); InitializeAnnotationTypeCombo(); _templateCtrlAimTemplate.DataBindings.Add("Visible", _bindingSource, "AimTemplateVisible", true, DataSourceUpdateMode.OnPropertyChanged); DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged); }