示例#1
0
        public frmOmae(frmMain frmMainForm)
        {
            InitializeComponent();
            LanguageManager.Instance.Load(GlobalOptions.Instance.Language, this);
            _frmMain = frmMainForm;

            NO_CONNECTION_MESSAGE = LanguageManager.Instance.GetString("Message_Omae_CannotConnection");
            NO_CONNECTION_TITLE = LanguageManager.Instance.GetString("MessageTitle_Omae_CannotConnection");
        }
示例#2
0
        public frmDiceRoller(frmMain frmMainForm, List<Quality> lstQualities = null, int intDice = 1)
        {
            InitializeComponent();
            LanguageManager.Instance.Load(GlobalOptions.Instance.Language, this);
            _frmMain = frmMainForm;
            _RNG = new MTRNG();
            nudDice.Value = intDice;
            if (lstQualities != null)
            {
                foreach (Quality objQuality in lstQualities)
                {
                    if (objQuality.Name.StartsWith("Gremlins"))
                    {
                        int intRating = Convert.ToInt32(objQuality.Name.Substring(objQuality.Name.Length - 2, 1));
                        nudGremlins.Value = intRating;
                    }
                }
            }
            MoveControls();

            List<ListItem> lstMethod = new List<ListItem>();
            ListItem itmStandard = new ListItem();
            itmStandard.Value = "Standard";
            itmStandard.Name = LanguageManager.Instance.GetString("String_DiceRoller_Standard");

            ListItem itmLarge = new ListItem();
            itmLarge.Value = "Large";
            itmLarge.Name = LanguageManager.Instance.GetString("String_DiceRoller_Large");

            ListItem itmReallyLarge = new ListItem();
            itmReallyLarge.Value = "ReallyLarge";
            itmReallyLarge.Name = LanguageManager.Instance.GetString("String_DiceRoller_ReallyLarge");

            lstMethod.Add(itmStandard);
            lstMethod.Add(itmLarge);
            lstMethod.Add(itmReallyLarge);

            cboMethod.ValueMember = "Value";
            cboMethod.DisplayMember = "Name";
            cboMethod.DataSource = lstMethod;
            cboMethod.SelectedIndex = 0;
        }
示例#3
0
        static void Main()
        {
            Stopwatch sw = Stopwatch.StartNew();
            //If debuging and launched from other place (Bootstrap), launch debugger
            if (Environment.GetCommandLineArgs().Contains("/debug") && !Debugger.IsAttached)
            {
                Debugger.Launch();
            }
            sw.TaskEnd("dbgchk");
            //Various init stuff (that mostly "can" be removed as they serve
            //debugging more than function

            //Needs to be called before Log is setup, as it moves where log might be.
            FixCwd();

            sw.TaskEnd("fixcwd");
            //Log exceptions that is caught. Wanting to know about this cause of performance
            AppDomain.CurrentDomain.FirstChanceException += Log.FirstChanceException;
            AppDomain.CurrentDomain.FirstChanceException += heatmap.OnException;

            sw.TaskEnd("appdomain 2");

            string info =
                $"Application Chummer5a build {System.Reflection.Assembly.GetExecutingAssembly().GetName().Version} started at {DateTime.UtcNow} with command line arguments {Environment.CommandLine}";

            sw.TaskEnd("infogen");

            Log.Info( info);

            sw.TaskEnd("infoprnt");

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

            sw.TaskEnd("languagefreestartup");
            LanguageManager.Instance.Load(GlobalOptions.Instance.Language, null);
            // Make sure the default language has been loaded before attempting to open the Main Form.

            AppDomain.CurrentDomain.UnhandledException += (o, e) =>
            {
                Exception ex = e.ExceptionObject as Exception;
                if(ex != null)
                    CrashHandler.WebMiniDumpHandler(ex);

                //main.Hide();
                //main.ShowInTaskbar = false;
            };

            sw.TaskEnd("Startup");
            if (LanguageManager.Instance.Loaded)
            {
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);

                frmMain main = new frmMain();
                Application.Run(main);
            }
            else
            {
                Application.Exit();
            }

            string ExceptionMap = heatmap.GenerateInfo();
            Log.Info(ExceptionMap);
        }
示例#4
0
        static void Main()
        {
            Stopwatch sw = Stopwatch.StartNew();

            //If debuging and launched from other place (Bootstrap), launch debugger
            if (Environment.GetCommandLineArgs().Contains("/debug") && !Debugger.IsAttached)
            {
                Debugger.Launch();
            }
            sw.TaskEnd("dbgchk");
            //Various init stuff (that mostly "can" be removed as they serve
            //debugging more than function


            //Needs to be called before Log is setup, as it moves where log might be.
            FixCwd();


            sw.TaskEnd("fixcwd");
            //Log exceptions that is caught. Wanting to know about this cause of performance
            AppDomain.CurrentDomain.FirstChanceException += Log.FirstChanceException;
            AppDomain.CurrentDomain.FirstChanceException += heatmap.OnException;


            sw.TaskEnd("appdomain 2");

            string info =
                $"Application Chummer5a build {System.Reflection.Assembly.GetExecutingAssembly().GetName().Version} started at {DateTime.UtcNow} with command line arguments {Environment.CommandLine}";

            sw.TaskEnd("infogen");

            Log.Info(info);

            sw.TaskEnd("infoprnt");

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


            sw.TaskEnd("languagefreestartup");
            LanguageManager.Instance.Load(GlobalOptions.Instance.Language, null);
            // Make sure the default language has been loaded before attempting to open the Main Form.

#if !DEBUG
            AppDomain.CurrentDomain.UnhandledException += (o, e) =>
            {
                Exception ex = e.ExceptionObject as Exception;
                if (ex != null)
                {
                    CrashHandler.WebMiniDumpHandler(ex);
                }

                //main.Hide();
                //main.ShowInTaskbar = false;
            };
#endif

            sw.TaskEnd("Startup");
            if (LanguageManager.Instance.Loaded)
            {
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);

                frmMain main = new frmMain();
                Application.Run(main);
            }
            else
            {
                Application.Exit();
            }

            string ExceptionMap = heatmap.GenerateInfo();
            Log.Info(ExceptionMap);
        }