Esempio n. 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            if (ReleasingProd || ReleasingTest)
            {
                CheckForUpdate();
            }
            Log.Write.Info("################## - Application instance has started - ##################");

            if (SetDrawingControls())
            {
                SetDrawingControls();
                SetUIReferences();

                DatabasePreCheck();
                DataGrid.MainLoad();

                Preview.Expand();

                UserSettings.Apply();
                FilePrint.SetPrinterOptions();

                Log.Write.Info("Passed loading phase in Main Form");
            }
            else
            {
                Environment.Exit(0);
            }
        }
Esempio n. 2
0
        public static void Apply()
        {
            if (!(Properties.Settings.Default.FormExpanded == Preview.MainFormExpanded))
            {
                Preview.Expand();
            }

            if (!(string.IsNullOrEmpty(Properties.Settings.Default.DefaultPrinter)))
            {
                FilePrint.SelectedPrinter = Properties.Settings.Default.DefaultPrinter;
            }
            else
            {
                FilePrint.SelectedPrinter = Properties.Settings.Default.DefaultPrinter;
            }

            if (!(Properties.Settings.Default.eDrawingDefault))
            {
                MainReference.EDrawingsDefaultMainToolStipMenuReference.CheckState = System.Windows.Forms.CheckState.Unchecked;
            }
            else
            {
                FileOpen.EDrawingsInstall = Data.GetMostRecentEDrawingInstall();
            }

            if (Properties.Settings.Default.ReactiveCheckbox)
            {
                MainReference.CheckboxFilterMainToolStipMenuReference.CheckState = System.Windows.Forms.CheckState.Checked;
            }


            string t = "\t\t\t\t\t\t\t\t\t\t";

            Log.Write.Info(String.Format("Loaded Settings:\n{0}\n{1}\n{2}\n{3}",
                                         $"{t}Expanded Form: -- {Properties.Settings.Default.FormExpanded}",
                                         $"{t}Printer Default: -- {(Properties.Settings.Default.DefaultPrinter.Contains(@"\") ? Properties.Settings.Default.DefaultPrinter.Split('\\').Last() : Properties.Settings.Default.DefaultPrinter)}",
                                         $"{t}Open with eDrawings: -- {Properties.Settings.Default.eDrawingDefault}",
                                         $"{t}Reactive Checkbox: -- {Properties.Settings.Default.ReactiveCheckbox}"
                                         ));
        }