Exemple #1
0
        private void S1_Work()
        {
            while (Data.Session.Stage == 1 && Data.Session.Shortcuts.Count >= Data.Session.LastShortcut + 1)
            {
                if (Data.Session.LastShortcut >= Data.Session.Shortcuts.Count)
                {
                    break;
                }

                var item = Data.Session.Shortcuts[Data.Session.LastShortcut++];

                Invoke(new Action(() =>
                {
                    L_Shortcuts_Info.Text = item.Name;
                    TaskbarProgress.SetValue(Handle, 2500d * Data.Session.LastShortcut / Data.Session.Shortcuts.Count, 10000);
                }));

                var error = IconMatcher.Match(item);

                PGB_Shortcuts.Percentage = 100d * Data.Session.LastShortcut / Data.Session.Shortcuts.Count;

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

            if (Data.Session.Stage == 1)
            {
                Stage_2();
            }
        }
Exemple #2
0
        private void S2_Work()
        {
            while (Data.Session.Stage == 2 && Data.Session.Folders.Count >= Data.Session.LastFolder + 1)
            {
                if (Data.Session.LastFolder >= Data.Session.Folders.Count)
                {
                    break;
                }

                var item = Data.Session.Folders[Data.Session.LastFolder++];

                Invoke(new Action(() =>
                {
                    L_Folders_Info.Text = item.Name;
                    TaskbarProgress.SetValue(Handle, 2500 + 2500d * Data.Session.LastFolder / Data.Session.Folders.Count, 10000);
                }));

                var error = IconMatcher.Match(item);

                PGB_Folders.Percentage = 100d * Data.Session.LastFolder / Data.Session.Folders.Count;

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

            if (Data.Session.Stage == 2)
            {
                Stage_3();
            }
        }
Exemple #3
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();
            }
        }