//- ctor public PropertyGridHost(DesignSurfaceManagerExt surfaceManager) { const string _signature_ = _Name_ + @"::ctor()"; InitializeComponent(); this.Dock = DockStyle.Fill; //- the surface manager strictly tied with PropertyGridHost if( null == surfaceManager ) throw new ArgumentNullException( "surfaceManager", _signature_ + " - Exception: invalid argument (null)!" ); SurfaceManager = surfaceManager; pgrdPropertyGrid.ToolbarVisible = true; pgrdPropertyGrid.HelpVisible = true; //- the ComboBox is an OBSERVER of PropertyGridHost event: SelectedObjectsChanged //- everytime someone select a new object inside the PropertyGridHost //- | //- +---> the event PropertyGridHost.SelectedObjectsChanged is fired //- | //- the ReloadComboBox() method is called <------------+ //- //- //- //- pgrdPropertyGrid.SelectedObjectsChanged += ( object sender, System.EventArgs e ) => { ReloadComboBox(); }; //- the PropertyGridHost is an OBSERVER of ComboBox event: SelectedIndexChanged //- everytime someone select a new object inside the ComboBox //- | //- +---> the event ComboBox.SelectedIndexChanged is fired //- | //- the OrientPropertyGridTowardsObject() method is called <------------+ //- //- pgrdComboBox.SelectedIndexChanged += ( object sender, System.EventArgs e )=> { if( _bSuppressEvents ) return; OrientPropertyGridTowardsObject(); }; }
public CustomPropertyGridHost(DesignSurfaceManagerExt surfaceManager) { imageNameSettingWindow = new ImageNameSettingsWindow(); bindingTypeAdd = new List <string>(); const string _signature_ = _Name_ + @"::ctor()"; InitializeComponent(); prop = new PropertyGrid(); reportCtrlList = new List <ReportControlsStructure>(); this.Dock = DockStyle.Fill; fontUC = new Font_UC(); if (!File.Exists(bindingFileName)) { foreach (BindingType item in Enum.GetValues(typeof(BindingType)) as BindingType[]) { bindingTypeAdd.Add("$" + item.ToString()); } } else { Deserialize(); } Binding_cbx.DataSource = bindingTypeAdd; LocationX_nud.Value = XLocation; LocationY_nud.Value = YLocation; NameOfTheImage_tbx.Text = logoDefaultValue; panel1.Controls.Add(fontUC); ivlFont = new IVLFont(); //- the surface manager strictly tied with PropertyGridHost if (null == surfaceManager) { throw new ArgumentNullException("surfaceManager", _signature_ + " - Exception: invalid argument (null)!"); } fontUC.Dock = DockStyle.Fill; fontUC.fontValueUpdate += fontUC_fontValueUpdate; SurfaceManager = surfaceManager; }