Example #1
0
 private void MatchSelectionChanged(object sender, EventArgs e)
 {
     if (((RadioButton) sender).Checked)
     {
         this.errProvider.SetError(this.chbEnableMask, string.Empty);
         this._selectedMatch = this._match1;
         if (((RadioButton) sender).Name == this.rdbMatch2.Name)
         {
             this._selectedMatch = this._match2;
         }
         if (((RadioButton) sender).Name == this.rdbMatch3.Name)
         {
             this._selectedMatch = this._match3;
         }
         if (((RadioButton) sender).Name == this.rdbMatch4.Name)
         {
             this._selectedMatch = this._match4;
         }
         if (this._selectedMatch.MatchNum == 1)
         {
             ControlHelper.DisableAndHideControl(this.cbbLogic);
             ControlHelper.DisableAndHideControl(this.lblLogic);
         }
         else
         {
             ControlHelper.EnableAndShowControl(this.cbbLogic);
             ControlHelper.EnableAndShowControl(this.lblLogic);
         }
         this._loadingPacketMatchProgramatically = true;
         this.chbEnableMask.Text = "Enable match " + this._selectedMatch.MatchNum.ToString();
         this.grbMaskConfiguration.Enabled = this.chbEnableMask.Checked = this._selectedMatch.Enabled;
         this.nudOffset.Value = this._selectedMatch.Offset;
         this.nudValue.Value = this._selectedMatch.Value;
         this.nudMask.Value = this._selectedMatch.Mask;
         this.cbbPolarity.SelectedIndex = (this._selectedMatch.Polarity == MatchPolarity.TrueIfMatches) ? 0 : 1;
         this.cbbLogic.SelectedIndex = (this._selectedMatch.Logic == MatchLogic.And) ? 0 : 1;
         this._loadingPacketMatchProgramatically = false;
     }
 }
Example #2
0
 private void InitializeMatchVariables()
 {
     this._match1 = new PacketMatch(1);
     this._match2 = new PacketMatch(2);
     this._match3 = new PacketMatch(3);
     this._match4 = new PacketMatch(4);
     this._selectedMatch = this._match1;
 }