string GetNewId(NodeTypeEntry nte) { string ret = nte.DefaultLabel + idcounter++; if (Model.Entities.Entity.Any(item => item.Label == ret)) { return(GetNewId(nte)); } return(ret); }
void InitializeGraphNodeTypes() { graphEditor.NodeTypes.Clear(); string contextMenuString = Model.ModellerType == ModellerType.Blueprint41 ? "New Entity" : "New Node"; string label = Model.ModellerType == ModellerType.Blueprint41 ? "Entity" : "Node"; if (graphEditor.NodeTypes.SingleOrDefault(x => x.Name == contextMenuString) == null) { newNodeTypeEntity = new NodeTypeEntry(contextMenuString, Microsoft.Msagl.Drawing.Shape.Circle, Microsoft.Msagl.Drawing.Color.Transparent, Microsoft.Msagl.Drawing.Color.Black, 10, null, label); graphEditor.AddNodeType(newNodeTypeEntity); } }