protected virtual void Dispose(bool disposing) { if ((!this.disposedValue && disposing) && (this._styleNameList != null)) { this._styleNameList.Dispose(); this._styleNameList = null; } this.disposedValue = true; }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object Value) { // this method is called when we click on drop-down arrow if (context != null && context.Instance != null) { Base c = context.Instance is Base ? context.Instance as Base : ((object[])context.Instance)[0] as Base; edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); StyleListBox lb = new StyleListBox(); lb.BorderStyle = BorderStyle.None; lb.Styles = c.Report.Styles; lb.Style = (string)Value; lb.StyleSelected += new EventHandler(lb_StyleSelected); lb.Height = (lb.Items.Count < 8 ? lb.Items.Count : 8) * lb.ItemHeight; edSvc.DropDownControl(lb); return(lb.Style); } return(Value); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (provider != null) { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc == null || context == null || (context.Instance == null)) { return(value); } if (this._styleNameList == null) { this._styleNameList = new StyleListBox(this); } this._styleNameList.Start(edSvc, value); edSvc.DropDownControl(this._styleNameList); if (this._styleNameList.Value != null) { value = this._styleNameList.Value; } this._styleNameList.End(); } return(value); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.propertyGrid = new System.Windows.Forms.PropertyGrid(); this.splitter1 = new System.Windows.Forms.Splitter(); this.styleListBox = new Dataweb.NShape.WinFormsUI.StyleListBox(); this.styleCollectionListBox = new Dataweb.NShape.WinFormsUI.VerticalTabControl(); this.propertyPresenter = new Dataweb.NShape.WinFormsUI.PropertyPresenter(); this.propertyController = new Dataweb.NShape.Controllers.PropertyController(); this.SuspendLayout(); // // propertyGrid // this.propertyGrid.Dock = System.Windows.Forms.DockStyle.Right; this.propertyGrid.Location = new System.Drawing.Point(348, 0); this.propertyGrid.Name = "propertyGrid"; this.propertyGrid.Size = new System.Drawing.Size(254, 432); this.propertyGrid.TabIndex = 0; this.propertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid_PropertyValueChanged); // // splitter1 // this.splitter1.BackColor = System.Drawing.SystemColors.Control; this.splitter1.Dock = System.Windows.Forms.DockStyle.Right; this.splitter1.Location = new System.Drawing.Point(345, 0); this.splitter1.Name = "splitter1"; this.splitter1.Size = new System.Drawing.Size(3, 432); this.splitter1.TabIndex = 1; this.splitter1.TabStop = false; // // styleListBox // this.styleListBox.BackColor = System.Drawing.SystemColors.Window; this.styleListBox.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.styleListBox.BorderStyle = System.Windows.Forms.BorderStyle.None; this.styleListBox.Dock = System.Windows.Forms.DockStyle.Fill; this.styleListBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; this.styleListBox.FocusBorderColor = System.Drawing.Color.Transparent; this.styleListBox.FormattingEnabled = true; this.styleListBox.HighlightItems = true; this.styleListBox.IntegralHeight = false; this.styleListBox.ItemBackgroundColor = System.Drawing.SystemColors.Window; this.styleListBox.ItemBorderColor = System.Drawing.Color.Transparent; this.styleListBox.ItemFocusedColor = System.Drawing.Color.Transparent; this.styleListBox.ItemHighlightedColor = System.Drawing.SystemColors.HighlightText; this.styleListBox.ItemSelectedColor = System.Drawing.SystemColors.MenuHighlight; this.styleListBox.Location = new System.Drawing.Point(102, 0); this.styleListBox.Name = "styleListBox"; this.styleListBox.SelectedStyle = null; this.styleListBox.Size = new System.Drawing.Size(243, 432); this.styleListBox.StyleCategory = Dataweb.NShape.StyleCategory.CapStyle; this.styleListBox.TabIndex = 6; this.styleListBox.TextColor = System.Drawing.SystemColors.WindowText; this.styleListBox.SelectedIndexChanged += new System.EventHandler(this.styleListBox_SelectedIndexChanged); // // styleCollectionListBox // this.styleCollectionListBox.BackColor = System.Drawing.SystemColors.Control; this.styleCollectionListBox.BorderStyle = System.Windows.Forms.BorderStyle.None; this.styleCollectionListBox.Dock = System.Windows.Forms.DockStyle.Left; this.styleCollectionListBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; this.styleCollectionListBox.FocusBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(245)))), ((int)(((byte)(245)))), ((int)(((byte)(220))))); this.styleCollectionListBox.FocusedItemColor = System.Drawing.Color.Beige; this.styleCollectionListBox.FormattingEnabled = true; this.styleCollectionListBox.HighlightedItemColor = System.Drawing.SystemColors.ControlLightLight; this.styleCollectionListBox.InactiveItemBackgroundColor = System.Drawing.SystemColors.Control; this.styleCollectionListBox.InactiveItemBorderColor = System.Drawing.SystemColors.Window; this.styleCollectionListBox.InactiveItemTextColor = System.Drawing.SystemColors.ControlDarkDark; this.styleCollectionListBox.IntegralHeight = false; this.styleCollectionListBox.Location = new System.Drawing.Point(0, 0); this.styleCollectionListBox.Margin = new System.Windows.Forms.Padding(3, 3, 10, 3); this.styleCollectionListBox.Name = "styleCollectionListBox"; this.styleCollectionListBox.SelectedItemColor = System.Drawing.SystemColors.Window; this.styleCollectionListBox.SelectedItemTextColor = System.Drawing.SystemColors.ControlText; this.styleCollectionListBox.Size = new System.Drawing.Size(102, 432); this.styleCollectionListBox.TabIndex = 5; this.styleCollectionListBox.SelectedIndexChanged += new System.EventHandler(this.styleCollectionListBox_SelectedIndexChanged); // // propertyPresenter // this.propertyPresenter.PrimaryPropertyGrid = this.propertyGrid; this.propertyPresenter.PropertyController = this.propertyController; this.propertyPresenter.SecondaryPropertyGrid = null; // // propertyController // this.propertyController.Project = null; // // DesignPresenter // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.styleListBox); this.Controls.Add(this.styleCollectionListBox); this.Controls.Add(this.splitter1); this.Controls.Add(this.propertyGrid); this.DoubleBuffered = true; this.Name = "DesignPresenter"; this.Size = new System.Drawing.Size(602, 432); this.ResumeLayout(false); }