Ignore:
Timestamp:
Feb 11, 2010, 8:54:10 PM (12 years ago)
Author:
arnold
Message:

1) Killed the LayoutUpdated-Event in WPF because it consumed 60-90% of the cpu load...
2) Changes Threading.Timer to Timers.Timer in P2PSubscriberBase.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/PeerToPeerPublisher/P2PPublisher.cs

    r1137 r1139  
    5454        private void settings_PropertyChanged(object sender, PropertyChangedEventArgs e)
    5555        {
    56             if (this.p2pPublisher == null || !this.p2pPublisher.Started)
     56            if (this.p2pControl == null || this.p2pPublisher == null)
    5757                return;
    58 
    5958
    6059            // storing settings for subscribers in the DHT, so they can load them there
     
    7574            if (e.PropertyName == "BtnUnregister")
    7675            {
    77                 this.p2pPublisher.Stop(PubSubMessageType.Unregister);
    78                 GuiLogMessage("Unregister button pressed, Publisher has stopped!", NotificationLevel.Info);
     76                if (this.p2pPublisher.Started)
     77                {
     78                    this.p2pPublisher.Stop(PubSubMessageType.Unregister);
     79                    GuiLogMessage("Unregister button pressed, Publisher has stopped!", NotificationLevel.Info);
     80                }
    7981            }
    8082            if (e.PropertyName == "BtnRegister")
    8183            {
    82                 this.p2pPublisher.Start(this.settings.TopicName, (long)this.settings.SendAliveMessageInterval);
    83                 GuiLogMessage("Register button pressed, Publisher has been started!", NotificationLevel.Info);
     84                if (!this.p2pPublisher.Started)
     85                {
     86                    this.p2pPublisher.Start(this.settings.TopicName, (long)this.settings.SendAliveMessageInterval);
     87                    GuiLogMessage("Register button pressed, Publisher has been started!", NotificationLevel.Info);
     88                }
    8489            }
    8590            if (e.PropertyName == "BtnSolutionFound")
    8691            {
    87                 this.p2pPublisher.Stop(PubSubMessageType.Solution);
    88                 GuiLogMessage("TEST: Emulate Solution-Found-message", NotificationLevel.Info);
     92                if (this.p2pPublisher.Started)
     93                {
     94                    this.p2pPublisher.Stop(PubSubMessageType.Solution);
     95                    GuiLogMessage("TEST: Emulate Solution-Found-message", NotificationLevel.Info);
     96                }
    8997            }
    9098            if (e.PropertyName == "BtnSerDeser")
Note: See TracChangeset for help on using the changeset viewer.