Ignore:
Timestamp:
Sep 21, 2009, 6:12:58 PM (12 years ago)
Author:
Arno Wacker
Message:

Scytale now shows progress.

File:
1 edited

Legend:

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

    r547 r550  
    1515
    1616        public event PropertyChangedEventHandler PropertyChanged;
     17        public event PluginProgressChangedEventHandler OnPluginProgressChanged;
    1718#pragma warning disable 67
    1819        public event StatusChangedEventHandler OnPluginStatusChanged;
    19         public event GuiLogNotificationEventHandler OnGuiLogNotificationOccured;
    20         public event PluginProgressChangedEventHandler OnPluginProgressChanged;
     20        public event GuiLogNotificationEventHandler OnGuiLogNotificationOccured;       
    2121#pragma warning restore
    2222
     
    106106                if (Position >= inputString.Length)
    107107                    Position -= inputString.Length - 1;
     108
     109                //show the progress
     110                if (OnPluginProgressChanged != null)
     111                {
     112                    OnPluginProgressChanged(this, new PluginProgressEventArgs(i, inputString.Length - 2));
     113                }
     114
    108115            }
    109116            outputString = outputString.Replace('_', ' ').Trim();
     
    114121            inputString = inputString.Replace(' ', '_');
    115122            int Position = 0;
    116             for (int i = 0; i < settings.StickSize * CharsPerRow; i++)
     123            int totalChars = settings.StickSize * CharsPerRow;
     124            for (int i = 0; i < totalChars; i++)
    117125            {
    118126                if (Position > inputString.Length - 1)
     
    125133                if (Position >= settings.StickSize * CharsPerRow)
    126134                    Position -= settings.StickSize * CharsPerRow - 1;
     135
     136                //show the progress
     137                if (OnPluginProgressChanged != null)
     138                {
     139                    OnPluginProgressChanged(this, new PluginProgressEventArgs(i, totalChars - 1));
     140                }
    127141            }
    128142        }
Note: See TracChangeset for help on using the changeset viewer.