Exemplo n.º 1
0
 public Output(FolderManager manager)
 {
     _manager    = manager;
     _lexFlags   = (LexType.Command | LexType.Function | LexType.Hook | LexType.HookCall);
     _outputFlag = OutputFlag.Replicate;
     _path       = Directory.GetCurrentDirectory() + "\\" + _manager.GetName();
 }
Exemplo n.º 2
0
 private void WriteOutupt(string text, OutputFlag flag)
 {
     Dispatcher.Invoke(() =>
     {
         txbOutput.Text += DateTime.Now.ToShortTimeString() + " | " + flag.ToString() + " | " + text + "\n";
         ScrollOutput.ScrollToBottom();
     });
 }
Exemplo n.º 3
0
 public Logger(OutputFlag outputFlag, string logPath = null, string timeFormat_file = "yyMMdd-HH-mm-ss", string timeFormat_others = "HH:mm:ss")
 {
     this.OutputFlag  = outputFlag;
     this.LogFilePath = logPath;
     this._timeFormat = timeFormat_others;
     if (!String.IsNullOrWhiteSpace(logPath))
     {
         #region Insert system time into the file name
         int lastPoint = -1;
         for (int i = this.LogFilePath.Length - 1; i >= 0; --i)
         {
             if (this.LogFilePath[i] == '.')
             {
                 lastPoint = i;
                 break;
             }
         }
         if (lastPoint != -1)
         {
             logPath = String.Format("{0} {1}{2}", logPath.Substring(0, lastPoint),
                                     _startTime.ToString(timeFormat_file), logPath.Substring(lastPoint));
         }
         else
         {
             logPath += _startTime;
         }
         #endregion
         #region Open file stream and add some basic information
         this._writer           = File.CreateText(logPath);
         this._writer.AutoFlush = true;
         this._writer.WriteLine(logPath);
         this._writer.WriteLine(_startTime.ToLongDateString());
         this._writer.WriteLine();
         #endregion
     }
 }
Exemplo n.º 4
0
 public void SetOutputFlags(OutputFlag flag)
 {
     _outputFlag = flag;
 }