當前位置: 首頁>>代碼示例>>C#>>正文


C# OrderWindow.ShowModal方法代碼示例

本文整理匯總了C#中StockSharp.Xaml.OrderWindow.ShowModal方法的典型用法代碼示例。如果您正苦於以下問題:C# OrderWindow.ShowModal方法的具體用法?C# OrderWindow.ShowModal怎麽用?C# OrderWindow.ShowModal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在StockSharp.Xaml.OrderWindow的用法示例。


在下文中一共展示了OrderWindow.ShowModal方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: NewOrderClick

		private void NewOrderClick(object sender, RoutedEventArgs e)
		{
			var newOrder = new OrderWindow
			{
				Order = new Order { Security = SecurityPicker.SelectedSecurity },
				Connector = MainWindow.Instance.Trader,
			};

			if (newOrder.ShowModal(this))
				MainWindow.Instance.Trader.RegisterOrder(newOrder.Order);
		}
開發者ID:hbwjz,項目名稱:StockSharp,代碼行數:11,代碼來源:SecuritiesWindow.xaml.cs

示例2: NewOrderClick

		private void NewOrderClick(object sender, RoutedEventArgs e)
		{
			var newOrder = new OrderWindow
			{
				Order = new Order { Security = SecurityPicker.SelectedSecurity },
				SecurityProvider = MainWindow.Instance.Trader,
				MarketDataProvider = MainWindow.Instance.Trader,
				Portfolios = new PortfolioDataSource(MainWindow.Instance.Trader),
			};

			if (newOrder.ShowModal(this))
				MainWindow.Instance.Trader.RegisterOrder(newOrder.Order);
		}
開發者ID:kknet,項目名稱:StockSharp,代碼行數:13,代碼來源:SecuritiesWindow.xaml.cs

示例3: OrderGrid_OnOrderReRegistering

		private void OrderGrid_OnOrderReRegistering(Order order)
		{
			var window = new OrderWindow
			{
				Title = LocalizedStrings.Str2976Params.Put(order.TransactionId),
				Connector = MainWindow.Instance.Trader,
				Order = order.ReRegisterClone(newVolume: order.Balance),
			};

			if (window.ShowModal(this))
			{
				MainWindow.Instance.Trader.ReRegisterOrder(order, window.Order);
			}
		}
開發者ID:reddream,項目名稱:StockSharp,代碼行數:14,代碼來源:OrdersWindow.xaml.cs

示例4: OrderGrid_OnOrderReRegistering

		private void OrderGrid_OnOrderReRegistering(Order order)
		{
			var window = new OrderWindow
			{
				Title = LocalizedStrings.Str2976Params.Put(order.TransactionId),
				SecurityProvider = MainWindow.Instance.Trader,
				MarketDataProvider = MainWindow.Instance.Trader,
				Portfolios = new PortfolioDataSource(MainWindow.Instance.Trader),
				Order = order.ReRegisterClone(newVolume: order.Balance),
			};

			if (window.ShowModal(this))
			{
				MainWindow.Instance.Trader.ReRegisterOrder(order, window.Order);
			}
		}
開發者ID:kknet,項目名稱:StockSharp,代碼行數:16,代碼來源:StopOrdersWindow.xaml.cs

