/// <summary> /// Should a menu item type be created for a specific domain class? /// </summary> /// <param name="menuItemType">Menu item type: e.g.: Add, Delete, ...</param> /// <param name="domainElementType">Domain element type in question.</param> /// <param name="parentElement">Parent element of the domain element to be added, or deleted, or...</param> /// <param name="domainElement">Domain element instance. Is null if this is an AddElementMenuItem type of menu item.</param> /// <param name="processedProviders">Providers that have already been visited.</param> /// <returns>True, if the menu item should be created. False otherwise.</returns> public virtual bool ShouldCreateMenuItem(ModelTreeContextMenuItemType menuItemType, System.Type domainElementType, ModelElement parentElement, ModelElement domainElement, List <IModelTreeContextMenuProvider> processedProviders) { processedProviders.Add(this); foreach (IModelTreeContextMenuProvider p in this.InjectedContextMenuProviders) { if (!processedProviders.Contains(p)) { if (!p.ShouldCreateMenuItem(menuItemType, domainElementType, parentElement, domainElement, processedProviders)) { return(false); } } } return(true); }
/// <summary> /// Should a menu item type be created for a specific domain class? /// </summary> /// <param name="menuItemType">Menu item type: e.g.: Add, Delete, ...</param> /// <param name="domainElementType">Domain element type in question.</param> /// <param name="parentElement">Parent element of the domain element to be added, or deleted, or...</param> /// <param name="domainElement">Domain element instance. Is null if this is an AddElementMenuItem type of menu item.</param> /// <param name="processedProviders">Providers that have already been visited.</param> /// <returns>True, if the menu item should be created. False otherwise.</returns> public virtual bool ShouldCreateMenuItem(ModelTreeContextMenuItemType menuItemType, System.Type domainElementType, ModelElement parentElement, ModelElement domainElement, List<IModelTreeContextMenuProvider> processedProviders) { processedProviders.Add(this); foreach (IModelTreeContextMenuProvider p in this.InjectedContextMenuProviders) if (!processedProviders.Contains(p)) if (!p.ShouldCreateMenuItem(menuItemType, domainElementType, parentElement, domainElement, processedProviders)) return false; return true; }
/// <summary> /// Should a menu item type be created for a specific domain class? /// </summary> /// <param name="menuItemType">Menu item type: e.g.: Add, Delete, ...</param> /// <param name="domainElementType">Domain element type in question.</param> /// <param name="parentElement">Parent element of the domain element to be added, or deleted, or...</param> /// <param name="domainElement">Domain element instance. Is null if this is an AddElementMenuItem type of menu item.</param> /// <returns>True, if the menu item should be created. False otherwise.</returns> public bool ShouldCreateMenuItem(ModelTreeContextMenuItemType menuItemType, System.Type domainElementType, ModelElement parentElement, ModelElement domainElement) { return(ShouldCreateMenuItem(menuItemType, domainElementType, parentElement, domainElement, new List <IModelTreeContextMenuProvider>())); }
/// <summary> /// Should a menu item type be created for a specific domain class? /// </summary> /// <param name="menuItemType">Menu item type: e.g.: Add, Delete, ...</param> /// <param name="domainElementType">Domain element type in question.</param> /// <param name="parentElement">Parent element of the domain element to be added, or deleted, or...</param> /// <param name="domainElement">Domain element instance. Is null if this is an AddElementMenuItem type of menu item.</param> /// <returns>True, if the menu item should be created. False otherwise.</returns> public bool ShouldCreateMenuItem(ModelTreeContextMenuItemType menuItemType, System.Type domainElementType, ModelElement parentElement, ModelElement domainElement) { return ShouldCreateMenuItem(menuItemType, domainElementType, parentElement, domainElement, new List<IModelTreeContextMenuProvider>()); }