本文整理汇总了C#中ItemToolboxNode类的典型用法代码示例。如果您正苦于以下问题:C# ItemToolboxNode类的具体用法?C# ItemToolboxNode怎么用?C# ItemToolboxNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemToolboxNode类属于命名空间,在下文中一共展示了ItemToolboxNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:nocache,项目名称:monodevelop,代码行数:12,代码来源:SourceEditorView.cs
示例2: ConsumeItem
public void ConsumeItem (ItemToolboxNode node)
{
if (node is ToolboxItemToolboxNode)
editorProcess.Editor.UseToolboxNode (node);
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:5,代码来源:AspNetEditViewContent.cs
示例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;
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:11,代码来源:GuiBuilderView.cs
示例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 ();
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:79,代码来源:Toolbox.cs
示例5: CustomFilterSupports
public bool CustomFilterSupports(ItemToolboxNode item)
{
return false;
}
开发者ID:erbriones,项目名称:monodevelop-classdesigner,代码行数:4,代码来源:AbstractDesigner.cs
示例6: ToolboxUsedEventArgs
public ToolboxUsedEventArgs (IToolboxConsumer consumer, ItemToolboxNode item)
{
this.item = item;
this.consumer = consumer;
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:5,代码来源:ToolboxService.cs
示例7: DragItem
public void DragItem (ItemToolboxNode item, Widget source, Gdk.DragContext ctx)
{
}
开发者ID:segaman,项目名称:monodevelop,代码行数:3,代码来源:AspNetEditViewContent.cs
示例8: ConsumeItem
public abstract void ConsumeItem(ItemToolboxNode item);
开发者ID:erbriones,项目名称:monodevelop-classdesigner,代码行数:1,代码来源:AbstractDesigner.cs
示例9: ConsumeItem
public void ConsumeItem (ItemToolboxNode node)
{
if (node is ToolboxItemToolboxNode)
host.UseToolboxNode (node);
}
开发者ID:segaman,项目名称:monodevelop,代码行数:5,代码来源:AspNetEditViewContent.cs
示例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);
}
}
开发者ID:segaman,项目名称:monodevelop,代码行数:41,代码来源:EditorHost.cs
示例11: UseToolboxNode
public void UseToolboxNode (ItemToolboxNode node)
{
//invoke in GUI thread as it catches and displays exceptions nicely
Gtk.Application.Invoke ( delegate { handleToolboxNode (node); });
}
开发者ID:segaman,项目名称:monodevelop,代码行数:5,代码来源:EditorHost.cs
示例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.");
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:28,代码来源:ToolboxService.cs
示例13: DragItem
public void DragItem(ItemToolboxNode item, Widget source, Gdk.DragContext ctx)
{
drag_item = item;
_source = source;
_source.DragDataGet += OnDragDataGet;
_source.DragEnd += OnDragEnd;
}
开发者ID:erbriones,项目名称:monodevelop-classdesigner,代码行数:7,代码来源:AbstractDesigner.cs
示例14: ToolboxSelectionChangedEventArgs
public ToolboxSelectionChangedEventArgs (ItemToolboxNode item)
{
this.item = item;
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:4,代码来源:ToolboxService.cs
示例15: RemoveUserItem
public void RemoveUserItem (ItemToolboxNode node)
{
Configuration.ItemList.Remove (node);
SaveConfiguration ();
OnToolboxContentsChanged ();
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:6,代码来源:ToolboxService.cs
示例16: CheckReference
void IToolboxConsumer.DragItem (ItemToolboxNode item, Gtk.Widget source, Gdk.DragContext ctx)
{
if (Designer != null) {
ComponentToolboxNode node = item as ComponentToolboxNode;
if (node != null) {
if (node.Reference == null)
Designer.BeginComponentDrag (node.ComponentType, source, ctx);
else
Designer.BeginComponentDrag (node.Name, node.ClassName, source, ctx, delegate { CheckReference (node); });
}
}
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:12,代码来源:GuiBuilderView.cs
示例17: SelectItem
public void SelectItem (ItemToolboxNode item)
{
selectedItem = item;
OnToolboxSelectionChanged (item);
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:5,代码来源:ToolboxService.cs
示例18: AddItem
void AddItem (ComponentIndexFile ifile, ItemToolboxNode co)
{
Gdk.Pixbuf img = co.Icon != null ? co.Icon.ScaleSimple (16, 16, Gdk.InterpType.Bilinear) : null;
if (showCategories) {
TreeIter it;
bool found = false;
if (store.GetIterFirst (out it)) {
do {
if (co.Category == (string) store.GetValue (it, ColName)) {
found = true;
break;
}
}
while (store.IterNext (ref it));
}
if (!found)
it = store.AppendValues (false, co.Category, string.Empty, string.Empty, string.Empty, null, null, false, (int)Pango.Weight.Bold);
store.AppendValues (it, currentItems.ContainsKey (co), co.Name, string.Empty, ifile.Name, ifile.Location, img, co, true, (int)Pango.Weight.Normal);
}
else
store.AppendValues (currentItems.ContainsKey (co), co.Name, string.Empty, ifile.Name, ifile.Location, img, co, true, (int)Pango.Weight.Normal);
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:22,代码来源:ComponentSelectorDialog.cs
示例19: OnToolboxSelectionChanged
protected virtual void OnToolboxSelectionChanged (ItemToolboxNode item)
{
if (ToolboxSelectionChanged != null)
ToolboxSelectionChanged (this, new ToolboxSelectionChangedEventArgs (item));
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:5,代码来源:ToolboxService.cs
示例20: GetDragPreviewText
void IToolboxConsumer.DragItem (ItemToolboxNode item, Gtk.Widget source, Gdk.DragContext ctx)
{
//FIXME: use the preview text
string text = GetDragPreviewText (item);
if (string.IsNullOrEmpty (text))
return;
dragItem = item;
customSource = source;
customSource.DragDataGet += HandleDragDataGet;
customSource.DragEnd += HandleDragEnd;
}
开发者ID:nocache,项目名称:monodevelop,代码行数:11,代码来源:SourceEditorView.cs
注:本文中的ItemToolboxNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论