示例5: OrdersPanel

		/// <summary>
		/// Создать <see cref="OrdersPanel"/>.
		/// </summary>
		public OrdersPanel()
		{
			InitializeComponent();

			Security prevSecurity = null;
			Portfolio prevPortfolio = null;
			var prevType = OrderTypes.Limit;

			Func<OrderTypes, Order> createOrder = type => new Order
			{
				Type = type,
				Security = prevSecurity,
				Portfolio = prevPortfolio,
			};

			OrderGrid.OrderRegistering += () =>
			{
				var wnd = new OrderWindow
				{
					SecurityProvider = ConfigManager.TryGetService<FilterableSecurityProvider>(),
					Order = createOrder(prevType)
				};

				if (!wnd.ShowModal(this))
					return;

				var order = wnd.Order;

				prevType = order.Type;
				prevSecurity = order.Security;
				prevPortfolio = order.Portfolio;

				new RegisterOrderCommand(order).Process(this);
			};
			OrderGrid.OrderReRegistering += order =>
			{
				var window = new OrderWindow
				{
					Title = LocalizedStrings.Str2976Params.Put(order.TransactionId),
					Order = order.ReRegisterClone(newVolume: order.Balance),
				};

				if (window.ShowModal(this))
				{
					new ReRegisterOrderCommand(order, window.Order).Process(this);
				}
			};
			OrderGrid.OrderCanceling += orders => new CancelOrderCommand(orders).Process(this);
			OrderGrid.SelectionChanged += (s, e) => new SelectCommand<Order>(OrderGrid.SelectedOrder, false).Process(this);
			OrderGrid.PropertyChanged += (s, e) => new ControlChangedCommand(this).Process(this);

			GotFocus += (s, e) => new SelectCommand<Order>(OrderGrid.SelectedOrder, false).Process(this);

			var cmdSvc = ConfigManager.GetService<IStudioCommandService>();
			cmdSvc.Register<ResetedCommand>(this, false, cmd => OrderGrid.Orders.Clear());
			cmdSvc.Register<OrderCommand>(this, false, cmd =>
			{
				if (cmd.Action == OrderActions.Registering && cmd.Order.Type != OrderTypes.Conditional)
					OrderGrid.Orders.Add(cmd.Order);
			});
			cmdSvc.Register<ReRegisterOrderCommand>(this, false, cmd => OrderGrid.Orders.Add(cmd.NewOrder));
			cmdSvc.Register<OrderFailCommand>(this, false, cmd =>
			{
				if (cmd.Action == OrderActions.Registering)
					OrderGrid.AddRegistrationFail(cmd.Fail);
			});
			cmdSvc.Register<BindStrategyCommand>(this, false, cmd =>
			{
				prevSecurity = cmd.Source.Security;
				prevPortfolio = cmd.Source.Portfolio;
			});

			WhenLoaded(() => new RequestBindSource(this).SyncProcess(this));
		}
開發者ID:knoppixmeister,項目名稱:StockSharp,代碼行數:77,代碼來源:OrdersPanel.xaml.cs

示例6: OrderGrid_OrderRegistering

		private void OrderGrid_OrderRegistering()
		{
			var newOrder = new OrderWindow
			{
				Order = new Order { Security = _security },
				Connector = _connector,
			};

			if (newOrder.ShowModal(this))
				_connector.RegisterOrder(newOrder.Order);
		}
開發者ID:jackman0925,項目名稱:StockSharp,代碼行數:11,代碼來源:MainWindow.xaml.cs

示例7: NewOrder_OnClick

		private void NewOrder_OnClick(object sender, RoutedEventArgs e)
		{
			var newOrder = new OrderWindow
			{
				Order = new Order { Security = _security },
				Connector = _connector,
			};

			if (newOrder.ShowModal(this))
				_connector.RegisterOrder(newOrder.Order);
		}
開發者ID:reddream,項目名稱:StockSharp,代碼行數:11,代碼來源:MainWindow.xaml.cs

示例8: OrderGrid_OrderRegistering

		private void OrderGrid_OrderRegistering()
		{
			var newOrder = new OrderWindow
			{
				Order = new Order { Security = _security },
				SecurityProvider = _connector,
				MarketDataProvider = _connector,
				Portfolios = new PortfolioDataSource(_connector),
			};

			if (newOrder.ShowModal(this))
				_connector.RegisterOrder(newOrder.Order);
		}
開發者ID:kknet,項目名稱:StockSharp,代碼行數:13,代碼來源:MainWindow.xaml.cs


注:本文中的StockSharp.Xaml.OrderWindow.ShowModal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。