示例#1
0
        private static void Main(string[] ps)
        {
            if (ps.Length <= 1)
            {
                SplashForm.ShowSplash(11);

                SplashForm.StepDone();
                InitializeUtils.Initialize(Assembly.GetExecutingAssembly());
                SplashForm.StepDone();

                ErrorDialog.Initialize();
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                SplashForm.StepDone();

                var mainForm = Forms.Main = new MainForm();
                SplashForm.StepDone();
                var docPanel = mainForm.DockingPanel;
                SplashForm.StepDone();
                Forms.ManifestBrowser = new ManifestBrowser(docPanel);
                SplashForm.StepDone();
                Forms.PropertyEditor = new PropertyEditor(docPanel);
                SplashForm.StepDone();
                Forms.CourseExplorer = new CourseExplorer(docPanel);
                SplashForm.StepDone();
                Forms.CourseDesigner = new CourseDesigner(docPanel);
                SplashForm.StepDone();

                if (ps.Length == 1)
                {
                    mainForm.OpenCourse(ps[0], true);
                }
                SplashForm.StepDone();

                Application.Run(mainForm);
            }
            else
            {
                InitializeUtils.Initialize(Assembly.GetExecutingAssembly());
                AllocOrAttachConsole();
                if (ps[0].Equals("--upgrade", StringComparison.InvariantCultureIgnoreCase))
                {
                    for (var i = 1; i < ps.Length; i++)
                    {
                        var dirName  = Path.GetDirectoryName(ps[i]);
                        var fileMask = Path.GetFileName(ps[i]);
                        var files    = Directory.GetFiles(dirName, fileMask);
                        foreach (var file in files)
                        {
                            try
                            {
                                Console.Write("Upgrading '{0}'... ", file);
                                if (Course.Course.OpenZipPackage(file))
                                {
                                    Course.Course.SaveToZipPackage(file);
                                }
                                else
                                {
                                    Console.WriteLine("ERROR ON OPENNING");
                                }
                                Console.WriteLine("[DONE]");
                            }
                            catch (Exception e)
                            {
                                Console.WriteLine("[ERROR]");
                                Console.WriteLine(e.Message);
                            }
                        }
                    }
                }
                FreeConsole();
            }
        }
示例#2
0
文件: Game.cs 项目: KHCmaster/PPD
 public Game(PPDExecuteArg args) : base(args, new EditorForm())
 {
     SplashForm.ShowSplash(Window);
     SplashForm.ChangeStatus(String.Format(Utility.Language["InitializingStart"], Utility.Language["MainWindow"]));
     Window.Initialize();
 }