/// <summary> /// /// </summary> /// <param name="targetItem"></param> public TargetItem(TargetItemBaseReadWrite targetItem) { _targetItem = targetItem; if (targetItem is ActionElementReadWrite) { this.Text = "Action"; this.SelectedImageIndex = 2; this.ImageIndex = 2; } else if (targetItem is SubjectElementReadWrite) { this.Text = "Subject"; this.SelectedImageIndex = 1; this.ImageIndex = 1; } else if (targetItem is ResourceElementReadWrite) { this.Text = "Resource"; this.SelectedImageIndex = 3; this.ImageIndex = 3; } this.Text += " (" + targetItem.Match.Count + " match/es)"; }
/// <summary> /// /// </summary> /// <param name="targetItem"></param> public TargetItem(TargetItemBaseReadWrite targetItem) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); LoadingData = true; _targetItem = targetItem; lstMatch.DisplayMember = "MatchId"; foreach (TargetMatchBaseReadWrite match in targetItem.Match) { lstMatch.Items.Add(match); } if (lstMatch.Items.Count != 0) { lstMatch.SelectedIndex = 0; } LoadingData = false; }
/// <summary> /// /// </summary> /// <param name="targetItem"></param> /// <param name="match"></param> /// <param name="index"></param> public Match(TargetItemBaseReadWrite targetItem, TargetMatchBaseReadWrite match, int index) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); LoadingData = true; foreach (FieldInfo field in typeof(Consts.Schema1.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(Consts.Schema1.InternalFunctions).GetFields()) { cmbFunctions.Items.Add(field.GetValue(null)); } txtSubjectCategory.Visible = false; lblSubjectCategory.Visible = false; _match = match; _index = index; if (targetItem is ActionElementReadWrite) { _targetItemName = "Action"; } else if (targetItem is SubjectElementReadWrite) { _targetItemName = "Subject"; txtSubjectCategory.Visible = true; lblSubjectCategory.Visible = true; } else if (targetItem is 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; }
/// <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)); }
/// <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 ) ); }