Changeset 1529


Ignore:
Timestamp:
May 29, 2010, 4:06:15 PM (12 years ago)
Author:
Sven Rech
Message:

quadratic sieve fixes

Location:
trunk/CrypPlugins/QuadraticSieve
Files:
2 edited

Legend:

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

    r1525 r1529  
    5050
    5151        private readonly string directoryName;
    52         private QuadraticSieveSettings settings = new QuadraticSieveSettings();
     52        private QuadraticSieveSettings settings;
    5353        private BigInteger inputNumber;
    5454        private BigInteger[] outputFactors;
     
    9191        public QuadraticSieve()
    9292        {
     93            Settings = new QuadraticSieveSettings();
     94
    9395            directoryName = Path.Combine(DirectoryHelper.DirectoryLocalTemp, "msieve");
    9496            if (!Directory.Exists(directoryName)) Directory.CreateDirectory(directoryName);
     
    100102            quadraticSieveQuickWatchPresentation.Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    101103            {
     104                quadraticSieveQuickWatchPresentation.peer2peerExpander.Visibility = settings.UsePeer2Peer ? Visibility.Visible : Visibility.Collapsed;
    102105                quadraticSieveQuickWatchPresentation.timeLeft.Text = "?";
    103106                quadraticSieveQuickWatchPresentation.endTime.Text = "?";
     
    113116        {
    114117            get { return this.settings; }
    115             set { this.settings = (QuadraticSieveSettings)value; }
    116         }           
     118            set
     119            {
     120                this.settings = (QuadraticSieveSettings)value;
     121                this.settings.PropertyChanged += new PropertyChangedEventHandler(settings_PropertyChanged);
     122            }
     123        }
     124
     125        private void settings_PropertyChanged(object sender, PropertyChangedEventArgs e)
     126        {
     127            if (e.PropertyName == "UsePeer2Peer")
     128            {
     129                if (quadraticSieveQuickWatchPresentation != null)
     130                {
     131                    quadraticSieveQuickWatchPresentation.Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
     132                    {
     133                        quadraticSieveQuickWatchPresentation.peer2peerExpander.Visibility = settings.UsePeer2Peer ? Visibility.Visible : Visibility.Collapsed;
     134                    }, null);
     135                }
     136            }
     137        }
    117138
    118139        /// <summary>
  • trunk/CrypPlugins/QuadraticSieve/QuadraticSieveSettings.cs

    r1522 r1529  
    136136        private void checkAndSetVisibility()
    137137        {
     138            if (TaskPaneAttributeChanged == null)
     139                return;
     140
    138141            if (usePeer2Peer)
    139142            {
Note: See TracChangeset for help on using the changeset viewer.