コード例 #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));
		}
コード例 #2
0
 /// <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);
 }
コード例 #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)));
 }
コード例 #4
0
		/// <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;
		}
コード例 #5
0
ファイル: Subject.cs プロジェクト: Condeti/XACML.NET
		/// <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 ) );
			}
		}
コード例 #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));
            }
        }
コード例 #7
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 virtual int Add(SubjectElementReadWrite value)
 {
     return(List.Add(value));
 }
コード例 #8
0
ファイル: MainForm.cs プロジェクト: Condeti/XACML.NET
		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 );
		}
コード例 #9
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 virtual int Add( SubjectElementReadWrite value )  
		{
			return( List.Add( value ) );
		}