Changeset 2371


Ignore:
Timestamp:
Jan 18, 2011, 2:15:02 PM (11 years ago)
Author:
kopal
Message:

fix threading bug in p2peditor (automatic connect is now possible)

Location:
trunk/CrypPlugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/P2PEditor/GUI/Controls/ConnectView.xaml.cs

    r2358 r2371  
    3636                if (newState)
    3737                {
    38                     ((P2PEditorPresentation)P2PEditor.Presentation).UpdateConnectionState();
    39 
    40                     Storyboard storyboard = (Storyboard)FindResource("AnimateBigWorldIcon");
    41                     storyboard.Begin();   
     38                   
     39                    this.Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
     40                    {
     41                        ((P2PEditorPresentation)P2PEditor.Presentation).UpdateConnectionState();
     42                        Storyboard storyboard = (Storyboard)FindResource("AnimateBigWorldIcon");
     43                        storyboard.Begin();
     44                    }
     45                    , null);
    4246                }
    4347                else
    4448                {
    45                     ((P2PEditorPresentation)P2PEditor.Presentation).UpdateConnectionState();
    46 
    47                     Storyboard storyboard = (Storyboard)FindResource("AnimateBigWorldIcon");
    48                     storyboard.Stop();   
     49                    this.Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
     50                    {
     51                        ((P2PEditorPresentation)P2PEditor.Presentation).UpdateConnectionState();                   
     52                        Storyboard storyboard = (Storyboard)FindResource("AnimateBigWorldIcon");
     53                        storyboard.Stop();
     54                    }
     55                    , null);         
    4956                }
    5057            });
     
    105112        private void P2PUserControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
    106113        {
    107             this.Username.Text = ((P2PEditorSettings)((P2PEditor)GetValue(P2PEditorProperty)).Settings).PeerName;
    108             this.Worldname.Text = ((P2PEditorSettings)((P2PEditor)GetValue(P2PEditorProperty)).Settings).WorldName;
    109             this.Password.Password = ((P2PEditorSettings)((P2PEditor)GetValue(P2PEditorProperty)).Settings).Password;
    110             if (this.IsP2PConnecting)
     114            if (this.Visibility == System.Windows.Visibility.Visible)
    111115            {
    112                 Storyboard storyboard = (Storyboard)FindResource("AnimateBigWorldIcon");
    113                 storyboard.Begin();
    114             }
    115             else
    116             {
    117                 Storyboard storyboard = (Storyboard)FindResource("AnimateBigWorldIcon");
    118                 storyboard.Stop();
     116                this.Username.Text = ((P2PEditorSettings)((P2PEditor)GetValue(P2PEditorProperty)).Settings).PeerName;
     117                this.Worldname.Text = ((P2PEditorSettings)((P2PEditor)GetValue(P2PEditorProperty)).Settings).WorldName;
     118                this.Password.Password = ((P2PEditorSettings)((P2PEditor)GetValue(P2PEditorProperty)).Settings).Password;
     119                if (this.IsP2PConnecting)
     120                {
     121                    Storyboard storyboard = (Storyboard)FindResource("AnimateBigWorldIcon");
     122                    storyboard.Begin();
     123                }
     124                else
     125                {
     126                    Storyboard storyboard = (Storyboard)FindResource("AnimateBigWorldIcon");
     127                    storyboard.Stop();
     128                }
    119129            }
    120130        }
  • trunk/CrypPlugins/WorkspaceManager/Execution/ExecutionEngine.cs

    r2152 r2371  
    470470            {       
    471471                this.PluginModel.WorkspaceModel.WorkspaceManagerEditor.GuiLogMessage("An error occured while executing  \"" + PluginModel.Name + "\": " + ex.Message, NotificationLevel.Error);
     472                this.PluginModel.WorkspaceModel.WorkspaceManagerEditor.GuiLogMessage(ex.StackTrace, NotificationLevel.Error);               
    472473                this.PluginModel.State = PluginModelState.Error;
    473474                this.PluginModel.GuiNeedsUpdate = true;
Note: See TracChangeset for help on using the changeset viewer.