本文整理汇总了C#中Schema.createSubsetModel方法的典型用法代码示例。如果您正苦于以下问题:C# Schema.createSubsetModel方法的具体用法?C# Schema.createSubsetModel怎么用?C# Schema.createSubsetModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schema
的用法示例。
在下文中一共展示了Schema.createSubsetModel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createNewMessageSubset
/// <summary>
/// Creates a new message subset from the given schema in the given targetPackage
/// </summary>
/// <param name="schema">the Schema to generate a message subset from</param>
/// <param name="targetPackage">the Package to create the new Message subset in</param>
private void createNewMessageSubset(Schema schema, UML.Classes.Kernel.Package targetPackage)
{
if (targetPackage != null)
{
//Logger.log("before ECDMMessageComposerAddin::schema.createSubsetModel");
schema.createSubsetModel(targetPackage);
//Logger.log("after ECDMMessageComposerAddin::schema.createSubsetModel");
// then make a diagram and put the subset on it
UML.Diagrams.ClassDiagram subsetDiagram = this.model.factory.createNewDiagram<UML.Diagrams.ClassDiagram>(targetPackage, targetPackage.name);
subsetDiagram.save();
//Logger.log("after ECDMMessageComposerAddin::create subsetDiagram");
//put the subset elements on the new diagram
foreach (SchemaElement schemaElement in schema.elements)
{
if (schemaElement.subsetElement != null)
{
subsetDiagram.addToDiagram(schemaElement.subsetElement);
}else
{
//we add the source element if the subset element doesn't exist.
subsetDiagram.addToDiagram(schemaElement.sourceElement);
}
}
//Logger.log("after ECDMMessageComposerAddin::adding elements");
//layout the diagram (this will open the diagram as well)
subsetDiagram.autoLayout();
//Logger.log("after ECDMMessageComposerAddin::autolayout");
}
}