public IFormItem GetFormItem(IToolboxItem toolboxItem) { return(toolboxItem switch { MeasurementToolboxItem measurement => CreateMeasurementFormItem(), _ => null });
public static void CallUseToolBoxItem(IToolboxItem item) { if (UseToolBoxItem != null) { UseToolBoxItem(item); } }
/// <summary> /// Determines whether a tool (a.k.a toolbox item) should be visible in the <see cref="ZoneEditor"/>. /// </summary> /// <param name="tool">The tool in question.</param> /// <returns><c>true</c> if it should be visible.</returns> public bool IsToolVisible(IToolboxItem tool) { if (tool == null) return true; var currentFramework = this.frameworkExtractor(); // Everything works for Hybrid mode. No need to reflect on the specific item. if (currentFramework == PageTemplateFramework.Hybrid) return true; if (!tool.ControlType.IsNullOrEmpty()) { var controlType = TypeResolutionService.ResolveType(tool.ControlType, throwOnError: false); if (controlType == null) return true; var isLayoutControl = typeof(LayoutControl).IsAssignableFrom(controlType); var isGridControl = typeof(GridControl).IsAssignableFrom(controlType); if (currentFramework == PageTemplateFramework.WebForms && isGridControl) return false; if (currentFramework == PageTemplateFramework.Mvc && isLayoutControl && !isGridControl) return false; } return true; }
private bool CheckItemUp(IToolboxItem item) { if (item.Parent.Items.IndexOf(item) <= 0) { return(false); } return(true); }
private bool CheckItemDown(IToolboxItem item) { if (item.Parent.Items.IndexOf(item) >= item.Parent.Items.Count - 1) { return(false); } return(true); }
private void CreateFormItem(IToolboxItem toolboxItem) { IFormItem formItem = m_formItemFactory.GetFormItem(toolboxItem); FormItems.Add(formItem); SelectFormItem(formItem); }
private void Border_Drop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(typeof(IToolboxItem))) { IToolboxItem toolBoxItem = (IToolboxItem)e.Data.GetData(typeof(IToolboxItem)); m_formSurfaceViewModel.CreateFormItemCommand.Execute(toolBoxItem); } }
private void MoveItemUp(IToolboxItem item) { if (item.Parent == null) { return; } var parent = item.Parent; var index = item.Parent.Items.IndexOf(item); parent.Items.RemoveAt(index); parent.Items.Insert(index - 1, item); _toolbox.SelectedNode = item; }
/// <inheritdoc /> public virtual bool IsToolVisible(IToolboxItem tool) { var isFeatherDeactivated = SystemManager.GetModule("Feather") == null; if (isFeatherDeactivated) { var isFeatherWidget = tool.ControllerType.StartsWith("Telerik.Sitefinity.Frontend", StringComparison.Ordinal); if (isFeatherWidget) { return(false); } } return(true); }
void HToolbox_UseToolBoxItem(IToolboxItem obj) { if (!EnabledDesign) { return; } if (!IsContentVisible) { return; } var wt = obj as WidgetToolboxItem; if (wt == null) { return; } AddWidget(wt.CreateWidget()); }
private void AddItem(IToolboxItem src) { string tabName = Texts.Get(src.Category); var item = new ToolboxItem(src.ItemType); item.Bitmap = src.Image; item.DisplayName = Texts.Get(src.DisplayName); item.Description = Texts.Get(src.Description); Toolbox.Tab tab = hostToolbox1.Categories[tabName]; if (tab == null) { tab = new Toolbox.Tab(tabName); tab.Opened = true; hostToolbox1.Categories.Add(tab); } var hostitem = new HostToolbox.HostItem(item); hostitem.Tag = src; tab.Items.Add(hostitem); }
/// <summary> /// Determines whether a tool (a.k.a toolbox item) should be visible in the <see cref="ZoneEditor"/>. /// </summary> /// <param name="tool">The tool in question.</param> /// <returns><c>true</c> if it should be visible.</returns> public bool IsToolVisible(IToolboxItem tool) { if (tool == null) { return(true); } var currentFramework = this.frameworkExtractor(); // Everything works for Hybrid mode. No need to reflect on the specific item. if (currentFramework == PageTemplateFramework.Hybrid) { return(true); } if (!tool.ControlType.IsNullOrEmpty()) { var controlType = TypeResolutionService.ResolveType(tool.ControlType, throwOnError: false); if (controlType == null) { return(true); } var isLayoutControl = typeof(LayoutControl).IsAssignableFrom(controlType); var isGridControl = typeof(GridControl).IsAssignableFrom(controlType); if (currentFramework == PageTemplateFramework.WebForms && isGridControl) { return(false); } if (currentFramework == PageTemplateFramework.Mvc && isLayoutControl && !isGridControl) { return(false); } } return(true); }
public static MessageBoxResult AskUserForRemove(IToolboxItem item) { IoC.Get <IMafUIShell>().GetAppName(out var name); return(MessageBox.Show(string.Format(ToolboxResources.ToolboxItemDeleteMessage, item.Name), name, MessageBoxButton.OKCancel, MessageBoxImage.Warning, MessageBoxResult.OK)); }