本文整理汇总了C#中ItemToolboxNode类的典型用法代码示例。如果您正苦于以下问题:C# ItemToolboxNode类的具体用法?C# ItemToolboxNode怎么用?C# ItemToolboxNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemToolboxNode类属于命名空间,在下文中一共展示了ItemToolboxNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
bool ICustomFilteringToolboxConsumer.SupportsItem (ItemToolboxNode item)
{
ITextToolboxNode textNode = item as ITextToolboxNode;
if (textNode == null)
return false;
//string filename = this.IsUntitled ? UntitledName : ContentName;
//int i = filename.LastIndexOf ('.');
//string ext = i < 0? null : filename.Substring (i + 1);
return textNode.IsCompatibleWith (base.WorkbenchWindow.Document);
}
示例2: ConsumeItem
public void ConsumeItem (ItemToolboxNode node)
{
if (node is ToolboxItemToolboxNode)
editorProcess.Editor.UseToolboxNode (node);
}
示例3:
//Used if ToolboxItemFilterAttribute demands ToolboxItemFilterType.Custom
//If not expecting it, should just return false
bool IToolboxConsumer.CustomFilterSupports (ItemToolboxNode item)
{
ComponentToolboxNode cnode = item as ComponentToolboxNode;
if (cnode != null && gproject.SteticProject != null) {
if (cnode.GtkVersion == null || Mono.Addins.Addin.CompareVersions (gproject.SteticProject.TargetGtkVersion, cnode.GtkVersion) <= 0)
return true;
}
return false;
}
示例4: Toolbox
public Toolbox (ToolboxService toolboxService, IPadWindow container)
{
this.toolboxService = toolboxService;
this.container = container;
#region Toolbar
DockItemToolbar toolbar = container.GetToolbar (PositionType.Top);
filterEntry = new SearchEntry();
filterEntry.Ready = true;
filterEntry.HasFrame = true;
filterEntry.WidthRequest = 150;
filterEntry.Changed += new EventHandler (filterTextChanged);
filterEntry.Show ();
toolbar.Add (filterEntry, true);
catToggleButton = new ToggleButton ();
catToggleButton.Image = new Image (Ide.Gui.Stock.GroupByCategory, IconSize.Menu);
catToggleButton.Toggled += new EventHandler (toggleCategorisation);
catToggleButton.TooltipText = GettextCatalog.GetString ("Show categories");
toolbar.Add (catToggleButton);
compactModeToggleButton = new ToggleButton ();
compactModeToggleButton.Image = new ImageView (ImageService.GetIcon ("md-compact-display", IconSize.Menu));
compactModeToggleButton.Toggled += new EventHandler (ToggleCompactMode);
compactModeToggleButton.TooltipText = GettextCatalog.GetString ("Use compact display");
toolbar.Add (compactModeToggleButton);
toolboxAddButton = new Button (new Gtk.Image (Ide.Gui.Stock.Add, IconSize.Menu));
toolbar.Add (toolboxAddButton);
toolboxAddButton.TooltipText = GettextCatalog.GetString ("Add toolbox items");
toolboxAddButton.Clicked += new EventHandler (toolboxAddButton_Clicked);
toolbar.ShowAll ();
#endregion
toolboxWidget = new ToolboxWidget ();
toolboxWidget.SelectedItemChanged += delegate {
selectedNode = this.toolboxWidget.SelectedItem != null ? this.toolboxWidget.SelectedItem.Tag as ItemToolboxNode : null;
toolboxService.SelectItem (selectedNode);
};
this.toolboxWidget.DragBegin += delegate(object sender, Gtk.DragBeginArgs e) {
if (this.toolboxWidget.SelectedItem != null) {
this.toolboxWidget.HideTooltipWindow ();
toolboxService.DragSelectedItem (this.toolboxWidget, e.Context);
}
};
this.toolboxWidget.ActivateSelectedItem += delegate {
toolboxService.UseSelectedItem ();
};
fontChanger = new MonoDevelop.Ide.Gui.PadFontChanger (toolboxWidget, toolboxWidget.SetCustomFont, toolboxWidget.QueueResize);
this.toolboxWidget.DoPopupMenu = ShowPopup;
scrolledWindow = new MonoDevelop.Components.CompactScrolledWindow ();
base.PackEnd (scrolledWindow, true, true, 0);
base.FocusChain = new Gtk.Widget [] { scrolledWindow };
//Initialise self
scrolledWindow.ShadowType = ShadowType.None;
scrolledWindow.VscrollbarPolicy = PolicyType.Automatic;
scrolledWindow.HscrollbarPolicy = PolicyType.Never;
scrolledWindow.WidthRequest = 150;
scrolledWindow.Add (this.toolboxWidget);
//update view when toolbox service updated
toolboxService.ToolboxContentsChanged += delegate { Refresh (); };
toolboxService.ToolboxConsumerChanged += delegate { Refresh (); };
Refresh ();
//set initial state
this.toolboxWidget.ShowCategories = catToggleButton.Active = true;
compactModeToggleButton.Active = MonoDevelop.Core.PropertyService.Get ("ToolboxIsInCompactMode", false);
this.toolboxWidget.IsListMode = !compactModeToggleButton.Active;
this.ShowAll ();
}
示例5: CustomFilterSupports
public bool CustomFilterSupports(ItemToolboxNode item)
{
return false;
}
示例6: ToolboxUsedEventArgs
public ToolboxUsedEventArgs (IToolboxConsumer consumer, ItemToolboxNode item)
{
this.item = item;
this.consumer = consumer;
}
示例7: DragItem
public void DragItem (ItemToolboxNode item, Widget source, Gdk.DragContext ctx)
{
}
示例8: ConsumeItem
public abstract void ConsumeItem(ItemToolboxNode item);
示例9: ConsumeItem
public void ConsumeItem (ItemToolboxNode node)
{
if (node is ToolboxItemToolboxNode)
host.UseToolboxNode (node);
}
示例10: handleToolboxNode
private void handleToolboxNode (ItemToolboxNode node)
{
ToolboxItemToolboxNode tiNode = node as ToolboxItemToolboxNode;
if (tiNode != null) {
//load the type into this process and get the ToolboxItem
tiNode.Type.Load ();
System.Drawing.Design.ToolboxItem ti = tiNode.GetToolboxItem ();
//web controls have sample HTML that need to be deserialised, in a ToolboxDataAttribute
//TODO: Fix WebControlToolboxItem and (mono classlib's use of it) so we don't have to mess around with type lookups and attributes here
if (ti.AssemblyName != null && ti.TypeName != null) {
//look up and register the type
ITypeResolutionService typeRes = (ITypeResolutionService)designerHost.GetService (typeof(ITypeResolutionService));
typeRes.ReferenceAssembly (ti.AssemblyName);
Type controlType = typeRes.GetType (ti.TypeName, true);
//read the WebControlToolboxItem data from the attribute
AttributeCollection atts = TypeDescriptor.GetAttributes (controlType);
System.Web.UI.ToolboxDataAttribute tda = (System.Web.UI.ToolboxDataAttribute)atts [typeof(System.Web.UI.ToolboxDataAttribute)];
//if it's present
if (tda != null && tda.Data.Length > 0) {
//look up the tag's prefix and insert it into the data
WebFormReferenceManager webRef = designerHost.GetService (typeof(WebFormReferenceManager)) as WebFormReferenceManager;
if (webRef == null)
throw new Exception("Host does not provide an IWebFormReferenceManager");
string aspText = String.Format (tda.Data, webRef.GetTagPrefix (controlType));
System.Diagnostics.Trace.WriteLine ("Toolbox processing ASP.NET item data: " + aspText);
//and add it to the document
designerHost.RootDocument.InsertFragment (aspText);
return;
}
}
//No ToolboxDataAttribute? Get the ToolboxItem to create the components itself
ti.CreateComponents (designerHost);
}
}
示例11: UseToolboxNode
public void UseToolboxNode (ItemToolboxNode node)
{
//invoke in GUI thread as it catches and displays exceptions nicely
Gtk.Application.Invoke ( delegate { handleToolboxNode (node); });
}
示例12: FilterPermitted
//evaluate a filter attribute against a list, and check whether permitted
private bool FilterPermitted (ItemToolboxNode node, ToolboxItemFilterAttribute desFa,
ICollection<ToolboxItemFilterAttribute> filterAgainst, IToolboxConsumer consumer)
{
switch (desFa.FilterType) {
case ToolboxItemFilterType.Allow:
//this is really for matching some other filter string against
return true;
case ToolboxItemFilterType.Custom:
return consumer.CustomFilterSupports (node);
case ToolboxItemFilterType.Prevent:
//if host and toolboxitem have same filterstring, then not permitted
foreach (ToolboxItemFilterAttribute itemFa in filterAgainst)
if (desFa.Match (itemFa))
return false;
return true;
case ToolboxItemFilterType.Require:
//if host and toolboxitem have same filterstring, then permitted, unless one is prevented
foreach (ToolboxItemFilterAttribute itemFa in filterAgainst)
if (desFa.Match (itemFa) && (desFa.FilterType != ToolboxItemFilterType.Prevent))
return true;
return false;
}
throw new InvalidOperationException ("Unexpected ToolboxItemFilterType value.");
}
示例13: DragItem
public void DragItem(ItemToolboxNode item, Widget source, Gdk.DragContext ctx)
{
drag_item = item;
_source = source;
_source.DragDataGet += OnDragDataGet;
_source.DragEnd += OnDragEnd;
}
示例14: ToolboxSelectionChangedEventArgs
public ToolboxSelectionChangedEventArgs (ItemToolboxNode item)
{
this.item = item;
}
示例15: RemoveUserItem
public void RemoveUserItem (ItemToolboxNode node)
{
Configuration.ItemList.Remove (node);
SaveConfiguration ();
OnToolboxContentsChanged ();
}