/// <summary> /// Gets the index of the given RuleElementReadWrite in the collection /// </summary> /// <param name="rule"></param> /// <returns></returns> public int GetIndex( RuleElementReadWrite rule ) { for( int i=0; i<this.Count; i++ ) { if( this.List[i] == rule ) { return i; } } return -1; }
/// <summary> /// Gets the index of the given RuleElementReadWrite in the collection /// </summary> /// <param name="rule"></param> /// <returns></returns> public int GetIndex(RuleElementReadWrite rule) { for (int i = 0; i < this.Count; i++) { if (this.List[i] == rule) { return(i); } } return(-1); }
/// <summary> /// /// </summary> /// <param name="rule"></param> public Rule( pol.RuleElementReadWrite rule ) { _rule = rule; if( _rule.Target == null ) { this.Nodes.Add( new AnyTarget() ); } else { this.Nodes.Add( new Target( _rule.Target ) ); } if( _rule.Condition != null ) { this.Nodes.Add( new Condition( _rule.Condition ) ); } this.Text = string.Format( "Rule ({0})", rule.Id ); }
/// <summary> /// /// </summary> /// <param name="rule"></param> public Rule(pol.RuleElementReadWrite rule) { _rule = rule; if (_rule.Target == null) { this.Nodes.Add(new AnyTarget()); } else { this.Nodes.Add(new Target(_rule.Target)); } if (_rule.Condition != null) { this.Nodes.Add(new Condition(_rule.Condition)); } this.Text = string.Format("Rule ({0})", rule.Id); }
/// <summary> /// /// </summary> public Rule(pol.RuleElementReadWrite rule) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); _rule = rule; LoadingData = true; cmbEffect.Items.Add(pol.Effect.Deny); cmbEffect.Items.Add(pol.Effect.Permit); txtDescription.Text = _rule.Description; txtPolicyId.Text = _rule.Id; cmbEffect.SelectedIndex = cmbEffect.FindStringExact(_rule.Effect.ToString()); txtDescription.DataBindings.Add("Text", _rule, "Description"); txtPolicyId.DataBindings.Add("Text", _rule, "Id"); cmbEffect.DataBindings.Add("SelectedValue", _rule, "Effect"); LoadingData = false; }
/// <summary> /// /// </summary> public Rule( pol.RuleElementReadWrite rule ) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); _rule = rule; LoadingData = true; cmbEffect.Items.Add( pol.Effect.Deny ); cmbEffect.Items.Add( pol.Effect.Permit ); txtDescription.Text = _rule.Description; txtPolicyId.Text = _rule.Id; cmbEffect.SelectedIndex = cmbEffect.FindStringExact( _rule.Effect.ToString() ); txtDescription.DataBindings.Add( "Text", _rule, "Description" ); txtPolicyId.DataBindings.Add( "Text", _rule, "Id" ); cmbEffect.DataBindings.Add( "SelectedValue", _rule, "Effect" ); 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( RuleElementReadWrite 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(RuleElementReadWrite value) { return(List.Add(value)); }