コード例 #1
0
		private void ExecutedOpenPaneCommand(object sender, ExecutedRoutedEventArgs e)
		{
			IPane pane = null;

			switch (e.Parameter.ToString().ToLowerInvariant())
			{
				case "trade":
					pane = new TradesPane { SelectedSecurity = SelectedSecurity };
					break;

				case "depth":
					pane = new DepthPane { SelectedSecurity = SelectedSecurity };
					break;

				case "candle":
					pane = new CandlesPane { SelectedSecurity = SelectedSecurity };
					break;

				case "orderlog":
					pane = new OrderLogPane { SelectedSecurity = SelectedSecurity };
					break;

				case "level1":
					pane = new Level1Pane { SelectedSecurity = SelectedSecurity };
					break;

				case "news":
					pane = new NewsPane();
					break;

				case "task":
					var task = (IHydraTask)(NavigationBar.SelectedPane == SourcesPane ? CurrentSources.SelectedItem : CurrentConverters.SelectedItem);

					if (task != null)
					{
						var taskWnd = DockSite.DocumentWindows.FirstOrDefault(w =>
						{
							var pw = w as PaneWindow;

							if (pw == null)
								return false;

							var taskPane = pw.Pane as TaskPane;

							if (taskPane == null)
								return false;

							return taskPane.Task == task;
						});

						if (taskWnd != null)
							taskWnd.Activate();
						else
							pane = new TaskPane { Task = task };
					}

					break;

				case "execution":
					pane = new ExecutionsPane { SelectedSecurity = SelectedSecurity };
					break;
			}

			if (pane == null)
				return;

			ShowPane(pane);
		}
コード例 #2
0
		private void ExecutedOpenPaneCommand(object sender, ExecutedRoutedEventArgs e)
		{
			IPane pane = null;

			switch (e.Parameter.ToString().ToLowerInvariant())
			{
				case "trade":
					pane = new TradesPane { SelectedSecurity = SelectedSecurity };
					break;

				case "depth":
					pane = new DepthPane { SelectedSecurity = SelectedSecurity };
					break;

				case "candle":
					pane = new CandlesPane { SelectedSecurity = SelectedSecurity };
					break;

				case "orderlog":
					pane = new OrderLogPane { SelectedSecurity = SelectedSecurity };
					break;

				case "level1":
					pane = new Level1Pane { SelectedSecurity = SelectedSecurity };
					break;

				case "news":
					pane = new NewsPane();
					break;

				case "task":
					var task = (IHydraTask)(NavigationBar.SelectedPane == SourcesPane ? CurrentSources.SelectedItem : CurrentTools.SelectedItem);

					if (task != null)
						pane = EnsureTaskPane(task);

					break;

				case "transaction":
					pane = new ExecutionsPane { SelectedSecurity = SelectedSecurity };
					break;

				case "security":
					var wnd = DockSite.DocumentWindows.FirstOrDefault(w =>
					{
						var paneWnd = w as PaneWindow;

						if (paneWnd == null)
							return false;

						return paneWnd.Pane is AllSecuritiesPane;
					});

					if (wnd != null)
						wnd.Activate();
					else
						pane = new AllSecuritiesPane();

					break;
			}

			if (pane == null)
				return;

			ShowPane(pane);
		}