1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- using System;
- using System.Text;
- using System.Runtime.InteropServices;
- using Wayne.Lib;
- using Wayne.Lib.Log;
- namespace Wayne.ForecourtControl.Fusion
- {
- public static class Trace
- {
- public static DebugLogger debugLogger = null;
- public static void Add(IIdentifiableEntity logclass)
- {
- try
- {
- if (debugLogger == null)
- debugLogger = new DebugLogger(logclass, true);
- }
- catch (Exception ex)
- {
- }
- }
- public static void WriteLine(string msg)
- {
- try
- {
- if (debugLogger != null && debugLogger.IsActive())
- {
- debugLogger.Add(msg);
- }
- }
- catch (Exception ex)
- {
- }
- }
- public static void WriteLineIf(bool condition, string msg)
- {
- try
- {
- if (debugLogger != null && debugLogger.IsActive() && (condition || debugLogger.GetDebugLevel() == DebugLogLevel.Detailed))
- {
- debugLogger.Add(msg);
- }
- }
- catch (Exception ex)
- {
- }
- }
- public static bool CheckTraceLevel(int iLevel)
- {
- return true;
- }
- }
- public static class IniFile
- {
- [DllImport("kernel32")]
- private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
- public static string IniReadValue(string Path, string Section, string Key)
- {
- StringBuilder temp = new StringBuilder(255);
- int i = GetPrivateProfileString(Section, Key, "", temp, 255, Path);
- return temp.ToString();
- }
- }
- }
|