Beispiel #1
0
        private void btnParserGenerate_Click(object sender, EventArgs e)
        {
            XmlDocument lastParserOutput = new XmlDocument();

            lastParserOutput.LoadXml(tbParserOutput.Text);
            tcMain.SelectedTab = tcpSourceCode;
            TikSourceGenerator generator = new TikSourceGenerator(lastParserOutput);
            string             designerCode;
            string             userCode;

            generator.GenerateSource(out designerCode, out userCode);

            eSourceCodeDesigner.Text = designerCode;
            eSourceCodeCustom.Text   = userCode;
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            if (args.Length != 2)
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
            }
            else
            {
                AttachConsole(ATTACH_PARENT_PROCESS);
                ///"v:\Projekty.Mikrotik\tik4net\trunk\tools\defs\Log.xml" "v:\Projekty.Mikrotik\tik4net\trunk\tik4net\Log"
                try
                {
                    string entitySourceXml = args[0];
                    string destinationFile = args[1];

                    Console.WriteLine("Processing {0} -> {1}", entitySourceXml, destinationFile);
                    TikSourceGenerator generator = new TikSourceGenerator(entitySourceXml);
                    string             designerSource;
                    string             customSource;
                    generator.GenerateSource(out designerSource, out customSource);

                    string designerFileName = destinationFile + ".Designer.cs";
                    Directory.CreateDirectory(Path.GetDirectoryName(designerFileName));
                    File.WriteAllText(designerFileName, designerSource);
                    Console.WriteLine("  - designer file '{0}' written.", designerFileName);

                    string customFileName = destinationFile + ".cs";
                    if (!File.Exists(customFileName))
                    {
                        File.WriteAllText(customFileName, customSource);
                    }
                    else
                    {
                        Console.WriteLine("  - custom file '{0}' already exist.", customFileName);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                    Console.WriteLine("ERROR - Press ENTER");
                    Console.ReadLine();
                }
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            if (args.Length != 2)
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
            }
            else
            {
                AttachConsole(ATTACH_PARENT_PROCESS);
                ///"v:\Projekty.Mikrotik\tik4net\trunk\tools\defs\Log.xml" "v:\Projekty.Mikrotik\tik4net\trunk\tik4net\Log"
                try
                {
                    string entitySourceXml = args[0];
                    string destinationFile = args[1];

                    Console.WriteLine("Processing {0} -> {1}", entitySourceXml, destinationFile);
                    TikSourceGenerator generator = new TikSourceGenerator(entitySourceXml);
                    string designerSource;
                    string customSource;
                    generator.GenerateSource(out designerSource, out customSource);

                    string designerFileName = destinationFile + ".Designer.cs";
                    Directory.CreateDirectory(Path.GetDirectoryName(designerFileName));
                    File.WriteAllText(designerFileName, designerSource);
                    Console.WriteLine("  - designer file '{0}' written.", designerFileName);

                    string customFileName = destinationFile + ".cs";
                    if (!File.Exists(customFileName))
                        File.WriteAllText(customFileName, customSource);
                    else
                        Console.WriteLine("  - custom file '{0}' already exist.", customFileName);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                    Console.WriteLine("ERROR - Press ENTER");
                    Console.ReadLine();
                }
            }
        }
Beispiel #4
0
        private void btnParserGenerate_Click(object sender, EventArgs e)
        {
            XmlDocument lastParserOutput = new XmlDocument();
            lastParserOutput.LoadXml(tbParserOutput.Text);
            tcMain.SelectedTab = tcpSourceCode;
            TikSourceGenerator generator = new TikSourceGenerator(lastParserOutput);
            string designerCode;
            string userCode;
            generator.GenerateSource(out designerCode, out userCode);

            eSourceCodeDesigner.Text = designerCode;
            eSourceCodeCustom.Text = userCode;
        }