Skip to content

Commit

Permalink
Msg selection in flow diagram. #365
Browse files Browse the repository at this point in the history
  • Loading branch information
distantcam committed Oct 27, 2014
1 parent 5d2dd0c commit bd55c02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
11 changes: 4 additions & 7 deletions src/ServiceInsight.Desktop/MessageFlow/MessageFlowView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,8 @@ public void UpdateConnections()

void MessageRectangle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.ClickCount == 2)
{
var node = ((System.Windows.FrameworkElement)sender).DataContext as MessageNode;
ShowMessage(sender, new SearchMessageEventArgs(node));
}
var node = ((System.Windows.FrameworkElement)sender).DataContext as MessageNode;
ShowMessage(sender, new SearchMessageEventArgs(node));
}

void Root_KeyUp(object sender, KeyEventArgs e)
Expand All @@ -66,7 +63,7 @@ void Root_KeyUp(object sender, KeyEventArgs e)
{
Surface.Zoom -= 0.1;
}
else if (e.Key == Key.D0 || e.Key == Key.NumPad0)
else if (e.Key == Key.D0 || e.Key == Key.NumPad0)
{
Surface.Zoom = 1;
}
Expand All @@ -77,4 +74,4 @@ void Root_KeyUp(object sender, KeyEventArgs e)
}
}
}
}
}
12 changes: 5 additions & 7 deletions src/ServiceInsight.Desktop/MessageFlow/MessageFlowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ protected override void OnViewAttached(object view, object context)

void OnShowMessage(object sender, SearchMessageEventArgs e)
{
SearchByMessageId(e.MessageNode.Message);
var message = e.MessageNode.Message;

searchBar.Search(performSearch: false, searchQuery: message.MessageId);
eventAggregator.Publish(new RequestSelectingEndpoint(message.ReceivingEndpoint));
eventAggregator.Publish(new SelectedMessageChanged(message));
}

protected override void OnActivate()
Expand Down Expand Up @@ -134,12 +138,6 @@ public void ToggleEndpointData()
public ICommand SearchByMessageIDCommand { get; private set; }
public ICommand RetryMessageCommand { get; private set; }

void SearchByMessageId(StoredMessage message, bool performSearch = false)
{
searchBar.Search(performSearch: performSearch, searchQuery: message.MessageId);
eventAggregator.Publish(new RequestSelectingEndpoint(message.ReceivingEndpoint));
}

public void Handle(SelectedMessageChanged @event)
{
if (loadingConversation) return;
Expand Down

0 comments on commit bd55c02

Please sign in to comment.