Esempio n. 1
0
 private static void writeStatus(RichTextBox rtfStatus, Color statusColor, StatusArgs statusArgs)
 {
     rtfStatus.SelectionColor = statusColor;
     rtfStatus.AppendText(statusArgs.Category.ToString());
     rtfStatus.SelectionColor = Color.Black;
     rtfStatus.AppendText(": " + statusArgs.Text + "\r\n");
 }
Esempio n. 2
0
        public static void WriteRtfStatusArgsLine(RichTextBox rtfStatus, StatusArgs statusArgs)
        {
            switch (statusArgs.Type & StatusType._MASK)
            {
            case StatusType.Info:
                writeStatus(rtfStatus, Color.MediumBlue, statusArgs);
                break;

            case StatusType.Success:
                writeStatus(rtfStatus, Color.DarkGreen, statusArgs);
                break;

            case StatusType.Warning:
                writeStatus(rtfStatus, Color.DarkOrange, statusArgs);
                break;

            case StatusType.Error:
                writeStatus(rtfStatus, Color.DarkRed, statusArgs);
                break;

            default:
                writeStatus(rtfStatus, Color.DeepPink, statusArgs);
                break;
            }
        }
Esempio n. 3
0
        private void StatusEvent(object sender, StatusArgs e)
        {
            if (IsDisposed)
            {
                LoggingEnabled = false;
                return;
            }

            if (!mLoggingEnabled)
            {
                return;
            }
            if (InvokeRequired)
            {
                Invoke(new StatusEventDelegate(StatusEvent), new object[] { sender, e });
                return;
            }
            lock (mRtfTextLock)
            {
                if (!ReferenceEquals(mStatusFilterDelegate, null))
                {
                    if (mStatusFilterDelegate(e))
                    {
                        InfWizardStatus.WriteRtfStatusArgsLine(rtfSatus, e);
                    }
                }
                else
                {
                    InfWizardStatus.WriteRtfStatusArgsLine(rtfSatus, e);
                }
            }
        }
Esempio n. 4
0
 private static bool RemoveStatusFilter(StatusArgs statusargs)
 {
     if (statusargs.Category == CategoryType.EnumerateDevices)
     {
         return(false);
     }
     return(true);
 }
Esempio n. 5
0
        internal static StatusArgs Log(CategoryType category, StatusType statusType, string fmt, params object[] args)
        {
            StatusArgs statusArgs = new StatusArgs(category, statusType, fmt, args);

            lock (mLogLock)
            {
                return(Log(statusArgs));
            }
        }
Esempio n. 6
0
        internal static StatusArgs Log(StatusArgs statusArgs)
        {
            EventHandler <StatusArgs> temp = StatusEvent;

            if (!ReferenceEquals(temp, null))
            {
                temp(null, statusArgs);
            }

            if (DebugStatusOnlyMask == 0)
            {
                Debug.WriteLine("[" + statusArgs.Type + "] " + statusArgs.Text, statusArgs.Category.ToString());
            }
            else
            {
                if ((statusArgs.Type & DebugStatusOnlyMask) > 0)
                {
                    Debug.WriteLine("[" + statusArgs.Type + "] " + statusArgs.Text, statusArgs.Category.ToString());
                }
            }
            return(statusArgs);
        }
Esempio n. 7
0
        internal static StatusArgs Log(CategoryType category, StatusType statusType, string statusText)
        {
            StatusArgs statusArgs = new StatusArgs(category, statusType, statusText);

            return(Log(statusArgs));
        }
Esempio n. 8
0
 private static void writeStatus(RichTextBox rtfStatus, Color statusColor, StatusArgs statusArgs)
 {
     rtfStatus.SelectionColor = statusColor;
     rtfStatus.AppendText(statusArgs.Category.ToString());
     rtfStatus.SelectionColor = Color.Black;
     rtfStatus.AppendText(": " + statusArgs.Text + "\r\n");
 }
Esempio n. 9
0
 internal static StatusArgs Log(CategoryType category, StatusType statusType, string fmt, params object[] args)
 {
     StatusArgs statusArgs = new StatusArgs(category, statusType, fmt, args);
     lock (mLogLock)
     {
         return Log(statusArgs);
     }
 }
Esempio n. 10
0
 internal static StatusArgs Log(CategoryType category, StatusType statusType, string statusText)
 {
     StatusArgs statusArgs = new StatusArgs(category, statusType, statusText);
     return Log(statusArgs);
 }
Esempio n. 11
0
        internal static StatusArgs Log(StatusArgs statusArgs)
        {
            EventHandler<StatusArgs> temp = StatusEvent;
            if (!ReferenceEquals(temp, null))
                temp(null, statusArgs);

            if (DebugStatusOnlyMask==0)
                Debug.WriteLine("[" + statusArgs.Type + "] " + statusArgs.Text, statusArgs.Category.ToString());
            else
            {
               if ((statusArgs.Type & DebugStatusOnlyMask) > 0)
               {
                   Debug.WriteLine("[" + statusArgs.Type + "] " + statusArgs.Text, statusArgs.Category.ToString());
               }
            }
            return statusArgs;
        }
Esempio n. 12
0
 public static void WriteRtfStatusArgsLine(RichTextBox rtfStatus, StatusArgs statusArgs)
 {
     switch (statusArgs.Type & StatusType._MASK)
     {
         case StatusType.Info:
             writeStatus(rtfStatus, Color.MediumBlue, statusArgs);
             break;
         case StatusType.Success:
             writeStatus(rtfStatus, Color.DarkGreen, statusArgs);
             break;
         case StatusType.Warning:
             writeStatus(rtfStatus, Color.DarkOrange, statusArgs);
             break;
         case StatusType.Error:
             writeStatus(rtfStatus, Color.DarkRed, statusArgs);
             break;
         default:
             writeStatus(rtfStatus, Color.DeepPink, statusArgs);
             break;
     }
 }
 private static bool RemoveStatusFilter(StatusArgs statusargs)
 {
     if (statusargs.Category == CategoryType.EnumerateDevices)
         return false;
     return true;
 }
Esempio n. 14
0
        private void StatusEvent(object sender, StatusArgs e)
        {
            if (IsDisposed)
            {
                LoggingEnabled = false;
                return;
            }

            if (!mLoggingEnabled) return;
            if (InvokeRequired)
            {
                Invoke(new StatusEventDelegate(StatusEvent), new object[] {sender, e});
                return;
            }
            lock (mRtfTextLock)
            {
                if (!ReferenceEquals(mStatusFilterDelegate,null))
                {
                    if (mStatusFilterDelegate(e))
                        InfWizardStatus.WriteRtfStatusArgsLine(rtfSatus, e);
                }
                else
                    InfWizardStatus.WriteRtfStatusArgsLine(rtfSatus, e);
            }
        }