private void ShapeSelectionForm_Load(object sender, EventArgs e) { var extensibility = ObjectFactory.GetInstance<IExtensibility>( ) ; extensibility.ShapeProviders.ForEach( sp => uiShapeList.Items.Add( new ListViewItem( sp.Name ) { Tag = sp } ) ) ; uiShapeList.View=View.List; uiShapePropertyGrid.PropertyValueChanged += ( s, args ) => _whenShapeChanges( _currentShape.Vertices ) ; var site = new SimpleSite { Name = "GridSite", Component = uiShapePropertyGrid, } ; _glyphService = new GlyphService( ) ; _glyphService.QueryPropertyUIValueItems += verifyDataErrorInfo ; site.AddService<IPropertyValueUIService>( _glyphService ) ; uiShapePropertyGrid.Site = site ; uiShapeList.SelectedItems.Clear( ); uiShapeList.MultiSelect = false ; uiShapeList.Items[ 0 ].Selected = true ; }
private void ShapeSelectionForm_Load(object sender, EventArgs e) { var extensibility = ObjectFactory.GetInstance <IExtensibility>( ); extensibility.ShapeProviders.ForEach( sp => uiShapeList.Items.Add( new ListViewItem(sp.Name) { Tag = sp })); uiShapeList.View = View.List; uiShapePropertyGrid.PropertyValueChanged += (s, args) => _whenShapeChanges(_currentShape.Vertices); var site = new SimpleSite { Name = "GridSite", Component = uiShapePropertyGrid, }; _glyphService = new GlyphService( ); _glyphService.QueryPropertyUIValueItems += verifyDataErrorInfo; site.AddService <IPropertyValueUIService>(_glyphService); uiShapePropertyGrid.Site = site; uiShapeList.SelectedItems.Clear( ); uiShapeList.MultiSelect = false; uiShapeList.Items[0].Selected = true; }
public ISite GetSite() { if (site == null) { var newSite = new SimpleSite(); IPropertyValueUIService service = new PropertyValueUIService(); service.AddPropertyValueUIHandler(new PropertyValueUIHandler(GenericPropertyValueUIHandler)); newSite.AddService(service); site = newSite; } return(site); }
public CustomPropertiesGridControl( ) { InitializeComponent( ) ; if( !Helper.IsInDesignMode ) { _memento = IoC.Memento ; _model = ObjectFactory.GetInstance<IModel>( ) ; _model.SelectionChanged += ( sender, e1 ) => refresh( e1.ItemsAffected ) ; _model.ItemChanged += ( sender1, e2 ) => refresh( e2.ItemsAffected ) ; _model.ActiveLayerChanged += ( s, e ) => refresh( new[ ] { _model.Level.ActiveLayer } ) ; } _grid = new PropertyGrid { Dock = DockStyle.Fill, Visible = false, PropertySort = PropertySort.Categorized, ToolbarVisible = false } ; _grid.PropertyValueChanged += gridPropertyValueChanged ; _grid.SelectedObjectsChanged += gridSelectObjectsChanged; _label = new Label { Dock = DockStyle.Fill, Text = @"Select a single item to view its properties", Visible = true, } ; Controls.Add( _grid ) ; Controls.Add( _label ) ; var site = new SimpleSite { Name = @"GridSite", Component = _grid, } ; _glyphService = new GlyphService( ) ; _glyphService.QueryPropertyUIValueItems += verifyDataErrorInfo ; site.AddService<IPropertyValueUIService>( _glyphService ) ; _grid.Site = site ; }
public ISite GetSite() { if (site == null) { var newSite = new SimpleSite(); IPropertyValueUIService service = new PropertyValueUIService(); service.AddPropertyValueUIHandler(new PropertyValueUIHandler(GenericPropertyValueUIHandler)); newSite.AddService(service); site = newSite; } return site; }