Exemple #1
0
        /// <summary>Initializes a new instance of the TreeNode class.</summary>
        protected TreeNode(
            System.UInt32 identity,
            System.String caption,
            System.String filePath,
            System.Boolean visible,
            System.Collections.Immutable.ImmutableHashSet <System.String> attributes,
            System.Collections.Immutable.ImmutableList <TreeNode> children,
            ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableDictionary <System.UInt32, System.Collections.Generic.KeyValuePair <TreeNode, System.UInt32> > > lookupTable = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableDictionary <System.UInt32, System.Collections.Generic.KeyValuePair <TreeNode, System.UInt32> > >),
            ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
        {
            this.identity   = identity;
            this.caption    = caption;
            this.filePath   = filePath;
            this.visible    = visible;
            this.attributes = attributes;
            this.children   = children;
            if (!skipValidation.Value)
            {
                this.Validate();
            }
            var lookupTableInitResult = RecursiveTypeExtensions.LookupTable <TreeNode, TreeNode> .Initialize(this, lookupTable);

            this.lookupTable      = lookupTableInitResult.LookupTable;
            this.inefficiencyLoad = lookupTableInitResult.InefficiencyLoad;
        }
Exemple #2
0
        /// <summary>Returns a new instance with the Attributes property set to the specified value.</summary>
        public FileSystemFile WithAttributes(System.Collections.Immutable.ImmutableHashSet <System.String> value)
        {
            if (value == this.Attributes)
            {
                return(this);
            }

            return(this.With(attributes: value));
        }
Exemple #3
0
 /// <summary>Initializes a new instance of the FileSystemFile class.</summary>
 protected FileSystemFile(
     System.String pathSegment,
     System.Collections.Immutable.ImmutableHashSet <System.String> attributes)
     : base(
         pathSegment: pathSegment)
 {
     this.attributes = attributes;
     this.Validate();
 }
Exemple #4
0
 /// <summary>Initializes a new instance of the TreeNode class.</summary>
 protected TreeNode(
     System.String caption,
     System.String filePath,
     System.Boolean visible,
     System.Collections.Immutable.ImmutableHashSet <System.String> attributes,
     System.Collections.Immutable.ImmutableList <TreeNode> children)
     : base()
 {
     this.caption    = caption;
     this.filePath   = filePath;
     this.visible    = visible;
     this.attributes = attributes;
     this.children   = children;
     this.Validate();
 }
Exemple #5
0
 public static System.Collections.Immutable.ImmutableHashSet <T> RemoveRange <T>(System.Collections.Immutable.ImmutableHashSet <T> set, System.Collections.Generic.IEnumerable <T> values)
 {
     return(set.Except(values));
 }
Exemple #6
0
 public static System.Collections.Immutable.ImmutableHashSet <T> AddRange <T>(System.Collections.Immutable.ImmutableHashSet <T> set, System.Collections.Generic.IEnumerable <T> values)
 {
     return(set.Union(values));
 }
Exemple #7
0
 public static System.Collections.Immutable.ImmutableHashSet <T> ResetContents <T>(System.Collections.Immutable.ImmutableHashSet <T> set, System.Collections.Generic.IEnumerable <T> values)
 {
     return(set.SetEquals(values) ? set : set.Clear().Union(values));
 }