예제 #1
0
 public static void Error(string message)
 {
     LogFile.WriteLine("ERROR: " + message);
 }
예제 #2
0
 public static void Info(string message)
 {
     LogFile.WriteLine("Info: " + message);
 }
예제 #3
0
 public static void Warning(string message)
 {
     LogFile.WriteLine("Warning: " + message);
 }
예제 #4
0
 public static void WriteOut(object inputobject)
 {
     if (inputobject.GetType().IsArray)
     {
         Array inputarray = (Array)inputobject;
         if (inputarray.Rank == 1)
         {
             string sCombinedString = "";
             foreach (object item in inputarray)
             {
                 if (item.GetType() == typeof(bool))
                 {
                     sCombinedString += ToString(item);
                 }
                 else
                 {
                     sCombinedString += ToString(item) + ", ";
                 }
             }
             Debug(sCombinedString);
         }
         else if (inputarray.Rank == 2)
         {
             for (int i = 0; i < inputarray.GetUpperBound(0) + 1; i++)
             {
                 Test.WriteOut(GetArraySlice(inputarray, i));
             }
         }
         else if (inputarray.Rank == 3)
         {
             for (int k = 0; k < inputarray.GetUpperBound(0) + 1; k++)
             {
                 LogFile.WriteLine("i = " + k.ToString());
                 for (int i = 0; i < inputarray.GetUpperBound(1) + 1; i++)
                 {
                     string sLine = "";
                     for (int j = 0; j < inputarray.GetUpperBound(2) + 1; j++)
                     {
                         sLine += ToString(inputarray.GetValue(new int[] { k, i, j })) + ", ";
                     }
                     Debug(sLine);
                 }
                 Debug("");
             }
         }
     }
     else if (inputobject.GetType() == typeof(ArrayList))
     {
         string sCombinedString = "";
         foreach (object item in (ArrayList)inputobject)
         {
             sCombinedString += item.ToString() + ", ";
         }
         Debug(sCombinedString);
     }
     else if (typeof(ICollection).IsInstanceOfType(inputobject))
     {
         string sCombinedString = "";
         foreach (object item in (ICollection)inputobject)
         {
             if (item.GetType() == typeof(DictionaryEntry))
             {
                 sCombinedString += "{" + ((DictionaryEntry)item).Key.ToString() + ", " + ((DictionaryEntry)item).Value.ToString() + "},";
             }
             else
             {
                 sCombinedString += item.ToString() + ", ";
             }
         }
         Debug(sCombinedString);
     }
     else
     {
         Debug(inputobject);
     }
 }