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

Contents of /trunk/libTES3FileFormat/ConsoleLogger.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 17 - (show annotations) (download)
Fri Jul 29 16:09:53 2011 UTC (8 years, 11 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 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Windows.Forms;
6
7 namespace libTES3FileFormat
8 {
9 public interface IConsoleLoger
10 {
11 ConsoleLog Log { get; }
12 }
13 public interface IConsoleLog
14 {
15 void Write(string message);
16 void WriteLine(string message);
17 void WriteLine();
18 string GetLastMessage();
19 }
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 private string CurrentMessage = "";
27 public ConsoleLog()
28 {
29 this.LogControl = null;
30 }
31 public ConsoleLog(Control LogControl)
32 {
33 this.LogControl = LogControl;
34 }
35
36 #region IConsoleLog Members
37
38 public void Write(string message)
39 {
40 this.CurrentMessage = message;
41 Console.Write(message);
42 if (this.LogControl != null)
43 {
44 this.LogControl.Text = this.LogControl.Text + message;
45 }
46
47 }
48 public void WriteLine() { this.WriteLine(""); }
49 public void WriteLine(string message)
50 {
51 this.CurrentMessage = message;
52 Console.WriteLine(message);
53 if (this.LogControl != null)
54 {
55 this.LogControl.Text = this.LogControl.Text + System.Environment.NewLine + message;
56 }
57 }
58 public string GetLastMessage() { return this.CurrentMessage; }
59 #endregion
60 }
61 }

  ViewVC Help
Powered by ViewVC 1.1.22