Changeset 8116


Ignore:
Timestamp:
May 16, 2019, 5:49:35 PM (3 years ago)
Author:
kopal
Message:

HomophonicAnalyzer:

  • user changes of homophones now also trigger an output of the revealed plaintext
  • small text change (plaintext --> revealed plaintext)
Location:
trunk/CrypPlugins/HomophonicSubstitutionAnalyzer
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/HomophonicSubstitutionAnalyzer/HillClimber.cs

    r8107 r8116  
    328328
    329329    /// <summary>
     330    /// EventArgs for a change of the user. This means, the user
     331    /// changed the plaintext mapping of a homophone
     332    /// </summary>
     333    public class UserChangedTextEventArgs : NewBestValueEventArgs
     334    {
     335    }
     336
     337    /// <summary>
    330338    /// A mapping of a plainletter to a ciphertext letter
    331339    /// </summary>
  • trunk/CrypPlugins/HomophonicSubstitutionAnalyzer/HomophoneSubstitutionAnalyzerPresentation.xaml.cs

    r8107 r8116  
    5858        public event EventHandler<ProgressChangedEventArgs> Progress;
    5959        public event EventHandler<NewBestValueEventArgs> NewBestValue;
     60        public event EventHandler<UserChangedTextEventArgs> UserChangedText;
    6061
    6162        private ObservableCollection<ResultEntry> BestList = new ObservableCollection<ResultEntry>();
     
    521522        /// </summary>
    522523        /// <param name="sender"></param>
    523         /// <param name="e"></param>
     524        /// <param name="mouseButtonEventArgs"></param>
    524525        private void LabelOnMouseLeftButtonDown(object sender, MouseButtonEventArgs mouseButtonEventArgs)
    525526        {
     
    545546        /// </summary>
    546547        /// <param name="sender"></param>
    547         /// <param name="e"></param>
     548        /// <param name="mouseButtonEventArgs"></param>
    548549        private void LabelOnMouseRightButtonDown(object sender, MouseButtonEventArgs mouseButtonEventArgs)
    549550        {
     
    630631                }
    631632                MarkLockedHomophones();
     633                if (UserChangedText != null)
     634                {
     635                    UserChangedTextEventArgs args = new UserChangedTextEventArgs() { Plaintext = plaintext };
     636                    UserChangedText.Invoke(this, args);
     637                }
    632638            }
    633639        }
  • trunk/CrypPlugins/HomophonicSubstitutionAnalyzer/HomophonicSubstitutionAnalyzer.cs

    r8109 r8116  
    4141        {
    4242            _presentation.NewBestValue += PresentationOnNewBestValue;
     43            _presentation.UserChangedText += PresentationOnUserChangedText;
    4344            _presentation.Progress += PresentationOnProgress;
    4445        }
    4546
    4647        #region Data Properties
    47        
     48
    4849        /// </summary>
    4950        [PropertyInfo(Direction.InputData, "CiphertextCaption", "CiphertextTooltip", true)]
     
    214215        /// </summary>
    215216        /// <param name="sender"></param>
    216         /// <param name="e"></param>
     217        /// <param name="newBestValueEventArgs"></param>
    217218        private void PresentationOnNewBestValue(object sender, NewBestValueEventArgs newBestValueEventArgs)
    218219        {
     
    228229        }
    229230
    230 
     231        /// <summary>
     232        /// User changed a homophone plaintext mapping
     233        /// </summary>
     234        /// <param name="sender"></param>
     235        /// <param name="userChangedTextEventArgs"></param>
     236        private void PresentationOnUserChangedText(object sender, UserChangedTextEventArgs userChangedTextEventArgs)
     237        {
     238            Plaintext = userChangedTextEventArgs.Plaintext;
     239            OnPropertyChanged("Plaintext");
     240        }
    231241
    232242        /// <summary>
  • trunk/CrypPlugins/HomophonicSubstitutionAnalyzer/Properties/Resources.Designer.cs

    r8108 r8116  
    422422       
    423423        /// <summary>
    424         ///   Sucht eine lokalisierte Zeichenfolge, die Plaintext: ähnelt.
     424        ///   Sucht eine lokalisierte Zeichenfolge, die Revealed Plaintext: ähnelt.
    425425        /// </summary>
    426426        internal static string Plaintext {
  • trunk/CrypPlugins/HomophonicSubstitutionAnalyzer/Properties/Resources.resx

    r8108 r8116  
    230230  </data>
    231231  <data name="Plaintext" xml:space="preserve">
    232     <value>Plaintext:</value>
     232    <value>Revealed Plaintext:</value>
    233233  </data>
    234234  <data name="PlaintextMapping" xml:space="preserve">
Note: See TracChangeset for help on using the changeset viewer.