Example #1
0
            public object Deserialize(object?o, IXmlDeserializationInfo info, object?parentobject)
            {
                var isEnabled                       = info.GetBoolean("IsEnabled");
                var sourceDirectory                 = info.GetString("SourceDirectory");
                var destinationDirectory            = info.GetString("DestinationDirectory");
                var maxDepthOfSymbolicLinksToFollow = (info.CurrentElementName == "MaxDepthOfSymbolicLinksToFollow") ? info.GetInt32("MaxDepthOfSymbolicLinksToFollow") : 16;
                var filter = (Filter.FilterItemCollection)(info.GetValue("Filter", null) ?? throw new InvalidOperationException());

                return(new DirectoryEntry(sourceDirectory, destinationDirectory)
                {
                    IsEnabled = isEnabled,
                    _excludedFiles = filter,
                    _maxDepthOfSymbolicLinksToFollow = maxDepthOfSymbolicLinksToFollow,
                });
            }
Example #2
0
 public object Deserialize(object o, IXmlDeserializationInfo info, object parentobject)
 {
     return(info.GetBoolean("e"));
 }