当前位置: 首页>>代码示例>>C#>>正文


C# Index.Apply方法代码示例

本文整理汇总了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));
      }
开发者ID:borkaborka,项目名称:gmit,代码行数:21,代码来源:XmiGenerator.cs

示例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); });
 }
开发者ID:borkaborka,项目名称:gmit,代码行数:5,代码来源:XmiGenerator.XmiBuilder.cs

示例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);
      }
开发者ID:borkaborka,项目名称:gmit,代码行数:29,代码来源:XmiGenerator.XmiBuilder.cs

示例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()); });
 }
开发者ID:borkaborka,项目名称:gmit,代码行数:5,代码来源:XmiGenerator.XmiBuilder.cs


注:本文中的Index.Apply方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。