BuildTools.BuildTools.AppendText C# (CSharp) Метод

AppendText() публичный Метод

Append text to the output textbox. This method will ensure thread safety on the AppendText method call. This will also prefix a "--- " before the given text and automatically append the given text with a new-line character.
public AppendText ( string text ) : void
text string Text to append to the output textbox.
Результат void
        public void AppendText(string text)
        {
            if (InvokeRequired) {
                Invoke(_appendDelegate, text);
            } else {
                outputTB.AppendText("--- " + text + "\n");
                outputTB.ScrollToCaret();
            }
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Checks if a BuildTools.jar exists, and if it exists, which version it is. It then checks the api on jenkins to see if
        /// there is a newer version available. If there is, or if a BuildTools.jar does not exist, this method will return true.
        /// Returns false if no update is needed.
        /// </summary>
        /// <returns>True if an update is needed.</returns>
        public bool CheckUpdate(out bool bad)
        {
            bad = false;
            if (!GetJson())
            {
                bad = true;
                return(false);
            }
            if (File.Exists(Dir + (string)_json["buildTools"]["name"]))
            {
                int  number  = (int)_api["number"];
                bool success = GetBuildNumberFromJar(out int currentBuildNumber);

                if (success)
                {
                    bool update = currentBuildNumber < number;
                    if (update)
                    {
                        _form.AppendText("BuildTools is out of date");
                    }

                    return(update);
                }
            }
            else
            {
                _form.AppendText("BuildTools does not exist");
            }
            return(true);
        }