/// <summary> /// Configure connection using <see cref="ConnectorWindow"/>. /// </summary> /// <param name="adapter">The connection.</param> /// <param name="owner">UI thread owner.</param> /// <param name="autoConnect">Auto connect.</param> /// <returns><see langword="true"/> if the specified connection was configured, otherwise, <see langword="false"/>.</returns> public static bool Configure(this BasketMessageAdapter adapter, Window owner, ref bool autoConnect) { if (adapter == null) { throw new ArgumentNullException(nameof(adapter)); } if (owner == null) { throw new ArgumentNullException(nameof(owner)); } var wnd = new ConnectorWindow(); foreach (var a in Adapters) { AddConnectorInfo(wnd, a); } wnd.Adapter = (BasketMessageAdapter)adapter.Clone(); wnd.AutoConnect = autoConnect; if (!wnd.ShowModal(owner)) { return(false); } adapter.Load(wnd.Adapter.Save()); autoConnect = wnd.AutoConnect; return(true); }
/// <summary> /// Configure connection using <see cref="ConnectorWindow"/>. /// </summary> /// <param name="adapter">The connection.</param> /// <param name="owner">UI thread owner.</param> /// <param name="autoConnect">Auto connect.</param> /// <returns><see langword="true"/> if the specified connection was configured, otherwise, <see langword="false"/>.</returns> public static bool Configure(this BasketMessageAdapter adapter, Window owner, ref bool autoConnect) { if (adapter == null) { throw new ArgumentNullException(nameof(adapter)); } if (owner == null) { throw new ArgumentNullException(nameof(owner)); } var wnd = new ConnectorWindow(); wnd.ConnectorsInfo.AddRange(_customConnections); AddConnectorInfo <AlfaDirectMessageAdapter>(wnd); AddConnectorInfo <BarChartMessageAdapter>(wnd); AddConnectorInfo <BitStampMessageAdapter>(wnd); AddConnectorInfo <BlackwoodMessageAdapter>(wnd); AddConnectorInfo <BtceMessageAdapter>(wnd); AddConnectorInfo <CqgComMessageAdapter>(wnd); AddConnectorInfo <CqgContinuumMessageAdapter>(wnd); AddConnectorInfo <ETradeMessageAdapter>(wnd); AddConnectorInfo <FixMessageAdapter>(wnd); AddConnectorInfo <InteractiveBrokersMessageAdapter>(wnd); AddConnectorInfo <IQFeedMarketDataMessageAdapter>(wnd); AddConnectorInfo <ItchMessageAdapter>(wnd); AddConnectorInfo <LmaxMessageAdapter>(wnd); AddConnectorInfo <MicexMessageAdapter>(wnd); AddConnectorInfo <OandaMessageAdapter>(wnd); AddConnectorInfo <OpenECryMessageAdapter>(wnd); AddConnectorInfo <PlazaMessageAdapter>(wnd); AddConnectorInfo <LuaFixTransactionMessageAdapter>(wnd); AddConnectorInfo <LuaFixMarketDataMessageAdapter>(wnd); AddConnectorInfo <QuikTrans2QuikAdapter>(wnd); AddConnectorInfo <QuikDdeAdapter>(wnd); AddConnectorInfo <RithmicMessageAdapter>(wnd); AddConnectorInfo <RssMarketDataMessageAdapter>(wnd); AddConnectorInfo <SmartComMessageAdapter>(wnd); AddConnectorInfo <SterlingMessageAdapter>(wnd); AddConnectorInfo <TransaqMessageAdapter>(wnd); AddConnectorInfo <TwimeMessageAdapter>(wnd); AddConnectorInfo <SpbExMessageAdapter>(wnd); wnd.Adapter = (BasketMessageAdapter)adapter.Clone(); wnd.AutoConnect = autoConnect; if (!wnd.ShowModal(owner)) { return(false); } adapter.Load(wnd.Adapter.Save()); autoConnect = wnd.AutoConnect; return(true); }
/// <summary> /// Configure connection using <see cref="ConnectorWindow"/>. /// </summary> /// <param name="adapter">The connection.</param> /// <param name="owner">UI thread owner.</param> /// <param name="autoConnect">Auto connect.</param> /// <returns><see langword="true"/> if the specified connection was configured, otherwise, <see langword="false"/>.</returns> public static bool Configure(this BasketMessageAdapter adapter, Window owner, ref bool autoConnect) { if (adapter == null) { throw new ArgumentNullException(nameof(adapter)); } if (owner == null) { throw new ArgumentNullException(nameof(owner)); } var wnd = new ConnectorWindow(); wnd.ConnectorsInfo.AddRange(_customConnections); AddConnectorInfo(wnd, typeof(AlfaDirectMessageAdapter)); AddConnectorInfo(wnd, typeof(BarChartMessageAdapter)); AddConnectorInfo(wnd, typeof(BitStampMessageAdapter)); AddConnectorInfo(wnd, typeof(BlackwoodMessageAdapter)); AddConnectorInfo(wnd, typeof(BtceMessageAdapter)); AddConnectorInfo(wnd, typeof(CQGMessageAdapter)); AddConnectorInfo(wnd, typeof(ETradeMessageAdapter)); AddConnectorInfo(wnd, typeof(FixMessageAdapter)); AddConnectorInfo(wnd, typeof(InteractiveBrokersMessageAdapter)); AddConnectorInfo(wnd, typeof(IQFeedMarketDataMessageAdapter)); AddConnectorInfo(wnd, typeof(ItchMessageAdapter)); AddConnectorInfo(wnd, typeof(LmaxMessageAdapter)); AddConnectorInfo(wnd, typeof(MicexMessageAdapter)); AddConnectorInfo(wnd, typeof(OandaMessageAdapter)); AddConnectorInfo(wnd, typeof(OpenECryMessageAdapter)); AddConnectorInfo(wnd, typeof(PlazaMessageAdapter)); AddConnectorInfo(wnd, typeof(LuaFixTransactionMessageAdapter)); AddConnectorInfo(wnd, typeof(LuaFixMarketDataMessageAdapter)); AddConnectorInfo(wnd, typeof(QuikTrans2QuikAdapter)); AddConnectorInfo(wnd, typeof(QuikDdeAdapter)); AddConnectorInfo(wnd, typeof(RithmicMessageAdapter)); AddConnectorInfo(wnd, typeof(RssMarketDataMessageAdapter)); AddConnectorInfo(wnd, typeof(SmartComMessageAdapter)); AddConnectorInfo(wnd, typeof(SterlingMessageAdapter)); AddConnectorInfo(wnd, typeof(TransaqMessageAdapter)); AddConnectorInfo(wnd, typeof(TwimeMessageAdapter)); wnd.Adapter = (BasketMessageAdapter)adapter.Clone(); wnd.AutoConnect = autoConnect; if (!wnd.ShowModal(owner)) { return(false); } adapter.Load(wnd.Adapter.Save()); autoConnect = wnd.AutoConnect; return(true); }