/[MorrowindCustomClothingSlotCreator]/trunk/libTES3FileFormat/ConsoleLogger.cs
ViewVC logotype

Annotation of /trunk/libTES3FileFormat/ConsoleLogger.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 17 - (hide annotations) (download)
Fri Jul 29 16:09:53 2011 UTC (8 years, 6 months ago) by william
File size: 1937 byte(s)
*** overhaul of code:
    +++ forget trying to parse the entire TES3 ESM/ESP plugin format
        just parse the clothing section

1 william 4 using System;
2     using System.Collections.Generic;
3     using System.Linq;
4     using System.Text;
5 william 8 using System.Windows.Forms;
6 william 4
7     namespace libTES3FileFormat
8     {
9 william 8 public interface IConsoleLoger
10 william 4 {
11 william 8 ConsoleLog Log { get; }
12     }
13     public interface IConsoleLog
14     {
15     void Write(string message);
16     void WriteLine(string message);
17     void WriteLine();
18 william 17 string GetLastMessage();
19 william 8 }
20     public class ConsoleLog : IConsoleLog
21     {
22     //public static void Newline() { LogMessage("", true); }
23     //public static void LogMessage(string message) { LogMessage(message, false); }
24     //public static void LogMessage(string message, bool OnNewLine) { if (OnNewLine) { Console.Write(System.Environment.NewLine); } Console.Write(message); }
25     private Control LogControl = null;
26 william 17 private string CurrentMessage = "";
27 william 8 public ConsoleLog()
28 william 4 {
29 william 8 this.LogControl = null;
30 william 4 }
31 william 8 public ConsoleLog(Control LogControl)
32 william 4 {
33 william 8 this.LogControl = LogControl;
34     }
35    
36     #region IConsoleLog Members
37    
38     public void Write(string message)
39     {
40 william 17 this.CurrentMessage = message;
41 william 4 Console.Write(message);
42 william 8 if (this.LogControl != null)
43     {
44     this.LogControl.Text = this.LogControl.Text + message;
45     }
46    
47 william 4 }
48 william 8 public void WriteLine() { this.WriteLine(""); }
49     public void WriteLine(string message)
50     {
51 william 17 this.CurrentMessage = message;
52 william 8 Console.WriteLine(message);
53     if (this.LogControl != null)
54     {
55     this.LogControl.Text = this.LogControl.Text + System.Environment.NewLine + message;
56     }
57     }
58 william 17 public string GetLastMessage() { return this.CurrentMessage; }
59 william 8 #endregion
60 william 4 }
61     }

  ViewVC Help
Powered by ViewVC 1.1.22