Example #1
0
        /// <summary>
        /// Erstellt eine neue Wetterdatei mit zwei Standard-Zeitbereichen
        /// </summary>
        /// <returns>Standard Wetterdatei</returns>
        public static WeatherFile CreateNewDefaultFile()
        {
            WeatherFile f = new WeatherFile();

            WeatherTimeRange r1 = new WeatherTimeRange(f);

            r1.Begin = new TimeSpan(17, 0, 0);
            r1.End   = new TimeSpan(9, 0, 0);
            WeatherTimeRange r2 = new WeatherTimeRange(f);

            r2.Begin = new TimeSpan(3, 0, 0);
            r2.End   = new TimeSpan(23, 0, 0);
            using (f.EnterNoUndoSection())
            {
                f.WeatherSet.Add(r1);
                f.WeatherSet.Add(r2);
            }
            return(f);
        }
Example #2
0
 public XElement ConvertToXml(L3dFilePath ownerPath = null)
 {
     return(new XElement(FileDescriptions.FILE_SKY_EL_WEATHER,
                         new XElement(FileDescriptions.FILE_SKY_EL_WEATHER_PROPS,
                                      new XAttribute(FileDescriptions.FILE_SKY_AT_WEATHER_PROBABILITY, Probability),
                                      new XAttribute(FileDescriptions.FILE_SKY_AT_WEATHER_FILE, WeatherFile != null ? WeatherFile.GetPathRelativeToFile(ownerPath) : string.Empty)
                                      )
                         ));
 }