Esempio n. 1
0
        /// <summary>アプリケーションエントリーポイント。</summary>
        internal void EntryPoint(string[] args)
        {
            try
            {
                LogWriter = new StreamWriter("WaveguideDesigner.log");
            }
            catch { MessageBox.Show("ログファイルを開けませんでした。ログ出力はされません。", "", MessageBoxButtons.OK, MessageBoxIcon.Error); }
            LogMethodStart();

            CurrentUndoDepth      = 0;
            FormulaEngine         = new FormulaEngine();
            DoesUpdateShapeAuto   = true;
            EnableUndoRedoStoring = true;
            if (args.Length != 0)
            {
                OpenProject(args[0]);
            }

            if (MainForm != null)
            {
                throw new InvalidOperationException();
            }

            System.Windows.Forms.Application.EnableVisualStyles();
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
            MainForm = new Forms.MainForm();
            try
            {
                System.Windows.Forms.Application.Run(MainForm);
            }
            catch (Exception e)
            {
                WriteLog(e.ToString());
            }

            LogMethodEnd();
            LogWriter?.Dispose();
        }
		/// <summary>アプリケーションエントリーポイント。</summary>
		internal void EntryPoint(string[] args)
			{
			try
				{
				LogWriter = new StreamWriter( "WaveguideDesigner.log" );
				}
			catch { MessageBox.Show( "ログファイルを開けませんでした。ログ出力はされません。", "", MessageBoxButtons.OK, MessageBoxIcon.Error ); }
			LogMethodStart();

			CurrentUndoDepth = 0;
			FormulaEngine = new FormulaEngine();
			DoesUpdateShapeAuto = true;
			EnableUndoRedoStoring = true;
			if( args.Length != 0 ) OpenProject( args[0] );

			if( MainForm != null ) throw new InvalidOperationException();

			System.Windows.Forms.Application.EnableVisualStyles();
			System.Windows.Forms.Application.SetCompatibleTextRenderingDefault( false );
			MainForm = new Forms.MainForm();
			try
				{
				System.Windows.Forms.Application.Run( MainForm );
				}
			catch( Exception e )
				{
				WriteLog( e.ToString() );
				}

			LogMethodEnd();
			LogWriter?.Dispose();
			}