示例#1
0
 public Package(EA.Gen.Model.Jet.Package package, Package parent, Context context)
 {
     Name          = package.Name;
     Id            = package.Id;
     this._Package = package;
     Parent        = parent;
     Children      = new List <Package>();
     Classes       = new Dictionary <string, Class>();
     Context       = context;
 }
示例#2
0
        public static Package CreateFromPackage(M.Package package, Package parent, Context ctx)
        {
            Package item = new Package(package, parent, ctx);

            foreach (var child in package.Children)
            {
                item.Add(CreateFromPackage(child, item, ctx));
            }
            return(item);
        }
示例#3
0
        public void GenerateFor(StringBuilder writer, EA.Gen.Model.Jet.Package thisPackage, string tabs, string parents)
        {
            Console.WriteLine(tabs + "Rendering factories for " + thisPackage.Name);
            if (thisPackage.Name != "QL")
            {
                writer.AppendLine("");
                writer.AppendLine(tabs + "module " + Capital(thisPackage.Name) + " =");
                writer.AppendLine(tabs + "  begin");
            }

            foreach (var element in thisPackage.Elements)
            {
                if (element.ObjectType == "Class" &&
                    (element.Visibility == "Public" || element.Visibility == null) &&
                    !element.Name.Contains("<") &&
                    !(element.PDATA3 != null && element.PDATA3.Contains("<PRM1>")) &&
                    element.Name != "engine" &&
                    element.Name != "arguments" &&
                    element.Name != "results" &&
                    element.Name != "Point" &&
                    element.Stereotype != "typedef" &&
                    element.Stereotype != "enumeration" &&
                    element.ParentID == 0 &&
                    element.IsSpec
                    )
                {
                    writer.AppendLine(tabs + "    /// " + (element.Note ?? "").Replace("\n", " ").Replace("\r", ""));
                    writer.AppendLine(tabs + "    let " + element.Name + " = Cephei.Core.FactoryFinder.Find<Cephei." + Factory(parents, "I", element.Name) + "> ()");
//            writer.WriteLine (tabs + "    let " + element.Name + " = new Cephei." + Factory(parents, "C", element.Name) + "() :> Cephei." + Factory(parents, "I", element.Name) );
                }
            }

            foreach (var package in thisPackage.Children)
            {
                GenerateFor(writer, package, tabs + "    ", parents + "." + Capital(package.Name));
            }
            if (thisPackage.Name != "QL")
            {
                writer.AppendLine(tabs + "  end");
            }
        }