Esempio n. 1
0
        public void WriteXml(XmlWriter writer)
        {
            writer.WriteStartElement("ExperimentSettings");
            writer.WriteAttributeString("Version", CurrentVersion.ToString());

            writer.WriteElementString("ExperimentID", ExperimentID);
            writer.WriteElementString("LastOpened", LastOpened.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffffff"));

            // ExperimentLogLevels
            {
                List <GlobalLogLevelSetting> settings = new List <GlobalLogLevelSetting>();

                foreach (GlobalLogLevelSetting setting in m_globalLogLevelSettings)
                {
                    GlobalLogLevelSetting defaultVersion = s_defaultSettings[setting.Level];
                    if (setting.IsEnabled != defaultVersion.IsEnabled)
                    {
                        settings.Add(setting);
                    }
                }

                if (settings.Count > 0)
                {
                    XmlSerializer serializer = TraceLab.Core.Serialization.XmlSerializerFactory.GetSerializer(typeof(List <GlobalLogLevelSetting>), null);
                    serializer.Serialize(writer, settings);
                }
            }

            writer.WriteEndElement(); // ExperimentSettings
        }
Esempio n. 2
0
 /// <summary>
 /// Lists all of the <see cref="WatchedFile"/>'s properties
 /// </summary>
 public override string ToString()
 {
     return(ShortPath + Environment.NewLine +
            "  Size:          " + ByteCount.ToString("n0") + " bytes" + Environment.NewLine +
            "  Archive:       " + Archive + Environment.NewLine +
            "  Hidden:        " + Hidden + Environment.NewLine +
            "  Readonly:      " + ReadOnly + Environment.NewLine +
            "  Last Opened:   " + LastOpened.ToString(DateFormatString) + Environment.NewLine +
            "  Last Modified: " + LastModified.ToString(DateFormatString));
 }