コード例 #1
0
        private void S3_Work()
        {
            while (Data.Session.Stage == 3 && Data.Session.SecondPassFolders.Count >= Data.Session.LastSecondPass + 1)
            {
                if (Data.Session.LastSecondPass >= Data.Session.SecondPassFolders.Count)
                {
                    break;
                }

                var item = Data.Session.SecondPassFolders[Data.Session.LastSecondPass++];

                Invoke(new Action(() =>
                {
                    L_SecondPass_Info.Text = item.Name;
                    TaskbarProgress.SetValue(Handle, 5000 + 2500d * Data.Session.LastSecondPass / Data.Session.SecondPassFolders.Count, 10000);
                }));

                var error = IconMatcher.ReMatch(item);

                PGB_SecondPass.Percentage = 100d * Data.Session.LastSecondPass / Data.Session.SecondPassFolders.Count;

                if (error != null)
                {
                    Data.Session.StageErrors[3]++;
#if DEBUG
                    Data.Session.Exceptions.Add(error);
#endif
                }
            }

            if (Data.Session.Stage == 3)
            {
                Stage_4();
            }
        }
コード例 #2
0
        private void B_Change_Click(object sender, EventArgs e)
        {
#if DEBUG
            if (DebugMode)
            {
                var itemFile = new ItemFile(TB_FolderPath.Text, out var error);

                IconMatcher.Match(itemFile);

                if (itemFile.Match == null && itemFile.Type != IconType.Normal)
                {
                    IconMatcher.ReMatch(itemFile);
                    MessageBox.Show($"'{itemFile}' was re-matched with '{itemFile.Match}'");
                }
                else
                {
                    MessageBox.Show($"'{itemFile}' was matched with '{itemFile.Match}'");
                }
            }
#endif
            if (ValidationCheck(2))
            {
                Data.Session.SessionAction = SessionAction.Change;
                Data.Session.WorkingPaths.Add(TB_FolderPath.Text);
                SetCurrentSessionOptions();

                (new WorkForm()
                {
                    Size = Size, Location = Location
                }).Show();
                Hide();
            }
        }