Changeset 2584 for branches/eraser6/XmlTaskLists/Eraser.DefaultPlugins/ErasureTargets/FolderErasureTarget.cs
- Timestamp:
- 3/30/2012 5:52:34 AM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/XmlTaskLists/Eraser.DefaultPlugins/ErasureTargets/FolderErasureTarget.cs
r2561 r2584 26 26 27 27 using System.Text.RegularExpressions; 28 using System.Runtime.Serialization; 28 using System.Xml; 29 using System.Xml.Serialization; 29 30 using System.Runtime.InteropServices; 30 using System.Security.Permissions;31 31 using System.IO; 32 using System.Globalization; 32 33 33 34 using Eraser.Util; … … 45 46 { 46 47 #region Serialization code 47 protected FolderErasureTarget(SerializationInfo info, StreamingContext context) 48 : base(info, context) 49 { 50 IncludeMask = (string)info.GetValue("IncludeMask", typeof(string)); 51 ExcludeMask = (string)info.GetValue("ExcludeMask", typeof(string)); 52 DeleteIfEmpty = (bool)info.GetValue("DeleteIfEmpty", typeof(bool)); 53 } 54 55 [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)] 56 public override void GetObjectData(SerializationInfo info, StreamingContext context) 57 { 58 base.GetObjectData(info, context); 59 info.AddValue("IncludeMask", IncludeMask); 60 info.AddValue("ExcludeMask", ExcludeMask); 61 info.AddValue("DeleteIfEmpty", DeleteIfEmpty); 48 public override void ReadXml(XmlReader reader) 49 { 50 base.ReadXml(reader); 51 IncludeMask = reader.GetAttribute("includeMask"); 52 ExcludeMask = reader.GetAttribute("excludeMask"); 53 54 if (reader.HasAttributes) 55 { 56 bool deleteIfEmpty = true; 57 bool.TryParse(reader.GetAttribute("deleteIfEmpty"), out deleteIfEmpty); 58 DeleteIfEmpty = deleteIfEmpty; 59 } 60 } 61 62 public override void WriteXml(XmlWriter writer) 63 { 64 base.WriteXml(writer); 65 writer.WriteAttributeString("includeMask", IncludeMask); 66 writer.WriteAttributeString("excludeMask", ExcludeMask); 67 writer.WriteAttributeString("deleteIfEmpty", 68 DeleteIfEmpty.ToString(CultureInfo.InvariantCulture)); 62 69 } 63 70 #endregion
Note: See TracChangeset
for help on using the changeset viewer.
