ToString() 공개 메소드

public ToString ( ) : string
리턴 string
예제 #1
0
 /// <summary>
 /// Serialize dataLog to previously opened JSON file
 /// </summary>
 /// <param name="dataLog">Datalog to be serialized</param>
 public void SerializeData(DataLog dataLog)
 {
     using (FileStream fs = File.Open(fileName, FileMode.Append))
     {
         using (StreamWriter sw = new StreamWriter(fs))
         {
             // add comma if not first file in datalog
             if (serializedCount > 0)
             {
                 sw.Write(",");
             }
             //    // add data delimited with braces
             sw.Write("{\r\n");
             sw.Write(dataLog.ToString());
             sw.Write("\r\n}");
         }
     }
     // increment counter
     serializedCount++;
 }
예제 #2
0
 /// <summary>
 /// Serialize dataLog to previously opened JSON file
 /// </summary>
 /// <param name="dataLog">Datalog to be serialized</param>
 public void SerializeData(DataLog dataLog)
 {
     using (FileStream fs = File.Open(fileName, FileMode.Append))
     {
         using (StreamWriter sw = new StreamWriter(fs))
         {
             // add comma if not first file in datalog
             if (serializedCount > 0) sw.Write(",");
         //    // add data delimited with braces
             sw.Write("{\r\n");
             sw.Write(dataLog.ToString());
             sw.Write("\r\n}");
         }
     }
     // increment counter
     serializedCount++;
 }