Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/13/08 17:06:15 (15 years ago)
Author:
aleitner
Message:

added reading logs into a ListBox in the Hive Client Console (#352)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Console/IPAdressTextBox.cs

    r717 r752  
    4646    private System.ComponentModel.Container components = null;
    4747
    48     private IPNotation ipNotation = IPNotation.IPv4Decimal;
    49     private IPNotation newIPNotation = IPNotation.IPv4Decimal;
    50     private bool bOverwrite = true;
    51     private bool bPreventLeave = true;
     48    private IPNotation m_ipNotation = IPNotation.IPv4Decimal;
     49    private IPNotation m_newIPNotation = IPNotation.IPv4Decimal;
     50    private bool m_bOverwrite = true;
     51    private bool m_bPreventLeave = true;
    5252    private System.Windows.Forms.ErrorProvider error;
    53     private Regex regexValidNumbers = new Regex("[0-9]");
    54     private ArrayList arlDelimeter = new ArrayList(new char[] { '.' });
     53    private Regex m_regexValidNumbers = new Regex("[0-9]");
     54    private ArrayList m_arlDelimeter = new ArrayList(new char[] { '.' });
    5555
    5656
     
    218218      set {
    219219        try {
    220           if (IPAddressTextBox.ValidateIP(value, this.newIPNotation, this.arlDelimeter))
    221             base.Text = IPAddressTextBox.MakeValidSpaces(value, this.newIPNotation, this.arlDelimeter);
     220          if (IPAddressTextBox.ValidateIP(value, this.m_newIPNotation, this.m_arlDelimeter))
     221            base.Text = IPAddressTextBox.MakeValidSpaces(value, this.m_newIPNotation, this.m_arlDelimeter);
    222222        }
    223223        catch {
     
    237237    public bool OverWriteMode {
    238238      get {
    239         return this.bOverwrite;
     239        return this.m_bOverwrite;
    240240      }
    241241      set {
    242         if (value != this.bOverwrite) {
    243           this.bOverwrite = value;
     242        if (value != this.m_bOverwrite) {
     243          this.m_bOverwrite = value;
    244244          this.OnOverWriteChanged(value);
    245245        }
     
    257257    public bool PreventLeaveAtError {
    258258      get {
    259         return this.bPreventLeave;
     259        return this.m_bPreventLeave;
    260260      }
    261261      set {
    262         if (value != this.bPreventLeave) {
    263           this.bPreventLeave = value;
     262        if (value != this.m_bPreventLeave) {
     263          this.m_bPreventLeave = value;
    264264          this.OnPreventLeaveChanged(value);
    265265        }
     
    277277    public IPNotation Notation {
    278278      get {
    279         return this.ipNotation;
     279        return this.m_ipNotation;
    280280      }
    281281      set {
    282         if (value != this.ipNotation) {
     282        if (value != this.m_ipNotation) {
    283283          try {
    284             this.newIPNotation = value;
    285             this.ChangeNotation(this.ipNotation, this.newIPNotation);
    286             this.ipNotation = this.newIPNotation;
    287             this.OnNotationChanged(this.newIPNotation);
     284            this.m_newIPNotation = value;
     285            this.ChangeNotation(this.m_ipNotation, this.m_newIPNotation);
     286            this.m_ipNotation = this.m_newIPNotation;
     287            this.OnNotationChanged(this.m_newIPNotation);
    288288          }
    289289          catch (Exception LastError) {
     
    346346    private void ChangeNotation(IPNotation arg_oldValue, IPNotation arg_newValue) {
    347347      string sTo = "";
    348       ArrayList arlFrom = new ArrayList(this.Text.Replace(" ", "").Split((char[])this.arlDelimeter.ToArray(typeof(char))));
     348      ArrayList arlFrom = new ArrayList(this.Text.Replace(" ", "").Split((char[])this.m_arlDelimeter.ToArray(typeof(char))));
    349349
    350350      switch (arg_newValue) {
    351351        case IPNotation.IPv4Decimal:
    352           this.regexValidNumbers = new Regex("[0-9]");
    353           this.arlDelimeter = new ArrayList(new char[] { '.' });
     352          this.m_regexValidNumbers = new Regex("[0-9]");
     353          this.m_arlDelimeter = new ArrayList(new char[] { '.' });
    354354          break;
    355355        case IPNotation.IPv4DecimalCIDR:
    356           this.regexValidNumbers = new Regex("[0-9]");
    357           this.arlDelimeter = new ArrayList(new char[] { '.', '/' });
     356          this.m_regexValidNumbers = new Regex("[0-9]");
     357          this.m_arlDelimeter = new ArrayList(new char[] { '.', '/' });
    358358          break;
    359359        case IPNotation.IPv4Binary:
    360           this.regexValidNumbers = new Regex("[01]");
    361           this.arlDelimeter = new ArrayList(new char[] { '.' });
     360          this.m_regexValidNumbers = new Regex("[01]");
     361          this.m_arlDelimeter = new ArrayList(new char[] { '.' });
    362362          break;
    363363        case IPNotation.IPv4BinaryCIDR:
    364           this.regexValidNumbers = new Regex("[01]");
    365           this.arlDelimeter = new ArrayList(new char[] { '.', '/' });
     364          this.m_regexValidNumbers = new Regex("[01]");
     365          this.m_arlDelimeter = new ArrayList(new char[] { '.', '/' });
    366366          break;
    367367        default:
     
    502502          }
    503503          break;
    504 
     504        default:
     505          break;
    505506      }
    506507
     
    544545        if ((char.IsLetterOrDigit(Convert.ToChar(e.KeyValue)) || e.KeyCode == Keys.NumPad0)//Numpad0=96 --> `
    545546          && iPos < this.TextLength) {
    546           if (this.arlDelimeter.Contains(cText[iPos]))
     547          if (this.m_arlDelimeter.Contains(cText[iPos]))
    547548            iPos += 1;
    548549          this.SelectionStart = iPos;
     
    573574      if ((char.IsLetterOrDigit(Convert.ToChar(e.KeyValue)) || e.KeyCode == Keys.NumPad0)//Numpad0=96 --> `
    574575        && iPos < this.TextLength) {
    575         if (this.arlDelimeter.Contains(cText[iPos]))
     576        if (this.m_arlDelimeter.Contains(cText[iPos]))
    576577          iPos += 1;
    577578
     
    590591      //valid input charachters
    591592      if (char.IsControl(e.KeyChar) ||
    592         regexValidNumbers.IsMatch(e.KeyChar.ToString())) {
     593        m_regexValidNumbers.IsMatch(e.KeyChar.ToString())) {
    593594        e.Handled = false;
    594595      } else {
     
    637638    protected override void OnValidating(CancelEventArgs e) {
    638639      //e.Cancel = true;//suppress cancel-signal = not validated
    639       e.Cancel = (!this.ValidateIP() && this.bPreventLeave);
     640      e.Cancel = (!this.ValidateIP() && this.m_bPreventLeave);
    640641      base.OnValidating(e);
    641642    }
     
    729730    public string GetPureIPAddress() {
    730731      string s = "";
    731       ArrayList arlIP = new ArrayList(this.Text.Replace(" ", "").Split((char[])this.arlDelimeter.ToArray(typeof(char))));
     732      ArrayList arlIP = new ArrayList(this.Text.Replace(" ", "").Split((char[])this.m_arlDelimeter.ToArray(typeof(char))));
    732733      for (int i = 0; i < arlIP.Count; i++) {
    733734        while (arlIP[i].ToString().StartsWith("0"))
    734735          arlIP[i] = arlIP[i].ToString().Substring(1);
    735736      }
    736       s = IPAddressTextBox.MakeIP((string[])arlIP.ToArray(typeof(string)), this.ipNotation);
     737      s = IPAddressTextBox.MakeIP((string[])arlIP.ToArray(typeof(string)), this.m_ipNotation);
    737738      return s;
    738739    }
     
    923924    /// <returns>true/false valid/not</returns>
    924925    private bool ValidateIP() {
    925       if (IPAddressTextBox.ValidateIP(this.Text, this.newIPNotation, this.arlDelimeter))
     926      if (IPAddressTextBox.ValidateIP(this.Text, this.m_newIPNotation, this.m_arlDelimeter))
    926927        return true;
    927928      else
Note: See TracChangeset for help on using the changeset viewer.