本文整理汇总了C#中Index.Apply方法的典型用法代码示例。如果您正苦于以下问题:C# Index.Apply方法的具体用法?C# Index.Apply怎么用?C# Index.Apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Index
的用法示例。
在下文中一共展示了Index.Apply方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: buildRepository
/// <summary>Build BPL classes and packages repository.</summary>
private void buildRepository() {
// Init collections
//elementIDs = new Dictionary<string, string>();
packages = new Index<string, BplPackage>(p => p.CanonicName);
elements = new HashSet<BplClass>();
classes = new HashSet<BplClass>();
singletons = new HashSet<BplClass>();
collections = new HashSet<BplClass>();
primitives = new HashSet<BplPrimitive>();
arrays = new HashSet<BplPrimitive>();
// Build Package Tree
int ns = BplLanguage.Namespaces.Count<BplNamespace>();
BplLanguage.Classes.Apply(cls => mapPackageFromClass(cls));
packages.Apply<BplPackage>(pkg => { if (!pkg.IsRoot) packages[pkg.Parent].Packages.Add(pkg); });
// Add all classes to tree
BplLanguage.Classes.Apply<BplClass>(cls => addClass(cls));
}
示例2: buildUmlExtentions
/// <summary>Build standard XMI extentions.</summary>
protected virtual void buildUmlExtentions(Index<string, BplPackage> packages) {
if (!this.IsUmlExtensionIncluded) return;
packages.Apply<BplPackage>(pkg => { if (pkg.IsRoot) AddUmlExtensions(pkg); });
}
示例3: buildToolExtentions
/// <summary>Build tool specific XMI extentions.</summary>
protected virtual void buildToolExtentions(Index<string, BplPackage> packages) {
if (!this.IsToolExtensionIncluded) return;
packages.Apply<BplPackage>(pkg => { if (pkg.IsRoot) AddToolExtensions(pkg); });
// Add primitive types
XElement xEAPrimitiveTypesPackage = new XElement("packagedElement",
new XAttribute(xmiNs + "type", "uml:Package"),
new XAttribute(xmiNs + "id", "EAPrimitiveTypesPackage"),
new XAttribute("name", "EA_PrimitiveTypes_Package"),
new XAttribute("visibility", "public"));
XElement xEATypesPackage = new XElement("packagedElement",
new XAttribute(xmiNs + "type", "uml:Package"),
new XAttribute(xmiNs + "id", "EAC#TypesPackage"),
new XAttribute("name", "EA_PrimitiveTypes_Package"),
new XAttribute("visibility", "public"));
Dictionary<string, string> usedTypes = XmiHelper.GetUsedTypes();
usedTypes.Keys.Apply<string>(key => {
xEATypesPackage.Add(new XElement("packagedElement",
new XAttribute(xmiNs + "id", key),
new XAttribute("name", usedTypes[key]),
new XAttribute("visibility", "public")));
});
xEAPrimitiveTypesPackage.Add(xEATypesPackage);
XmiPrimitives.Add(xEAPrimitiveTypesPackage);
}
示例4: buildUmlXmi
/// <summary>Build standard XMI modle.</summary>
private void buildUmlXmi(Index<string, BplPackage> packages) {
// Add Packages
packages.Apply<BplPackage>(pkg => { if (pkg.IsRoot) this.XmiModel.Add(pkg.GetXmi()); });
}