Ejemplo n.º 1
0
		/// <summary>
		/// Adds an object to the end of the CollectionBase.
		/// </summary>
		/// <param name="value">The Object to be added to the end of the CollectionBase. </param>
		/// <returns>The CollectionBase index at which the value has been added.</returns>
		public sealed override int Add( SubjectElementReadWrite value )  
		{
            if (value == null) throw new ArgumentNullException(nameof(value));
			return List.Add( 
                new SubjectElement(value.SubjectCategory ?? string.Empty, 
                new AttributeCollection( value.Attributes ), 
                value.SchemaVersion));
		}
 /// <summary>
 /// Gets the index of the given SubjectElementReadWrite in the collection
 /// </summary>
 /// <param name="subject"></param>
 /// <returns></returns>
 public int GetIndex(SubjectElementReadWrite subject)
 {
     for (int i = 0; i < this.Count; i++)
     {
         if (this.List[i] == subject)
         {
             return(i);
         }
     }
     return(-1);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds an object to the end of the CollectionBase.
 /// </summary>
 /// <param name="value">The Object to be added to the end of the CollectionBase. </param>
 /// <returns>The CollectionBase index at which the value has been added.</returns>
 public sealed override int Add(SubjectElementReadWrite value)
 {
     if (value == null)
     {
         throw new ArgumentNullException(nameof(value));
     }
     return(List.Add(
                new SubjectElement(value.SubjectCategory ?? string.Empty,
                                   new AttributeCollection(value.Attributes),
                                   value.SchemaVersion)));
 }
		/// <summary>
		/// Gets the index of the given SubjectElementReadWrite in the collection
		/// </summary>
		/// <param name="subject"></param>
		/// <returns></returns>
		public int GetIndex( SubjectElementReadWrite subject )
		{
			for( int i=0; i<this.Count; i++ )
			{
				if( this.List[i] == subject )
				{
					return i;
				}
			}
			return -1;
		}
Ejemplo n.º 5
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="subject"></param>
		public Subject( con.SubjectElementReadWrite subject )
		{
			_subject = subject;

			this.Text = "Subject";
			this.SelectedImageIndex = 2;
			this.ImageIndex = 2;

			foreach( con.AttributeElementReadWrite attr in _subject.Attributes )
			{
				this.Nodes.Add( new Attribute( attr ) );
			}
		}
Ejemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="subject"></param>
        public Subject(con.SubjectElementReadWrite subject)
        {
            _subject = subject;

            this.Text = "Subject";
            this.SelectedImageIndex = 2;
            this.ImageIndex         = 2;

            foreach (con.AttributeElementReadWrite attr in _subject.Attributes)
            {
                this.Nodes.Add(new Attribute(attr));
            }
        }
 /// <summary>
 /// Adds an object to the end of the CollectionBase.
 /// </summary>
 /// <param name="value">The Object to be added to the end of the CollectionBase. </param>
 /// <returns>The CollectionBase index at which the value has been added.</returns>
 public virtual int Add(SubjectElementReadWrite value)
 {
     return(List.Add(value));
 }
Ejemplo n.º 8
0
		private void CreateContextSubjectElement( object sender, EventArgs args)
		{
			con.SubjectElementReadWrite newSubject = new con.SubjectElementReadWrite(string.Empty, new con.AttributeReadWriteCollection(), XacmlVersion.Version11);
			Request requestNode = (Request)mainTree.SelectedNode;
			Subject newNode = new Subject( newSubject );
			con.RequestElementReadWrite request = requestNode.RequestDefinition;

			if( request.Subjects == null )
			{
				request.Subjects = new con.SubjectReadWriteCollection();
			}
			request.Subjects.Add( newSubject );
			requestNode.Nodes.Add( newNode );
		}
		/// <summary>
		/// Adds an object to the end of the CollectionBase.
		/// </summary>
		/// <param name="value">The Object to be added to the end of the CollectionBase. </param>
		/// <returns>The CollectionBase index at which the value has been added.</returns>
		public virtual int Add( SubjectElementReadWrite value )  
		{
			return( List.Add( value ) );
		}