Exemplo n.º 1
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="targetItem"></param>
		public TargetItem( pol.TargetItemBaseReadWrite targetItem )
		{
			_targetItem = targetItem;

			if( targetItem is pol.ActionElementReadWrite )
			{
				this.Text = "Action";
				this.SelectedImageIndex = 2;
				this.ImageIndex = 2;
			}
			else if( targetItem is pol.SubjectElementReadWrite )
			{
				this.Text = "Subject";
				this.SelectedImageIndex = 1;
				this.ImageIndex = 1;
			}
			else if( targetItem is pol.ResourceElementReadWrite )
			{
				this.Text = "Resource";
				this.SelectedImageIndex = 3;
				this.ImageIndex = 3;
			}

			this.Text += " (" + targetItem.Match.Count + " match/es)";
		}
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="targetItem"></param>
        public TargetItem(pol.TargetItemBaseReadWrite targetItem)
        {
            _targetItem = targetItem;

            if (targetItem is pol.ActionElementReadWrite)
            {
                this.Text = "Action";
                this.SelectedImageIndex = 2;
                this.ImageIndex         = 2;
            }
            else if (targetItem is pol.SubjectElementReadWrite)
            {
                this.Text = "Subject";
                this.SelectedImageIndex = 1;
                this.ImageIndex         = 1;
            }
            else if (targetItem is pol.ResourceElementReadWrite)
            {
                this.Text = "Resource";
                this.SelectedImageIndex = 3;
                this.ImageIndex         = 3;
            }

            this.Text += " (" + targetItem.Match.Count + " match/es)";
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="targetItem"></param>
        public TargetItem(pol.TargetItemBaseReadWrite targetItem)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            LoadingData = true;

            _targetItem = targetItem;

            lstMatch.DisplayMember = "MatchId";
            foreach (pol.TargetMatchBaseReadWrite match in targetItem.Match)
            {
                lstMatch.Items.Add(match);
            }
            if (lstMatch.Items.Count != 0)
            {
                lstMatch.SelectedIndex = 0;
            }

            LoadingData = false;
        }
Exemplo n.º 4
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="targetItem"></param>
		public TargetItem( pol.TargetItemBaseReadWrite targetItem )
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();

			LoadingData = true;

			_targetItem = targetItem;

			lstMatch.DisplayMember = "MatchId";
			foreach( pol.TargetMatchBaseReadWrite match in targetItem.Match )
			{
				lstMatch.Items.Add( match );
			}
			if( lstMatch.Items.Count != 0 )
			{
				lstMatch.SelectedIndex = 0;
			}

			LoadingData = false;
		}
		/// <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( TargetItemBaseReadWrite value )  
		{
			return( List.Add( value ) );
		}
Exemplo n.º 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(TargetItemBaseReadWrite value)
 {
     return(List.Add(value));
 }
Exemplo n.º 7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="targetItem"></param>
        /// <param name="match"></param>
        /// <param name="index"></param>
        public Match(pol.TargetItemBaseReadWrite targetItem, pol.TargetMatchBaseReadWrite match, int index)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            LoadingData = true;

            foreach (FieldInfo field in typeof(InternalDataTypes).GetFields())
            {
                cmbASDataType.Items.Add(field.GetValue(null));
                cmbADDataType.Items.Add(field.GetValue(null));
                cmbAVDataType.Items.Add(field.GetValue(null));
            }

            foreach (FieldInfo field in typeof(InternalFunctions).GetFields())
            {
                cmbFunctions.Items.Add(field.GetValue(null));
            }

            txtSubjectCategory.Visible = false;
            lblSubjectCategory.Visible = false;

            _match = match;
            _index = index;

            if (targetItem is pol.ActionElementReadWrite)
            {
                _targetItemName = "Action";
            }
            else if (targetItem is pol.SubjectElementReadWrite)
            {
                _targetItemName            = "Subject";
                txtSubjectCategory.Visible = true;
                lblSubjectCategory.Visible = true;
            }
            else if (targetItem is pol.ResourceElementReadWrite)
            {
                _targetItemName = "Resource";
            }

            grpMatch.Text = _targetItemName + "Match";

            cmbFunctions.SelectedIndex = cmbFunctions.FindStringExact(_match.MatchId);
            cmbFunctions.DataBindings.Add("SelectedItem", _match, "MatchId");

            cmbAVDataType.SelectedIndex = cmbAVDataType.FindStringExact(match.AttributeValue.DataType);
            cmbAVDataType.DataBindings.Add("SelectedItem", _match.AttributeValue, "DataType");

            txtAttributeValue.Text = match.AttributeValue.Contents;
            txtAttributeValue.DataBindings.Add("Text", _match.AttributeValue, "Contents");

            if (match.AttributeReference is pol.AttributeDesignatorBase)
            {
                rdbAttributeDesignator.Checked = true;
                rdbAttributeSelector.Checked   = false;

                cmbADDataType.SelectedIndex = cmbADDataType.FindStringExact(match.AttributeReference.DataType);
                cmbADDataType.DataBindings.Add("SelectedItem", _match.AttributeReference, "DataType");

                chkADMustBePresent.Checked = match.AttributeReference.MustBePresent;
                chkADMustBePresent.DataBindings.Add("Checked", _match.AttributeReference, "MustBePresent");

                pol.AttributeDesignatorBase attributeDesignator = (pol.AttributeDesignatorBase)match.AttributeReference;
                txtAttributeId.Text = attributeDesignator.AttributeId;
                txtAttributeId.DataBindings.Add("Text", _match.AttributeReference, "AttributeId");

                txtIssuer.Text = attributeDesignator.Issuer;
                txtIssuer.DataBindings.Add("Text", _match.AttributeReference, "Issuer");
            }
            else if (match.AttributeReference is pol.AttributeSelectorElement)
            {
                rdbAttributeDesignator.Checked = false;
                rdbAttributeSelector.Checked   = true;

                cmbASDataType.SelectedIndex = cmbASDataType.FindStringExact(match.AttributeReference.DataType);
                cmbASDataType.DataBindings.Add("SelectedItem", _match.AttributeReference, "DataType");

                chkASMustBePresent.Checked = match.AttributeReference.MustBePresent;
                chkASMustBePresent.DataBindings.Add("Checked", _match.AttributeReference, "MustBePresent");

                txtRequestContextPath.Text = ((pol.AttributeSelectorElement)match.AttributeReference).RequestContextPath;
                txtRequestContextPath.DataBindings.Add("Text", _match.AttributeReference, "RequestContextPath");
            }

            LoadingData = false;
        }