Exemple #1
0
        public Form1()
        {
            CultureInfo curinfo = null;

            switch (Properties.Settings.Default.Language)
            {
            case 0:
                curinfo = new CultureInfo("zh-TW");
                break;

            default:
                curinfo = CultureInfo.CreateSpecificCulture("en");
                break;
            }

            Thread.CurrentThread.CurrentCulture   = curinfo;
            Thread.CurrentThread.CurrentUICulture = curinfo;
            InitializeComponent();
            toolStripComboBox1.SelectedIndexChanged -= toolStripComboBox1_SelectedIndexChanged;
            toolStripComboBox1.SelectedIndex         = Properties.Settings.Default.Language;
            toolStripComboBox1.SelectedIndexChanged += toolStripComboBox1_SelectedIndexChanged;
            Directory.CreateDirectory("profiles");
            var profiles = new DirectoryInfo("profiles").GetFiles("*.sfo").Select(p => p.Name).ToArray();

            toolStripComboBox2.Items.Add("Default Profile");
            toolStripComboBox2.Items.AddRange(profiles);
            toolStripComboBox2.SelectedIndex = 0;
            dtpForm        = new DateTimePickForm();
            dtpfForInstant = new DateTimePickForm();
            copyFrom       = new CopyFrom();
        }
Exemple #2
0
        private void OpenFile(string path_in)
        {
            try
            {
                if (isOpen)
                {
                    CloseFile();
                }
                path     = path_in;
                pathTemp = Utility.CopyTrophyDirToTemp(path_in);
                Utility.decryptTrophy(pathTemp);
                tconf = new TROPCONF(pathTemp);
                tpsn  = new TROPTRNS(pathTemp);
                tusr  = new TROPUSR(pathTemp);

                lastSyncTrophyTime = tusr.LastSyncTime;
                if (DateTime.Compare(tpsn.LastSyncTime, tusr.LastSyncTime) > 0)
                {
                    lastSyncTrophyTime = tpsn.LastSyncTime;
                }

                ps3Time        = lastSyncTrophyTime;
                dtpForm        = new DateTimePickForm(ps3Time);
                dtpfForInstant = new DateTimePickForm(ps3Time);
                copyFrom       = new CopyFrom(ps3Time);

                RefreshComponents();
                isOpen = true;
                重新整理ToolStripMenuItem.Enabled = true;
                進階ToolStripMenuItem.Enabled   = true;
            }
            catch (FileNotFoundException ex)
            {
                tconf = null;
                tpsn  = null;
                tusr  = null;
                GC.Collect();
                MessageBox.Show(string.Format(Properties.strings.FileNotFoundMsg, Path.GetFileName(ex.FileName)));
            }
            catch (Exception ex)
            {
                tconf = null;
                tpsn  = null;
                tusr  = null;
                GC.Collect();
                Console.WriteLine(ex.StackTrace);
                MessageBox.Show(ex.Message);
            }
        }