Пример #1
0
        static void Main(String[] argg)
        {
            AppDomain.CurrentDomain.AssemblyResolve += (sender, arg) => {
                if (arg.Name.StartsWith("LinqBridge"))
                {
                    return(Assembly.Load(Properties.Resources.LinqBridge));
                }
                return(null);
            };

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            FileInfo demoFile  = null;
            bool     xmlOutput = false;

            if (argg.Length == 1)
            {
                demoFile = new FileInfo(argg[0]);
            }
            else if ((argg.Length == 2) && (argg[0] == "--xml"))
            {
                demoFile  = new FileInfo(argg[1]);
                xmlOutput = true;
            }
            if (demoFile != null && demoFile.Exists && demoFile.Extension.ToLowerInvariant().StartsWith(".dm_"))
            {
                DemoInfoForm demoInfoForm = new DemoInfoForm();
                demoInfoForm.demoFile = demoFile;
                if (xmlOutput)
                {
                    Demo demo      = Demo.GetDemoFromFileRaw(demoFile);
                    var  xmlString = XmlUtils.FriendlyInfoToXmlString(demo.rawInfo.getFriendlyInfo());
                    Console.WriteLine(xmlString);
                }
                else
                {
                    Application.Run(demoInfoForm);
                }
            }
            else
            {
                Application.Run(new Form1());
            }
        }
Пример #2
0
        private void DemoInfoForm_Load(object sender, EventArgs e)
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));

            try {
                demo = Demo.GetDemoFromFileRaw(demoFile);
                prop = Properties.Settings.Default;
                demo.useValidation = prop.renameValidation;

                loadFriendlyConfig(dataGridView);
                textNewName.Text = demo.demoNewName;

                fileHelper = new FileHelper();
            } catch (Exception ex) {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }