/// <summary> /// Creates a TargetItemCollection, with the items contained in a ReadWriteTargetItemCollection /// </summary> /// <param name="items"></param> public TargetItemCollection(TargetItemReadWriteCollection items) { if (items == null) throw new ArgumentNullException("items"); foreach (TargetItemBaseReadWrite item in items) { SubjectElementReadWrite sItem = item as SubjectElementReadWrite; ActionElementReadWrite aItem = item as ActionElementReadWrite; ResourceElementReadWrite rItem = item as ResourceElementReadWrite; EnvironmentElementReadWrite eItem = item as EnvironmentElementReadWrite; if (sItem != null) { this.List.Add(new SubjectElement(sItem.Match, sItem.SchemaVersion)); } else if (aItem != null) { this.List.Add(new ActionElement(aItem.Match, aItem.SchemaVersion)); } else if (rItem != null) { this.List.Add(new ResourceElement(rItem.Match, rItem.SchemaVersion)); } else if (eItem != null) { this.List.Add(new EnvironmentElement(eItem.Match, eItem.SchemaVersion)); } } }
/// <summary> /// Creates a TargetItemCollection, with the items contained in a ReadWriteTargetItemCollection /// </summary> /// <param name="items"></param> public TargetItemCollection(TargetItemReadWriteCollection items) { if (items == null) { throw new ArgumentNullException("items"); } foreach (TargetItemBaseReadWrite item in items) { SubjectElementReadWrite sItem = item as SubjectElementReadWrite; ActionElementReadWrite aItem = item as ActionElementReadWrite; ResourceElementReadWrite rItem = item as ResourceElementReadWrite; EnvironmentElementReadWrite eItem = item as EnvironmentElementReadWrite; if (sItem != null) { this.List.Add(new SubjectElement(sItem.Match, sItem.SchemaVersion)); } else if (aItem != null) { this.List.Add(new ActionElement(aItem.Match, aItem.SchemaVersion)); } else if (rItem != null) { this.List.Add(new ResourceElement(rItem.Match, rItem.SchemaVersion)); } else if (eItem != null) { this.List.Add(new EnvironmentElement(eItem.Match, eItem.SchemaVersion)); } } }
/// <summary> /// Creates a new TargetItem collection with the specified aguments. /// </summary> /// <param name="anyItem">Whether the target item is defined for any item</param> /// <param name="items">The taregt items.</param> /// <param name="schemaVersion">The version of the schema that was used to validate.</param> protected TargetItemsBaseReadWrite( bool anyItem, TargetItemReadWriteCollection items, XacmlVersion schemaVersion ) : this( schemaVersion ) { _anyItem = anyItem; _items = items; }
/// <summary> /// Creates a new TargetItem collection with the specified aguments. /// </summary> /// <param name="anyItem">Whether the target item is defined for any item</param> /// <param name="items">The taregt items.</param> /// <param name="schemaVersion">The version of the schema that was used to validate.</param> protected TargetItemsBaseReadWrite(bool anyItem, TargetItemReadWriteCollection items, XacmlVersion schemaVersion) : this( schemaVersion ) { _anyItem = anyItem; _items = items; }
/// <summary> /// Creates a new Environments with the specified aguments. /// </summary> /// <param name="anyItem">Whether the target item is defined for any item.</param> /// <param name="items">The taregt items.</param> /// <param name="version">The version of the schema that was used to validate.</param> public EnvironmentsElementReadWrite(bool anyItem, TargetItemReadWriteCollection items, XacmlVersion version) : base(anyItem, items, version) { }
/// <summary> /// Creates a new Subjects with the specified aguments. /// </summary> /// <param name="anyItem">Whether the target item is defined for any item</param> /// <param name="items">The taregt items.</param> /// <param name="version">The version of the schema that was used to validate.</param> public SubjectsElementReadWrite( bool anyItem, TargetItemReadWriteCollection items, XacmlVersion version ) : base( anyItem, items, version ) { }
/// <summary> /// Creates a new Actions with the specified aguments. /// </summary> /// <param name="anyItem">Whether the target item is defined for any item</param> /// <param name="items">The taregt items.</param> /// <param name="version">The version of the schema that was used to validate.</param> public ActionsElement(bool anyItem, TargetItemReadWriteCollection items, XacmlVersion version) : base(anyItem, items, version) { }
/// <summary> /// Creates a new Resources with the specified aguments. /// </summary> /// <param name="anyItem">Whether the target item is defined for any item</param> /// <param name="items">The taregt items.</param> /// <param name="version">The version of the schema that was used to validate.</param> public ResourcesElement( bool anyItem, TargetItemReadWriteCollection items, XacmlVersion version ) : base( anyItem, items, version ) { }
/// <summary> /// Creates a new Environments with the specified aguments. /// </summary> /// <param name="anyItem">Whether the target item is defined for any item.</param> /// <param name="items">The taregt items.</param> /// <param name="version">The version of the schema that was used to validate.</param> public EnvironmentsElement( bool anyItem, TargetItemReadWriteCollection items, XacmlVersion version ) : base( anyItem, items, version ) { }