Esempio n. 1
0
        public Home(string[] args)
        {
            try
            {
                // if (Debugger.IsAttached) File.Delete(Application.StartupPath + "/Appdata/DataPacks/Current.DataPack");
            }
            catch
            {
            }

            //Generate window
            InitializeComponent();

            //non static inits
            Utils.Initialise(); //USE UTILS FOR NON STATIC INITS!

            //Staic inits
            if (args.Length > 0)
            {
                try
                {
                    DataStore = Utils.ImportDataPack(args[0]);
                }
                catch// for io errors.
                {
                    MessageBox.Show("Could not open with the selected file!");
                }
            }

            NextDueList.ListViewItemSorter = new UtilsComparer(SortOrder.Ascending);

            openFileDialog1.Filter = "DataPack (*.DataPack)|*.DataPack";
            UpdateUnitsListView();
            SetTitle();
        }
Esempio n. 2
0
        private void importDataPackToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            openFileDialog1.ShowDialog();

            try
            {
                DataStore = Classes.Utils.ImportDataPack(openFileDialog1.FileName);
                Utils.SaveCurrentDataPack();
                reevaluateCurrentPackToolStripMenuItem_Click(this, EventArgs.Empty);
            } catch (Exception ex)
            {
                MessageBox.Show("Unable to import data pack!");
            }
        }