Ejemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="attribute"></param>
        public Attribute( con.AttributeElementReadWrite attribute )
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            LoadingData = true;

            _attribute = attribute;

            foreach( FieldInfo field in typeof(Consts.Schema1.InternalDataTypes).GetFields() )
            {
                cmbDataType.Items.Add( field.GetValue( null ) );
            }

            this.lstAttributeValue.DisplayMember = "Value";

            foreach( con.AttributeValueElementReadWrite attr in _attribute.AttributeValues )
            {
                lstAttributeValue.Items.Add( attr );
            }

            if( _attribute.AttributeValues.Count != 0 )
            {
                lstAttributeValue.SelectedIndex = 0;
            }

            txtId.Text = _attribute.AttributeId;
            txtId.DataBindings.Add( "Text", _attribute, "AttributeId" );
            txtIssuer.Text = _attribute.Issuer;
            //txtIssuer.DataBindings.Add( "Text", _attribute, "Issuer" );
            cmbDataType.SelectedIndex = cmbDataType.FindStringExact( _attribute.DataType);
            cmbDataType.DataBindings.Add( "SelectedItem", _attribute, "DataType" );
            LoadingData = false;
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="attribute"></param>
        public Attribute(con.AttributeElementReadWrite attribute)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            LoadingData = true;

            _attribute = attribute;

            foreach (FieldInfo field in typeof(Consts.Schema1.InternalDataTypes).GetFields())
            {
                cmbDataType.Items.Add(field.GetValue(null));
            }

            this.lstAttributeValue.DisplayMember = "Value";

            foreach (con.AttributeValueElementReadWrite attr in _attribute.AttributeValues)
            {
                lstAttributeValue.Items.Add(attr);
            }

            if (_attribute.AttributeValues.Count != 0)
            {
                lstAttributeValue.SelectedIndex = 0;
            }

            txtId.Text = _attribute.AttributeId;
            txtId.DataBindings.Add("Text", _attribute, "AttributeId");
            txtIssuer.Text = _attribute.Issuer;
            //txtIssuer.DataBindings.Add( "Text", _attribute, "Issuer" );
            cmbDataType.SelectedIndex = cmbDataType.FindStringExact(_attribute.DataType);
            cmbDataType.DataBindings.Add("SelectedItem", _attribute, "DataType");
            LoadingData = false;
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="attribute"></param>
        public Attribute(con.AttributeElementReadWrite attribute)
        {
            _attribute = attribute;

            this.Text = "Attribute";
            this.SelectedImageIndex = 3;
            this.ImageIndex         = 3;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="attribute"></param>
        public Attribute( con.AttributeElementReadWrite attribute )
        {
            _attribute = attribute;

            this.Text = "Attribute";
            this.SelectedImageIndex = 3;
            this.ImageIndex = 3;
        }
Ejemplo n.º 5
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 override int Add(AttributeElementReadWrite value)
 {
     if (value == null)
     {
         throw new ArgumentNullException("value");
     }
     return(List.Add(new AttributeElement(value.AttributeId, value.DataType, value.Issuer, value.IssueInstant, value.Value,
                                          value.SchemaVersion)));
 }
 /// <summary>
 /// Gets the index of the given AttributeElementReadWrite in the collection
 /// </summary>
 /// <param name="attribute"></param>
 /// <returns></returns>
 public int GetIndex(AttributeElementReadWrite attribute)
 {
     for (var i = 0; i < this.Count; i++)
     {
         if (this.List[i] == attribute)
         {
             return i;
         }
     }
     return -1;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Gets the index of the given AttributeElementReadWrite in the collection
 /// </summary>
 /// <param name="attribute"></param>
 /// <returns></returns>
 public int GetIndex(AttributeElementReadWrite attribute)
 {
     for (var i = 0; i < this.Count; i++)
     {
         if (this.List[i] == attribute)
         {
             return(i);
         }
     }
     return(-1);
 }
 /// <summary>
 /// Clones an Attribute from another attribute.
 /// </summary>
 /// <param name="attributeElement">The attribute id.</param>
 public AttributeElementReadWrite(AttributeElementReadWrite attributeElement)
     : base(XacmlSchema.Context, attributeElement.SchemaVersion)
 {
     if (attributeElement == null) throw new ArgumentNullException("attributeElement");
     _attributeId = attributeElement._attributeId;
     _dataType = attributeElement._dataType;
     _issuer = attributeElement._issuer;
     _issueInstant = attributeElement._issueInstant;
     foreach (AttributeValueElementReadWrite avalue in attributeElement._attributeValues)
     {
         _attributeValues.Add(new AttributeValueElementReadWrite(avalue));
     }
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Clones an Attribute from another attribute.
 /// </summary>
 /// <param name="attributeElement">The attribute id.</param>
 public AttributeElementReadWrite(AttributeElementReadWrite attributeElement)
     : base(XacmlSchema.Context, attributeElement.SchemaVersion)
 {
     if (attributeElement == null)
     {
         throw new ArgumentNullException("attributeElement");
     }
     _attributeId  = attributeElement._attributeId;
     _dataType     = attributeElement._dataType;
     _issuer       = attributeElement._issuer;
     _issueInstant = attributeElement._issueInstant;
     foreach (AttributeValueElementReadWrite avalue in attributeElement._attributeValues)
     {
         _attributeValues.Add(new AttributeValueElementReadWrite(avalue));
     }
 }
 /// <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(AttributeElementReadWrite value)
 {
     return (List.Add(value));
 }
Ejemplo n.º 11
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(AttributeElementReadWrite value)
 {
     return(List.Add(value));
 }
Ejemplo n.º 12
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 override int Add(AttributeElementReadWrite value)
 {
     if (value == null) throw new ArgumentNullException("value");
     return (List.Add(new AttributeElement(value.AttributeId, value.DataType, value.Issuer, value.IssueInstant, value.Value,
         value.SchemaVersion)));
 }