public UML.Classes.Kernel.Element getUserSelectedElement(List<string> allowedTypes) { //construct the include string string includeString = "IncludedTypes="; var eaTypeNames = new List<string>(); foreach (var allowedType in allowedTypes) { eaTypeNames.Add(((Factory)this.factory).translateTypeName(allowedType)); } includeString += string.Join(",",allowedTypes); //close section includeString += ";"; //get the currently selected package var treeSelectedPackage = this.wrappedModel.GetTreeSelectedPackage(); if (treeSelectedPackage != null) { includeString += "Selection=" + treeSelectedPackage.PackageGUID; //close section includeString += ";"; } //currenlty only supported for ElementWrappers int EAElementID = this.wrappedModel.InvokeConstructPicker(includeString); return this.getElementWrapperByID(EAElementID); }
//let the user select a table from the model public static EDDTable selectTable(TSF_EA.Model model, GlossaryManagerSettings settings) { var tableElement = model.getUserSelectedElement(new List<string> { "Class" }, new List<string> { "table" }) as TSF_EA.Class; if (tableElement == null) return null; var table = DB_EA.DatabaseFactory.createTable(tableElement); if (table == null) return null; return new EDDTable(table, settings); }