Ejemplo n.º 1
0
 void CloseTemperatureStreamWriter()
 {
     if (TemperatureStreamWriter != null)
     {
         TemperatureStreamWriter.Flush();
         TemperatureStreamWriter.Close();
         TemperatureStreamWriter = null;
     }
 }
Ejemplo n.º 2
0
 void TemperatureInCelsius_TemperaturePropertiesUpdated(object sender, EventArgs e)
 {
     if (IsToWriteLogOfTemperature)
     {
         Trace.Assert(TemperatureStreamWriter != null);
         TemperatureStreamWriter.WriteLine("{0}, {1}, {2}, {3}",
                                           DateTime.Now,
                                           (DateTime.Now - StartTime).TotalSeconds,
                                           Device.TemperatureInCelsius.Value,
                                           Device.TemperatureInFahrenheit.Value);
         TemperatureStreamWriter.Flush();
     }
 }