public void Update(UmlEnumerationLiteralSpec spec) { eaAttribute.Name = spec.Name; eaAttribute.Stereotype = spec.Stereotype; eaAttribute.Update(); foreach (UmlTaggedValueSpec taggedValueSpec in spec.TaggedValues) { IUmlTaggedValue taggedValue = GetTaggedValue(taggedValueSpec.Name); if (taggedValue.IsDefined) { taggedValue.Update(taggedValueSpec); } else { CreateTaggedValue(taggedValueSpec); } } }
private void Update(UmlPackageSpec spec) { eaPackage.Element.Stereotype = spec.Stereotype; eaPackage.Update(); foreach (UmlTaggedValueSpec taggedValueSpec in spec.TaggedValues) { IUmlTaggedValue taggedValue = GetTaggedValue(taggedValueSpec.Name); if (taggedValue.IsDefined) { taggedValue.Update(taggedValueSpec); } else { CreateTaggedValue(taggedValueSpec); } } }
public void Update(UmlAssociationSpec spec) { eaConnector.Stereotype = spec.Stereotype; eaConnector.ClientID = associatingElementId; eaConnector.ClientEnd.Aggregation = (int)spec.AggregationKind; eaConnector.SupplierID = spec.AssociatedClassifier.Id; eaConnector.SupplierEnd.Role = spec.Name; eaConnector.SupplierEnd.Cardinality = new EaCardinality(spec.LowerBound, spec.UpperBound).ToString(); eaConnector.Update(); foreach (UmlTaggedValueSpec taggedValueSpec in spec.TaggedValues) { IUmlTaggedValue taggedValue = GetTaggedValue(taggedValueSpec.Name); if (taggedValue.IsDefined) { taggedValue.Update(taggedValueSpec); } else { CreateTaggedValue(taggedValueSpec); } } }
public void Update(UmlClassifierSpec spec) { eaElement.Name = spec.Name; eaElement.Stereotype = spec.Stereotype; eaElement.Update(); foreach (UmlTaggedValueSpec taggedValueSpec in spec.TaggedValues) { IUmlTaggedValue taggedValue = GetTaggedValue(taggedValueSpec.Name); if (taggedValue.IsDefined) { taggedValue.Update(taggedValueSpec); } else { CreateTaggedValue(taggedValueSpec); } } eaElement.TaggedValues.Refresh(); for (var i = (short)(eaElement.Attributes.Count - 1); i >= 0; i--) { eaElement.Attributes.Delete(i); } eaElement.Attributes.Refresh(); if (spec.Attributes != null) { foreach (UmlAttributeSpec attributeSpec in spec.Attributes) { CreateAttribute(attributeSpec); } } if (spec is UmlEnumerationSpec) { var enumSpec = (UmlEnumerationSpec)spec; if (enumSpec.EnumerationLiterals != null) { foreach (UmlEnumerationLiteralSpec enumerationLiteralSpec in enumSpec.EnumerationLiterals) { CreateEnumerationLiteral(enumerationLiteralSpec); } } } eaElement.Attributes.Refresh(); for (var i = (short)(eaElement.Connectors.Count - 1); i >= 0; i--) { if (DeleteConnectorOnUpdate((Connector)eaElement.Connectors.GetAt(i))) { eaElement.Connectors.Delete(i); } } if (spec.Associations != null) { foreach (UmlAssociationSpec associationSpec in spec.Associations) { CreateAssociation(associationSpec); } } if (spec.Dependencies != null) { foreach (UmlDependencySpec dependencySpec in spec.Dependencies) { CreateDependency(dependencySpec); } } eaElement.Connectors.Refresh(); }