protected virtual bool ValidateToolboxDataItemName(ToolboxDataItem item, string name) { return ((name != null) && (name.Length > 0)); }
public bool RenameToolboxDataItem(ToolboxDataItem item, string newName) { if (item.CanSetDisplayName && this.ValidateToolboxDataItemName(item, newName)) { item.SetDisplayName(newName); return true; } return false; }
internal void AddToolboxDataItem(ToolboxDataItem item, bool fireItemsChanged) { this._items.Add(item); if (fireItemsChanged) { this.OnItemsChanged(EventArgs.Empty); } }
public void AddToolboxDataItem(ToolboxDataItem item) { if (item == null) { throw new ArgumentNullException("item"); } this.AddToolboxDataItem(item, true); }
public void RemoveToolboxDataItem(ToolboxDataItem item) { int index = this._items.IndexOf(item); if (index >= 0) { this._items.RemoveAt(index); this.OnItemsChanged(EventArgs.Empty); } }
void IToolboxClient.OnToolboxDataItemPicked(ToolboxDataItem dataItem) { this.OnToolboxDataItemPicked(dataItem); }
public virtual void OnToolboxDataItemPicked(ToolboxDataItem dataItem) { IDesignerHost service = (IDesignerHost) this.ServiceProvider.GetService(typeof(IDesignerHost)); IDataObject dataObject = dataItem.GetDataObject(service); string html = string.Empty; if (dataObject != null) { if (dataObject.GetDataPresent(DataFormats.Html)) { html = dataObject.GetData(DataFormats.Html).ToString(); } else if (dataObject.GetDataPresent(DataFormats.Text)) { html = dataObject.GetData(DataFormats.Text).ToString(); } else if (this.DataObjectConverter.CanConvertToHtml(dataObject) == DataObjectConverterInfo.CanConvert) { DataObject newDataObject = new DataObject(); if (this.DataObjectConverter.ConvertToHtml(dataObject, newDataObject)) { html = (string) newDataObject.GetData(DataFormats.Html); } } BatchedUndoUnit unit = this._editor.OpenBatchUndo("Toolbox"); try { this._editor.Document.InsertHtml(html); } finally { unit.Close(); } } }
public virtual void OnToolboxDataItemPicked(ToolboxDataItem dataItem) { IDesignerHost service = (IDesignerHost) this.ServiceProvider.GetService(typeof(IDesignerHost)); IDataObject dataObject = dataItem.GetDataObject(service); if (dataObject != null) { base.Paste(dataObject); } }
public override void OnToolboxDataItemPicked(ToolboxDataItem dataItem) { if (this.InTemplateMode) { ((IToolboxClient) this._templateEditingDialog.DesignView).OnToolboxDataItemPicked(dataItem); } else { base.OnToolboxDataItemPicked(dataItem); } }
void IToolboxClient.OnToolboxDataItemPicked(ToolboxDataItem dataItem) { if (this._viewToolboxClient != null) { this._viewToolboxClient.OnToolboxDataItemPicked(dataItem); } }
public ToolboxDataGroupViewItem(ToolboxDataItem item, ToolboxToolWindow owner) { this._item = item; this._owner = owner; }
void IToolboxClient.OnToolboxDataItemPicked(ToolboxDataItem dataItem) { if ((this._currentView != null) && (this._currentView.viewToolboxClient != null)) { this._currentView.viewToolboxClient.OnToolboxDataItemPicked(dataItem); } }