Пример #1
0
        internal void OutputLog(LoggingEnumerations.LogEventTypes logEnum, string Message)
        {
            Style      style         = infoStyle;
            StackTrace stackTrace    = new StackTrace();
            string     callingMethod = stackTrace.GetFrame(2).GetMethod().Name; // Display if in Debug Mode - which Method called me

            switch (logEnum)
            {
            case LoggingEnumerations.LogEventTypes.Success:
                style = successStyle;
                break;

            case LoggingEnumerations.LogEventTypes.Warning:
                style = warningStyle;
                break;

            case LoggingEnumerations.LogEventTypes.Failure:
                style = errorStyle;
                break;

            default:
                style = infoStyle;
                break;
            }

#if DEBUG
            Message = "[" + callingMethod + "]" + Message;
#endif
            Message = DateTime.Now + "\t" + Message;
            SetFCTBMessage(Message, style);
        }
Пример #2
0
        //TODO: Clean this up
        private void frmMainLog(string Message, LoggingEnumerations.LogEventTypes le = LoggingEnumerations.LogEventTypes.Information)
        {
            StackTrace stackTrace    = new StackTrace();
            string     callingMethod = stackTrace.GetFrame(2).GetMethod().Name; // Display if in Debug Mode - which Method called me

            if (!callingMethod.Contains("<.ctor>b__0"))
            {
                outputForm.OutputLog(le, "[" + callingMethod + "]\t" + Message);
            }
            else
            {
                outputForm.OutputLog(le, "\t" + Message);
            }
        }
Пример #3
0
 void projectForm_LogEvent(LoggingEnumerations.LogEventTypes EventType, string status)
 {
     frmMainLog(status, EventType);
 }
Пример #4
0
        //TODO: If documents are open then save the list to the project file for re-opening on re-starting the program
        void projectForm_OpenDocumentEvent(LoggingEnumerations.LogEventTypes EventType, string path)
        {
            frmDocument documentForm = new frmDocument(path);

            documentForm.Show(dockPanel, DockState.Document);
        }