Пример #1
0
 private void btnAttributeAssignmentsAdd_Click(object sender, EventArgs e)
 {
     pol.ObligationElementReadWrite          obligation = lstObligations.SelectedItem as pol.ObligationElementReadWrite;
     pol.AttributeAssignmentElementReadWrite oAtt       = new pol.AttributeAssignmentElementReadWrite("TODO: Add AttributeId", InternalDataTypes.XsdString,
                                                                                                      string.Empty, obligation.SchemaVersion);
     obligation.AttributeAssignment.Add(oAtt);
     lstAttributeAssignments.Items.Add(oAtt);
 }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lstObligations_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (index != -1)
            {
                pol.AttributeAssignmentElementReadWrite attrAux = lstAttributeAssignments.Items[index] as pol.AttributeAssignmentElementReadWrite;
                attrAux.AttributeId = txtAttributeId.Text;
                attrAux.Value       = txtAttributeAssignemnt.Text;
            }
            if (obligationIndex != -1 && obligationIndex != lstObligations.SelectedIndex)
            {
                pol.ObligationElementReadWrite obliAux = lstObligations.Items[obligationIndex] as pol.ObligationElementReadWrite;
                obliAux.ObligationId = txtId.Text;
                if (cmbEffect.Text.Equals(pol.Effect.Deny.ToString()))
                {
                    obliAux.FulfillOn = pol.Effect.Deny;
                }
                else if (cmbEffect.Text.Equals(pol.Effect.Permit.ToString()))
                {
                    obliAux.FulfillOn = pol.Effect.Permit;
                }
                lstObligations.Items.RemoveAt(obligationIndex);
                lstObligations.Items.Insert(obligationIndex, obliAux);
            }
            obligationIndex = lstObligations.SelectedIndex;
            pol.ObligationElementReadWrite obligation = lstObligations.SelectedItem as pol.ObligationElementReadWrite;

            if (!LoadingData)
            {
                try
                {
                    LoadingData = true;

                    if (obligation != null)
                    {
                        txtId.Text = obligation.ObligationId;
                        cmbEffect.SelectedIndex = cmbEffect.FindStringExact(obligation.FulfillOn.ToString());

                        lstAttributeAssignments.Items.Clear();
                        foreach (pol.AttributeAssignmentElementReadWrite attr in obligation.AttributeAssignment)
                        {
                            lstAttributeAssignments.Items.Add(attr);
                        }
                        txtAttributeId.Text         = string.Empty;
                        txtAttributeAssignemnt.Text = string.Empty;
                    }
                    index = -1;
                }
                finally
                {
                    LoadingData = false;
                }
            }
            else
            {
                obligationIndex = -1;
            }
        }
Пример #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAdd_Click(object sender, EventArgs e)
 {
     LoadingData = true;
     txtId.Text  = string.Empty;
     lstAttributeAssignments.Items.Clear();
     txtAttributeAssignemnt.Text = string.Empty;
     txtAttributeId.Text         = string.Empty;
     index           = -1;
     obligationIndex = -1;
     pol.ObligationElementReadWrite oObligation = new pol.ObligationElementReadWrite(null, XacmlVersion.Version11);
     lstObligations.Items.Add(oObligation);
     _obligations.Add(oObligation);
     LoadingData = false;
 }
Пример #4
0
        private void btnAttributeAssignmentsRemove_Click(object sender, EventArgs e)
        {
            index = -1;
            pol.ObligationElementReadWrite          obligation = lstObligations.SelectedItem as pol.ObligationElementReadWrite;
            pol.AttributeAssignmentElementReadWrite attribute  = lstAttributeAssignments.SelectedItem as pol.AttributeAssignmentElementReadWrite;

            try
            {
                LoadingData = true;

                txtAttributeAssignemnt.Text = string.Empty;
                txtAttributeId.Text         = string.Empty;

                obligation.AttributeAssignment.RemoveAt(lstAttributeAssignments.SelectedIndex);
                lstAttributeAssignments.Items.RemoveAt(lstAttributeAssignments.SelectedIndex);
            }
            finally
            {
                LoadingData = false;
            }
        }
Пример #5
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void btnAdd_Click(object sender, EventArgs e)
		{
			LoadingData = true;
			txtId.Text = string.Empty;
			lstAttributeAssignments.Items.Clear();
			txtAttributeAssignemnt.Text = string.Empty;
			txtAttributeId.Text = string.Empty;
			index = -1;
			obligationIndex = -1;
			pol.ObligationElementReadWrite oObligation = new pol.ObligationElementReadWrite(null,XacmlVersion.Version11);
			lstObligations.Items.Add(oObligation);
			_obligations.Add( oObligation );
			LoadingData = false;
		}
Пример #6
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(ObligationElementReadWrite value)
 {
     return(List.Add(value));
 }
		/// <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( ObligationElementReadWrite value )  
		{
			return( List.Add( value ) );
		}