예제 #1
0
        public void generate()
        {
            string built_in_type_subfoler = "built_in_type";

            Variable.built_in_type = built_in_type;
            ClassGen.built_in_type = built_in_type;

            Wrapper.makeTapStr(4);

            string subBuiltInPath = System.IO.Path.Combine(rootFolder_, built_in_type_subfoler);

            System.IO.Directory.CreateDirectory(subBuiltInPath);
            foreach (string item in built_in_type)
            {
                includePath.Add(item, built_in_type_subfoler);
            }


            foreach (string item in built_in_type)
            {
                XsdBuiltInVariable xbv = new XsdBuiltInVariable(item);

                using (var writer = new StringWriter())
                {
                    writer.WriteLine(xbv.Code);
                    File.WriteAllText(Path.Combine(subBuiltInPath, xbv.CName + ".cs"), writer.GetStringBuilder().ToString());
                }
            }

            //--------------------------------------------------------
            System.IO.DriveInfo di = new System.IO.DriveInfo(@"D:\");
            Console.WriteLine(di.TotalFreeSpace);
            Console.WriteLine(di.VolumeLabel);

            // Get the root directory and print out some information about it.
            System.IO.DirectoryInfo dirInfo = new DirectoryInfo(xsdFolder_);
            Console.WriteLine(dirInfo.Attributes.ToString());

            //System.IO.FileInfo[] fileNames = dirInfo.GetFiles("*.xsd");
            System.IO.FileInfo[] fileNames = dirInfo.GetFiles("RiskMonitor-0-1.xsd");

            var rootAllIncludeWriter = new StringWriter();

            foreach (System.IO.FileInfo fi in fileNames)
            {
                RegistEleForRefAttribute(fi.Name);
            }
            foreach (System.IO.FileInfo fi in fileNames)
            {
                Console.WriteLine("{0}: {1}: {2}", fi.Name, fi.LastAccessTime, fi.Length);
                this.Generation(fi.Name);
                string directoryName = fi.Name.Replace(".xsd", "");
            }
        }
        static void Main(string[] args)
        {

            string built_in_type_subfoler = "built_in_type";
            Variable.built_in_type = built_in_type;
            ClassGen.built_in_type = built_in_type;

            Wrapper.makeTapStr(4);

            string subBuiltInPath = System.IO.Path.Combine(rootFolder, built_in_type_subfoler);
            System.IO.Directory.CreateDirectory(subBuiltInPath);
            foreach (string item in built_in_type)
            {
                includePath.Add(item, built_in_type_subfoler);
            }


            foreach (string item in built_in_type)
            {
                XsdBuiltInVariable xbv = new XsdBuiltInVariable(item);

                using (var writer = new StringWriter())
                {
                    writer.WriteLine(xbv.Code);
                    File.WriteAllText(Path.Combine(subBuiltInPath, xbv.CName + ".cs"), writer.GetStringBuilder().ToString());
                }
            }



            //--------------------------------------------------------
            System.IO.DriveInfo di = new System.IO.DriveInfo(@"D:\");
            Console.WriteLine(di.TotalFreeSpace);
            Console.WriteLine(di.VolumeLabel);

            // Get the root directory and print out some information about it.
            System.IO.DirectoryInfo dirInfo = new DirectoryInfo(xsdFolder);
            Console.WriteLine(dirInfo.Attributes.ToString());

            System.IO.FileInfo[] fileNames = dirInfo.GetFiles("*.xsd");

            var rootAllIncludeWriter = new StringWriter();

            foreach (System.IO.FileInfo fi in fileNames)
            {
                RegistEleForRefAttribute(fi.Name);
            }
            foreach (System.IO.FileInfo fi in fileNames)
            {
                Console.WriteLine("{0}: {1}: {2}", fi.Name, fi.LastAccessTime, fi.Length);
                Generation(fi.Name);
                string directoryName = fi.Name.Replace(".xsd", "");
            }
        }