예제 #1
0
        static void Main()
        {
            Namespace = "STBLXMLEditor";

            try {
                ReadArguments();

                if (TargetFilePath != null)
                {
                    Loading.OpenFile(TargetFilePath);
                }
            } catch { }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Selector());
        }
예제 #2
0
        public bool OpenFile()
        {
            if (Loading.IsDirty)
            {
                DialogResult unsavedDialogResult = ShowUnsavedDialog();

                if (unsavedDialogResult == DialogResult.Yes)
                {
                    SaveFile();
                }
                else if (unsavedDialogResult == DialogResult.Cancel)
                {
                    return(false);
                }
            }

            if (Loading.FilePath != null)
            {
                OpenSTBLXMLDialog.InitialDirectory = Path.GetDirectoryName(Loading.FilePath);
            }

            if (OpenSTBLXMLDialog.ShowDialog() == DialogResult.Cancel)
            {
                return(false);
            }

            string openFilePath = OpenSTBLXMLDialog.FileName;

            OpenSTBLXMLDialog.InitialDirectory = "";
            OpenSTBLXMLDialog.FileName         = "";

            try {
                Loading.OpenFile(openFilePath);
            } catch (Exception openException) {
                ShowOpenFailureDialog(openException);
            }

            EntryBrowser.SetupRows();

            return(true);
        }