Пример #1
0
 private void ZDesselecionarTodos_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < StrList.Items.Count; i++)
     {
         StrList.SetItemChecked(i, false);
     }
 }
Пример #2
0
 private void UnselectAll_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < StrList.Items.Count; i++)
     {
         StrList.SetItemChecked(i, false);
     }
 }
Пример #3
0
 internal static void StartSelction()
 {
     if (File.Exists(TableName))
     {
         bool[] bools = BinToBool(File.ReadAllBytes(TableName));
         for (int i = 0; i < StrList.Items.Count; i++)
         {
             StrList.SetItemChecked(i, bools[i]);
         }
     }
     else
     {
         AutoSelect();
     }
 }
Пример #4
0
        internal static void AutoSelect()
        {
            if (StrList == null)
            {
                return;
            }
            string Conf = GetConfig("VNXTLP", "SelMode", false);

            if (string.IsNullOrWhiteSpace(Conf) || Conf == "0")
            {
                AutoDetectMode();
            }
            else
            {
                bool Asian = Conf == "1";
                for (int i = 0; i < StrList.Items.Count; i++)
                {
                    bool Status = IsDialogue(StrList.Items[i].ToString().ToLower(), Asian);
                    StrList.SetItemChecked(i, Status);
                }
            }
        }
Пример #5
0
        private static void AutoDetectMode()
        {
            int  trie     = 0;
            uint count    = 0;
            uint NonAsian = 0;
            uint Asian    = 0;

again:
            ;
            for (int i = 0; i < StrList.Items.Count; i++)
            {
                bool Status = IsDialogue(StrList.Items[i].ToString().ToLower(), trie == 1 || trie == 3);
                if (Status)
                {
                    count++;
                }
                StrList.SetItemChecked(i, Status);
            }
            if (trie < 2)
            {
                switch (trie)
                {
                case 0:
                    NonAsian = count;
                    break;

                case 1:
                    Asian = count;
                    break;
                }
                trie++;
                count = 0;
                if (trie == 2 && Asian > NonAsian)
                {
                    trie++;
                }
                goto again;
            }
        }
Пример #6
0
        internal static bool SearchNext(string Content, bool WithContains, bool Up, bool CaseSensentive, bool Loop, bool CheckNonDialog, bool NoMsg, bool NoRerty = false)
        {
            int Len = CheckNonDialog ? StrList.Items.Count : StrList.CheckedItems.Count;

            string[] Strings = new string[Len];
            int[]    Indexs  = new int[Len];
            for (int ind = 0, count = 0, diff = StrList.Items.Count; ind < StrList.Items.Count; ind++)
            {
                if (CheckNonDialog || StrList.GetItemChecked(ind))
                {
                    Strings[count]  = StrList.Items[ind].ToString();
                    Indexs[count++] = ind;
                }
            }

            int i = StrList.SelectedIndex + (Up ? 1 : -1);

            if (i < 0)
            {
                i = 0;
            }
            if (i >= StrList.Items.Count)
            {
                i = StrList.Items.Count - 1;
            }

            for (int ind = i; ind < StrList.Items.Count && ind > 0; ind += Up ? 1 : -1)
            {
                if (CheckNonDialog || StrList.GetItemChecked(ind))
                {
                    for (int j = 0; j < Indexs.Length; j++)
                    {
                        if (Indexs[j] == ind)
                        {
                            i = j;
                            break;
                        }
                    }
                    break;
                }
            }
            i = Search(Content, Strings, i, WithContains, Up, CaseSensentive, Loop);
            bool Found = i > -1;

            if (!Found)
            {
                if (!NoMsg)
                {
                    MessageBox.Show(LoadTranslation(TLID.NoMatchFound), "VNXTLP", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                i = Indexs[i];
                StrList.SetItemChecked(i, true);
                Index = i;
                string Text = CaseSensentive ? TextBox.Text : TextBox.Text.ToLower();
                int    IO   = Text.IndexOf(CaseSensentive ? Content : Content.ToLower());
                if (IO < 0 && !NoRerty)
                {
                    System.Threading.Thread.Sleep(500);
                    return(SearchNext(Content, WithContains, Up, CaseSensentive, Loop, CheckNonDialog, NoMsg, true));
                }
                TextBox.Select(IO, Content.Length);
                TextBox.Focus();
            }
            return(Found);
        }