コード例 #1
0
		/// <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;
		}
コード例 #2
0
 /// <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);
 }
コード例 #3
0
ファイル: Rule.cs プロジェクト: mingkongbin/anycmd
        /// <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 );
        }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
ファイル: Rule.cs プロジェクト: zszqwe/anycmd
        /// <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;
        }
コード例 #6
0
ファイル: Rule.cs プロジェクト: mingkongbin/anycmd
        /// <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;
        }
コード例 #7
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( RuleElementReadWrite value )  
		{
			return( List.Add( value ) );
		}
コード例 #8
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(RuleElementReadWrite value)
 {
     return(List.Add(value));
 }