Пример #1
0
        private void Main_Form_Shown(object sender, EventArgs e)
        {
            thCheck_Clipboard = new Thread(Check_Clipboard);
            thCheck_Clipboard.SetApartmentState(ApartmentState.STA);

            Load_Languages();

            if (File.Exists(AmiiBomb_Config_File))
            {
                Config = JsonConvert.DeserializeObject <Config_Class>(File.ReadAllText(AmiiBomb_Config_File));
                if (Config.Bin_Folder_Path == null)
                {
                    AskBinFolder();
                }
                if (Config.KeyFile_Path == null)
                {
                    AskAmiiboKey();
                }
                if (Config.Locale == null)
                {
                    Config.Locale = I18n.GetLocale();
                }
            }
            else
            {
                AskBinFolder();
                AskAmiiboKey();
            }

            if (Config.Locale != null)
            {
                I18n.SetLocale(Config.Locale);
                Translate_Class.Translate(this);
            }

            if (!thCheck_Clipboard.IsAlive)
            {
                thCheck_Clipboard.Start();
            }

            if (Config.Bin_Folder_Path != null)
            {
                LoadAmiiboBinFolder();
                FileWatcher();
            }

            if (Config.KeyFile_Path != null)
            {
                LoadAmiiboKey();
            }

            Controls_Size();
        }
Пример #2
0
        private void Main_Form_Shown(object sender, EventArgs e)
        {
            thCheck_Clipboard = new Thread(Check_Clipboard);
            thCheck_Clipboard.SetApartmentState(ApartmentState.STA);

            Load_Languages();

            if (File.Exists(AmiiBomb_Config_File))
            {
                Config = JsonConvert.DeserializeObject <Config_Class>(File.ReadAllText(AmiiBomb_Config_File));
                if (Config.Bin_Folder_Path == null)
                {
                    AskBinFolder();
                }
                if (Config.KeyFile_Path == null)
                {
                    AskAmiiboKey();
                }
                if (Config.Locale == null)
                {
                    Config.Locale = I18n.GetLocale();
                }

                switch (Config.Database)
                {
                case 1:
                    amiibolifeToolStripMenuItem.Checked = false;
                    amiiboAPIToolStripMenuItem.Checked  = true;
                    break;

                default:
                    amiibolifeToolStripMenuItem.Checked = true;
                    amiiboAPIToolStripMenuItem.Checked  = false;
                    break;
                }

                activeFilesCachingToolStripMenuItem.Checked = Config.Cache;
            }
            else
            {
                AskBinFolder();
                AskAmiiboKey();
            }

            if (Config.Locale != null)
            {
                I18n.SetLocale(Config.Locale);
                Translate_Class.Translate(this);
            }

            if (!thCheck_Clipboard.IsAlive)
            {
                thCheck_Clipboard.Start();
            }

            if (Config.Bin_Folder_Path != null)
            {
                LoadAmiiboBinFolder();
                treeView1.Nodes[0].Expand();
                treeView1.SelectedNode = treeView1.Nodes[0];
                FolderWatcher();
            }

            if (Config.KeyFile_Path != null)
            {
                LoadAmiiboKey();
            }

            Controls_Size();
        }