/// <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)
     {
         var sItem = item as SubjectElementReadWrite;
         var aItem = item as ActionElementReadWrite;
         var rItem = item as ResourceElementReadWrite;
         var 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));
         }
     }
 }
示例#2
0
 /// <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)
     {
         var sItem = item as SubjectElementReadWrite;
         var aItem = item as ActionElementReadWrite;
         var rItem = item as ResourceElementReadWrite;
         var 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));
         }
     }
 }
示例#3
0
 /// <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 ActionsElementReadWrite(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 ResourcesElementReadWrite( bool anyItem, TargetItemReadWriteCollection items, XacmlVersion version )
			: base( anyItem, items, version )
		{
		}
 /// <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;
 }
示例#6
0
		/// <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 )
		{
		}
示例#7
0
 /// <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;
 }
示例#8
0
 /// <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)
 {
 }
示例#9
0
 /// <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)
 {
 }