Esempio n. 1
0
        static void Main()
        {
            //檢查是否有即時更新程式的換版檔案
            if (File.Exists("LiveUpdate.ex_"))
            {
                File.Delete("LiveUpdate.exe");                  //先刪除舊版本
                File.Move("LiveUpdate.ex_", "LiveUpdate.exe");  //再將新的程式更名
            }

            XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo("log4net_config.xml"));

            ProductManager.Load("exchanges");
            GlobalSettings.Load("options.set");

            SeriesManager.LoadSettings();
            ScriptManager.LoadSettings();

            OrderManager.Manager.Refresh("plugins\\orders");
            QuoteManager.Manager.Refresh("plugins\\quotes");
            PaintManager.Manager.Refresh("plugins\\charts");

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

            frmWelcome frmWelcome = new frmWelcome();

            frmWelcome.ShowDialog();
            frmWelcome.Dispose();

            Application.Run(new frmMain());
        }
Esempio n. 2
0
 private IDockContent GetWelcome()
 {
     if (Welcome == null || Welcome.IsDisposed)
     {
         Welcome = new frmWelcome(Window);
     }
     return(Welcome);
 }
Esempio n. 3
0
        /// <summary>
        /// This method gets called when your Controller should be initialized.
        /// Perform additional initialization of your UserControl here.
        /// </summary>
        protected static void Initialize()
        {
            Messenger.AddListener(Instance);

            EventDistributor.AsyncTaskStarted += AsyncTaskStarted;
            EventDistributor.AsyncTaskDone    += AsyncTaskDone;
            EventDistributor.LanguageChanged  += LanguageChanged;
            EventDistributor.KSPRootChanging  += KSPRootChanging;
            EventDistributor.KSPRootChanged   += KSPRootChanged;
            EventDistributor.KSPMAStarted     += KSPMAStarted;

            CreateConfigDir();
            LoadConfigs();

            LoadPlugins();

            View.TapOrder = LastTabOrder;

            OptionsController.AvailableLanguages = Localizer.GlobalInstance.AvailableLanguages;
            OptionsController.SelectedLanguage   = Localizer.GlobalInstance.CurrentLanguage;

            LoadSiteHandler();

            if (!KSPPathHelper.IsKSPInstallFolder(OptionsController.SelectedKSPPath))
            {
                frmWelcome dlg = new frmWelcome();
                if (dlg.ShowDialog(View) != DialogResult.OK)
                {
                    View.Close();
                    return;
                }

                OptionsController.AddKSPPath(dlg.KSPPath);
                OptionsController.SelectedKSPPath = dlg.KSPPath;
            }

            // Initializing is done.
            EventDistributor.InvokeKSPMAStarted(Instance);
        }
Esempio n. 4
0
 public void CloseMainWindows()
 {
     ModExplorer?.Close();
     ModExplorer = null;
     Output?.Close();
     Output = null;
     Console?.Close();
     Console = null;
     if (Welcome != null)
     {
         Welcome?.Close();
         Welcome = new frmWelcome(Window);
     }
     ImportUtility?.Close();
     ImportUtility = null;
     RadishUtility?.Close();
     RadishUtility = null;
     ScriptPreview?.Close();
     ScriptPreview = null;
     ImagePreview?.Close();
     ImagePreview = null;
     FormModKit?.Close();
     FormModKit = null;
 }
Esempio n. 5
0
        private async void SetInitialSettingsUi()
        {
            // Set NLogger

            NLogger.Setconfig();
            SayLog = LogManager.GetLogger("SPECTER:");

            // CHECK IF ITS THE FIRST TIME OPENING SPECTER

            if (UserGlobalConfiguration.MessageWelcome)
            {
                frmWelcome openGreetings = new frmWelcome();
                openGreetings.Show();
            }
            if (PokemonRaro.PokemonRaro.IsPaidUserver == 0)
            {
                cbIv100.Enabled = false;
            }

            //VERIFY THE LIMIT OF POKEMON BEFORE CONTINUE
            if (await PokemonRaro.PokemonRaro.VerificaLimitePokemon())
            {
                btnProcurarPokemon.Enabled = false;
                menuSnipe.Enabled          = false;
            }

            //--------------------------------------------
            //SET VALUES ON SCREEEN
            cbPokebola.SelectedIndex = 0;                                   // Select Pokeball
            lblVersionValue.Text     =
                string.Format($"{PokemonRaro.PokemonRaro.SpecterVersion}"); //Print Specter Version on screen

            lblApiValue.Text = PogoGlobalSettings.SpecterApiVersion;

            lblTotalCapturado.Text =
                string.Format(
                    $"{PokemonRaro.PokemonRaro.PokemonCaught} Total | {PokemonRaro.PokemonRaro.PokemonMax} Max");
            lblEscapadoValue.Text =
                string.Format($"{PokemonRaro.PokemonRaro.PokemonFlee}");

            UpdateLastPokemonCaught(true);

            // ---------------------------------------------
            // LOAD INFORMATION FROM .JSON

            txtPogoUsername.Text = UserGlobalConfiguration.Username;
            txtPogoPassword.Text = UserGlobalConfiguration.Password;
            if (UserGlobalConfiguration.TypeAcc.ToString().ToUpper() == "PTC")
            {
                rbPTC.Checked = true;
            }
            else
            {
                rbGoogle.Checked = true;
            }


            //----------------------------------------------

            //PRINT THE MESSAGE FROM THE SERVER
            await PokemonRaro.PokemonRaro.GetStartMessagesFromTheServer(1);

            //----------------------------------------------

            // Check if the gameversion its updated.
            CheckGameVersion();

            // Works with auto complete textbox
            AutoCompleteStringCollection collectionNamesPokemon = new AutoCompleteStringCollection();

            collectionNamesPokemon.AddRange(PokemonNames);
            txtProcuraPoke.AutoCompleteCustomSource = collectionNamesPokemon;

            FrmCapturaManual.ThresholdReached += FrmCapturaManual_ThresholdReached;
        }