protected override void InvokeInternal(CommandProcessorContext cpc) { // check to see if this name is unique string msg = null; if (!ModelHelper.IsUniqueName(typeof(Diagram), _diagrams, _name, true, out msg)) { throw new InvalidOperationException(msg); } var diagram = new Diagram(_diagrams, null); diagram.Id.Value = Guid.NewGuid().ToString("N"); diagram.LocalName.Value = _name; _diagrams.AddDiagram(diagram); XmlModelHelper.NormalizeAndResolve(diagram); _created = diagram; }