Ejemplo n.º 1
0
 public static bool RemoveItemFromCodeListbox(int removeLine)
 {
     if (removeLine >= 0 && removeLine < HalationViewCommand.LineCount())
     {
         Halation.mainView.codeListBox.Items.RemoveAt(removeLine);
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
0
 public static bool RemoveItemFromCodeListbox(int removeLine)
 {
     if (removeLine >= 0 && removeLine < HalationViewCommand.LineCount())
     {
         Halation.mainView.codeListBox.Items.RemoveAt(removeLine);
         Halation.mainView.codeGroupBox.Text =
             $@"脚本 [{Halation.currentScriptName}] (Line: {Halation.currentCodePackage.GetAction().Count})";
         return(true);
     }
     return(false);
 }
Ejemplo n.º 3
0
        public static bool AddItemToCodeListbox(int insertLine, int indent, string text)
        {
            StringBuilder indentSb = new StringBuilder();

            for (int i = 0; i < indent; i++)
            {
                indentSb.Append(" ");
            }
            if (insertLine >= 0 && insertLine <= HalationViewCommand.LineCount())
            {
                Halation.mainView.codeListBox.Items.Insert(insertLine, indentSb.ToString() + text);
                return(true);
            }
            else if (insertLine == -1)
            {
                Halation.mainView.codeListBox.Items.Add(indentSb.ToString() + text);
                return(true);
            }
            return(false);
        }
Ejemplo n.º 4
0
        public static bool AddItemToCodeListbox(int insertLine, int indent, string text)
        {
            StringBuilder indentSb = new StringBuilder();

            for (int i = 0; i < indent; i++)
            {
                indentSb.Append(" ");
            }
            if (insertLine >= 0 && insertLine <= HalationViewCommand.LineCount())
            {
                Halation.mainView.codeListBox.Items.Insert(insertLine, indentSb.ToString() + text);
                Halation.mainView.codeGroupBox.Text =
                    $@"脚本 [{Halation.currentScriptName}] (Line: {Halation.currentCodePackage.GetAction().Count})";
                return(true);
            }
            else if (insertLine == -1)
            {
                Halation.mainView.codeListBox.Items.Add(indentSb.ToString() + text);
                Halation.mainView.codeGroupBox.Text =
                    $@"脚本 [{Halation.currentScriptName}] (Line: {Halation.currentCodePackage.GetAction().Count})";
                return(true);
            }
            return(false);
        }