Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainForm"/> class.
        /// </summary>
        /// <exception cref="ArgumentNullException">
        /// <para>
        ///		<paramref name="serviceProvider"/> is <see langword="null"/>.
        /// </para>
        /// </exception>
        public MainForm(INuGenServiceProvider serviceProvider)
        {
            if (serviceProvider == null)
            {
                throw new ArgumentNullException("serviceProvider");
            }

            _serviceProvider = serviceProvider;
            _splashStarter   = _serviceProvider.GetService <SplashStarter>();
            Debug.Assert(_splashStarter != null, "_splashStarter != null");
            _splashStarter.ShowSplashScreen();

            InitializeComponent();

            ForceActiveTitleBar = true;
            SetStyle(ControlStyles.Opaque, true);

            _canvasSizeToolStrip.ApplySettings  += _canvasSizeToolStrip_ApplySettings;
            _canvasSizeToolStrip.CancelSettings += _canvasSizeToolStrip_CancelSettings;

            _insertFileDialog.Filter      = Resources.Text_InsertFileDialog_Filter;
            _insertFileDialog.FilterIndex = 3;
            _insertFileDialog.Title       = Resources.Text_InsertFileDialog;

            _openFileDialog.Filter = Resources.Text_OpenFileDialog_Filter;
            _openFileDialog.Title  = Resources.Text_OpenFileDialog;

            _saveFileDialog.Filter = Resources.Text_SaveFileDialog_Filter;
            _saveFileDialog.Title  = Resources.Text_SaveFileDialog;

            SetCanvasDependableButtonsVisibility(false);
        }
        public VisiCalcServiceProvider()
        {
            _menuItemCheckedTracker   = new NuGenMenuItemCheckedTracker();
            _toolStripAutoSizeService = new NuGenToolStripAutoSizeService();
            _windowStateTracker       = new NuGenWindowStateTracker();
            _splashStarter            = new SplashStarter();

            Assembly assembly = Assembly.GetExecutingAssembly();

            _operatorsCache = OperatorsCache.FromAssembly(assembly);
            _paramsCache    = ParamsCache.FromAssembly(assembly);
            _programsCache  = ProgramsCache.FromAssembly(assembly);
            _typesCache     = TypesCache.FromAssembly(assembly);
        }
        public VisiCalcServiceProvider()
        {
            _menuItemCheckedTracker = new NuGenMenuItemCheckedTracker();
            _toolStripAutoSizeService = new NuGenToolStripAutoSizeService();
            _windowStateTracker = new NuGenWindowStateTracker();
			_splashStarter = new SplashStarter();

			Assembly assembly = Assembly.GetExecutingAssembly();

			_operatorsCache = OperatorsCache.FromAssembly(assembly);
			_paramsCache = ParamsCache.FromAssembly(assembly);
			_programsCache = ProgramsCache.FromAssembly(assembly);
			_typesCache = TypesCache.FromAssembly(assembly);
        }
Beispiel #4
0
		/// <summary>
		/// Initializes a new instance of the <see cref="MainForm"/> class.
		/// </summary>
		/// <exception cref="ArgumentNullException">
		/// <para>
		///		<paramref name="serviceProvider"/> is <see langword="null"/>.
		/// </para>
		/// </exception>
		public MainForm(INuGenServiceProvider serviceProvider)
		{
			if (serviceProvider == null)
			{
				throw new ArgumentNullException("serviceProvider");
			}

			_serviceProvider = serviceProvider;
			_splashStarter = _serviceProvider.GetService<SplashStarter>();
			Debug.Assert(_splashStarter != null, "_splashStarter != null");
			_splashStarter.ShowSplashScreen();

			InitializeComponent();

			ForceActiveTitleBar = true;
			SetStyle(ControlStyles.Opaque, true);

			_canvasSizeToolStrip.ApplySettings += _canvasSizeToolStrip_ApplySettings;
			_canvasSizeToolStrip.CancelSettings += _canvasSizeToolStrip_CancelSettings;

			_insertFileDialog.Filter = Resources.Text_InsertFileDialog_Filter;
			_insertFileDialog.FilterIndex = 3;
			_insertFileDialog.Title = Resources.Text_InsertFileDialog;

			_openFileDialog.Filter = Resources.Text_OpenFileDialog_Filter;
			_openFileDialog.Title = Resources.Text_OpenFileDialog;

			_saveFileDialog.Filter = Resources.Text_SaveFileDialog_Filter;
			_saveFileDialog.Title = Resources.Text_SaveFileDialog;

			SetCanvasDependableButtonsVisibility(false);
		}