コード例 #1
0
ファイル: Application.cs プロジェクト: cyotek/translateclient
        public static void Initialize(BaseSplashForm splashForm, BaseOptions options, BaseOptionsForm optionsForm)
        {
            if (Initialized_)
            {
                throw new System.InvalidOperationException("DBApplication already initialized");
            }

            if (optionsForm != null && OptionsForm_ == null)
            {
                OptionsForm_ = optionsForm;
            }

            if (OptionsForm_ == null)
            {
                throw new System.InvalidOperationException("OptionsForm should be setuped by Initialize or OptionsForm property");
            }

            OptionsControlsManager.RegisterOptionControl(typeof(UILanguageOptionsControl), "General", 0, "UI Language", 0);


            if (options == null && Options_ == null)
            {
                Options_ = new BaseOptions();
            }
            else if (Options_ == null)
            {
                Options_ = options;
            }

            if (Options_ == null)
            {
                throw new System.InvalidOperationException("Options should be setuped by Initialize or Options property");
            }


            if (SplashForm_ == null && splashForm == null && !SkipSplashForm_)
            {
                splashForm = new FreeCL.Forms.BaseSplashForm();
            }

            if (splashForm != null)
            {
                splashForm.Show();
                System.Windows.Forms.Application.DoEvents();
                SplashForm_ = splashForm;
            }

            Options_ = BaseOptions.Load(Options_);

            Initialized_ = true;
            System.Windows.Forms.Application.DoEvents();
        }
コード例 #2
0
ファイル: Application.cs プロジェクト: cyotek/translateclient
        public static void Initialize(BaseSplashForm splashForm, BaseOptions options, BaseOptionsForm optionsForm)
        {
            if(Initialized_)
                throw new System.InvalidOperationException("DBApplication already initialized");

            if(optionsForm != null && OptionsForm_ == null)
                OptionsForm_ = optionsForm;

            if(OptionsForm_ == null)
                throw new System.InvalidOperationException("OptionsForm should be setuped by Initialize or OptionsForm property");

            OptionsControlsManager.RegisterOptionControl(typeof(UILanguageOptionsControl), "General", 0, "UI Language", 0);

            if(options == null && Options_ == null)
                Options_ = new BaseOptions();
            else if(Options_ == null)
                Options_ = options;

            if(Options_ == null)
                throw new System.InvalidOperationException("Options should be setuped by Initialize or Options property");

            if(SplashForm_ == null && splashForm == null && !SkipSplashForm_)
                splashForm = new FreeCL.Forms.BaseSplashForm();

            if(splashForm != null)
            {
                splashForm.Show();
                System.Windows.Forms.Application.DoEvents();
                SplashForm_ = splashForm;
            }

            Options_ = BaseOptions.Load(Options_);

            Initialized_ = true;
            System.Windows.Forms.Application.DoEvents();
        }