public override string ToString() { var sb = new StringBuilder(); sb.Append("Name: ").AppendLine(Name); sb.Append("Enabled: ").AppendLine(IsEnabled.ToString()); sb.Append("Panorama User: "******"Created: ").Append(Created.ToShortDateString()).AppendLine(Created.ToShortTimeString()); sb.Append("Modified: ").Append(Modified.ToShortDateString()).AppendLine(Modified.ToShortTimeString()); sb.AppendLine("").AppendLine("Main Settings"); sb.Append(MainSettings); sb.AppendLine("").AppendLine("Panorama Settings"); sb.Append(PanoramaSettings); return(sb.ToString()); }
public SystemFileInfo(string fullPath) { if (fullPath == null || !File.Exists(fullPath)) { throw new FileNotFoundException(fullPath); } var file = new System.IO.FileInfo(fullPath); FullPath = fullPath; Name = System.IO.Path.GetFileName(fullPath); Path = System.IO.Path.GetDirectoryName(fullPath); Modified = file.LastWriteTime; ModifiedString = Modified.ToShortDateString() + " " + Modified.ToShortTimeString(); Size = file.Length; SizeString = GetFileSizeInBytes(Size); }
public void WriteXml(XmlWriter writer) { writer.WriteStartElement("autoqc_config"); writer.WriteAttribute(ATTR.name, Name); writer.WriteAttribute(ATTR.is_enabled, IsEnabled); writer.WriteAttributeIfString(ATTR.user, User); writer.WriteAttributeIfString(ATTR.created, Created.ToShortDateString() + " " + Created.ToShortTimeString()); writer.WriteAttributeIfString(ATTR.modified, Modified.ToShortDateString() + " " + Modified.ToShortTimeString()); MainSettings.WriteXml(writer); PanoramaSettings.WriteXml(writer); writer.WriteEndElement(); }