/*================================================================================================
         *  Function    : LoadToLogReview
         *  Description : This function will Load all the data of the log file to the UI
         *  Parameters  : Nothing
         *  Returns     : Nothing as return type is void
         * `       ================================================================================================*/
        /// <summary>
        /// This function will Load all the data of the log file to the UI
        /// </summary>
        private void LoadToLogReview()
        {
            string description = null;

            using (StreamReader text = new StreamReader(Logger.GetCurrentLogPath()))
            {
                description = text.ReadToEnd();
            }
            LogData.AppendText(description);
        }
Пример #2
0
        private void AppendText(String text, Color colour)
        {
            int currentSelection = LogData.SelectionStart;

            LogData.SelectionStart  = LogData.TextLength;
            LogData.SelectionLength = 0;
            LogData.SelectionColor  = colour;

            LogData.AppendText(text + Environment.NewLine);

            LogData.SelectionColor = LogData.ForeColor;
            LogData.SelectionStart = currentSelection;
        }
        /*================================================================================================
         *  Function    : LogReviewFile
         *  Description : This function will Load all the data of the log file to the UI
         *  Parameters  : string LogString
         *  Returns     : Nothing as return type is void
         * `       ================================================================================================*/
        /// <summary>
        ///  This function will Load all the data of the log file to the UI
        /// </summary>
        /// <param name="logString"></param>
        private void LogReviewFile(string logString)
        {
            string location = logString;
            string data     = null;

            try
            {
                using (StreamReader text = new StreamReader(location))
                {
                    LogData.Document.Blocks.Clear();
                    data = text.ReadToEnd();
                    LogData.AppendText(data);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("File Not Found !!", "File Invalid", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }