private void MenuItem_Click_Traded(object sender, RoutedEventArgs e) { var title = WPFUtility.GetLocalizedString("TRADED", LocalizationInfo.ResourceFile, LocalizationInfo.AssemblyName); var executionWin = new ExecutionControl(executionWindow.PersistanceId, Guid.NewGuid().ToString(), MessageHandlerContainer.DefaultInstance.Get<TraderExHandler>()); executionWin.FilterSettingsWin.Title += "(" + title + ")"; executionWin.FilterSettingsWin.FilterTabTitle = title; executionWin.FilterByStatus(new List<OrderStatus> { OrderStatus.ALL_TRADED, OrderStatus.PARTIAL_TRADED }); executionPane.AddContent(executionWin).Title = title; executionWin.Save(); }
private void MenuItem_Click_Execution(object sender, RoutedEventArgs e) { //executionPane.AddContent(new ExecutionControl(Guid.NewGuid().ToString())).Title = WPFUtility.GetLocalizedString("AllExecution", LocalizationInfo.ResourceFile, LocalizationInfo.AssemblyName); var title = WPFUtility.GetLocalizedString("AllExecution", LocalizationInfo.ResourceFile, LocalizationInfo.AssemblyName); var executionWin = new ExecutionControl(executionWindow.PersistanceId, Guid.NewGuid().ToString(), MessageHandlerContainer.DefaultInstance.Get<TraderExHandler>()); executionWin.FilterSettingsWin.Title += "(" + title + ")"; executionWin.FilterSettingsWin.FilterTabTitle = title; executionPane.AddContent(executionWin).Title = title; executionWin.Save(); }
private void MenuItem_Click_ShowAllExecution(object sender, RoutedEventArgs e) { if (AnchorablePane != null) { var title = WPFUtility.GetLocalizedString("AllExecution", LocalizationInfo.ResourceFile, LocalizationInfo.AssemblyName); var executionControl = new ExecutionControl(PersistanceId, Guid.NewGuid().ToString(), TradeHandler); AnchorablePane.AddContent(executionControl).Title = title; executionControl.FilterSettingsWin.FilterTabTitle = title; executionControl.FilterSettingsWin.Save(); } }
public void ReloadData() { Initialize(); //MessageHandlerContainer.DefaultInstance.Get<TraderExHandler>().OrderVMCollection.Clear(); //MessageHandlerContainer.DefaultInstance.Get<TraderExHandler>().QueryOrder(); LayoutAnchorable defaultTab = AnchorablePane.Children.FirstOrDefault(pane => ((ExecutionControl)pane.Content).FilterSettingsWin.FilterId == DEFAULT_ID); AnchorablePane.Children.Clear(); if (defaultTab != null) { AnchorablePane.Children.Add(defaultTab); } var filtersettings = ClientDbContext.GetFilterSettings(TradeHandler.MessageWrapper.User.Id, PersistanceId); //var userId = MessageHandlerContainer.DefaultInstance.Get<TraderExHandler>().MessageWrapper.User.Id; var userId = TradeHandler.MessageWrapper.User.Id; bool found = false; foreach (var fs in filtersettings) { var executionctrl = new ExecutionControl(PersistanceId, fs.Id, TradeHandler, fs.Title, fs.Exchange, fs.Underlying, fs.Contract); AnchorablePane.AddContent(executionctrl).Title = fs.Title; if (fs.Id == DEFAULT_ID) { found = true; } var statuses = ClientDbContext.GetOrderStatus(userId, fs.Id); executionctrl.FilterByStatus(statuses.Select(c => (OrderStatus)c)); if (statuses.Contains((int)OrderStatus.OPENED)) { var titleopen = WPFUtility.GetLocalizedString("Opened", LocalizationInfo.ResourceFile, LocalizationInfo.AssemblyName); executionctrl.FilterSettingsWin.Title += " " + titleopen + " "; } else if ((statuses.Contains((int)OrderStatus.ALL_TRADED)) || (statuses.Contains((int)OrderStatus.PARTIAL_TRADING))) { var titletraded = WPFUtility.GetLocalizedString("TRADED", LocalizationInfo.ResourceFile, LocalizationInfo.AssemblyName); executionctrl.FilterSettingsWin.Title += " " + titletraded + " "; } } if (found) { AnchorablePane.Children.Remove(defaultTab); } }