/// <summary> /// Class constructor to create all shapes that belong to one /// UML type of diagram plus common diagram items. /// </summary> /// <param name="pluginViewModel"></param> public ToolBoxControlViewModel(PluginViewModel pluginViewModel, UmlDiagrams umlDiagram) { var shapeCommandModels = UmlElementsManager.Instance.GetUmlDiagramElements(pluginViewModel, umlDiagram); foreach (var item in shapeCommandModels) { this.toolBoxItems.Add(new ToolBoxData(item.ToolBoxImageUrl, item)); } if (umlDiagram != UmlDiagrams.Connector) { shapeCommandModels = UmlElementsManager.Instance.GetUmlDiagramElements(pluginViewModel, UmlDiagrams.Common); foreach (var item in shapeCommandModels) { this.toolBoxItems.Add(new ToolBoxData(item.ToolBoxImageUrl, item)); } } }
public IEnumerable <CommandModelBase> GetUmlDiagramDataDef(PluginViewModel viewModel, UmlDiagrams umlDiagram) { List <CommandModelBase> ret = new List <CommandModelBase>(); UmlTypes[] list = null; this.mDiagrams.TryGetValue(umlDiagram, out list); foreach (var item in list) { ret.Add(UmlElementsManager.Instance.GetCreateUmlShapeCommandModel(viewModel, item)); } return(ret); }
/// <summary> /// Get a collection of <seealso cref="CommandModelBase"/> elements that represents all commands /// necessary to create a toolbox entry that represents the elements for a new uml diagram. /// </summary> /// <param name="viewModel"></param> /// <param name="umlDiagram"></param> /// <returns></returns> public IEnumerable <CommandModelBase> GetUmlDiagramElements(PluginViewModel viewModel, UmlDiagrams umlDiagram) { if (this.mUmlDiagramFactory == null) { this.mUmlDiagramFactory = new UmlDiagramsDataDef(); } return(this.mUmlDiagramFactory.GetUmlDiagramDataDef(viewModel, umlDiagram)); }