Ignore:
Timestamp:
Oct 7, 2009, 4:49:16 PM (12 years ago)
Author:
Sven Rech
Message:

some KeySearcher updates (but still doesn't really work)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/KeySearcher.cs

    r676 r677  
    147147        public bool nextKey()
    148148        {
    149             int wildcardCount = 0;
    150             bool overflow = ((Wildcard)wildcardList[0]).succ();
    151             wildcardCount = 1;
    152             while (overflow && (wildcardCount < wildcardList.Count))
    153                 overflow = ((Wildcard)wildcardList[wildcardCount++]).succ();
     149            int wildcardCount = wildcardList.Count-1;
     150            bool overflow = ((Wildcard)wildcardList[wildcardCount]).succ();
     151            wildcardCount--;
     152            while (overflow && (wildcardCount >= 0))
     153                overflow = ((Wildcard)wildcardList[wildcardCount--]).succ();
    154154            return !overflow;
    155155        }
     
    272272        #endregion
    273273
     274        private void keyPatternChanged()
     275        {
     276            settings.Pattern = new KeyPattern(controlMaster.getKeyPattern());
     277        }
     278
    274279        #region IControlEncryption Members
    275280
     
    281286            set
    282287            {
     288                if (controlMaster != null)
     289                    controlMaster.keyPatternChanged -= keyPatternChanged;
    283290                if (value != null)
    284291                {
    285292                    settings.Pattern = new KeyPattern(value.getKeyPattern());
     293                    value.keyPatternChanged += keyPatternChanged;
    286294                    controlMaster = value;
    287295                    OnPropertyChanged("ControlMaster");
    288296                }
     297                else
     298                    controlMaster = null;
    289299            }
    290300        }
Note: See TracChangeset for help on using the changeset viewer.