Esempio n. 1
0
        public void Application_Startup(
            object sender,
            StartupEventArgs e,
            ICustomFixStrategy strategy)
        {
            Trace.Listeners.Add(new TextWriterTraceListener("quickfix_executor.log", "logListener"));
            Trace.WriteLine("Application started.");

            // FIX app settings and related
            QuickFix.SessionSettings settings = new QuickFix.SessionSettings(this.ConfigFile);
            strategy.SessionSettings = settings;

            // FIX application setup
            QuickFix.IMessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
            QuickFix.ILogFactory          logFactory   = new QuickFix.FileLogFactory(settings);
            _qfapp = new QFApp(settings, strategy);

            QuickFix.IInitiator initiator = new QuickFix.Transport.SocketInitiator(_qfapp, storeFactory, settings, logFactory);
            _qfapp.Initiator = initiator;

            UIExecutor.MainWindow mainWindow = new UIExecutor.MainWindow();
            mainWindow.DataContext                = new MainWindowViewModel();
            mainWindow.MessageView.DataContext    = new MessageViewModel(_qfapp);
            mainWindow.ConnectionView.DataContext = new ConnectionViewModel(_qfapp);
            mainWindow.TradeView.DataContext      = new TradeViewModel(_qfapp);

            /*
             * // Window creation and context assignment
             * UIDemo.MainWindow mainWindow = new UIDemo.MainWindow();
             * mainWindow.DataContext = new MainWindowViewModel();
             *
             * mainWindow.MessageView.DataContext = new MessageViewModel(_qfapp);
             * mainWindow.ExecutionView.DataContext = new ExecutionViewModel(_qfapp);
             * mainWindow.ConnectionView.DataContext = new ConnectionViewModel(_qfapp);
             * mainWindow.OrderView.DataContext = new OrderViewModel(_qfapp, strategy);
             * mainWindow.NewsSenderView.DataContext = new NewsSenderViewModel(_qfapp);
             */
            // Set the main UI dispatcher
            SmartDispatcher.SetDispatcher(mainWindow.Dispatcher);

            mainWindow.Show();
        }
Esempio n. 2
0
        public void Application_Startup(
            object sender,
            StartupEventArgs e,
            ICustomFixStrategy strategy)
        {
            Trace.Listeners.Add(new TextWriterTraceListener("quickfix_executor.log", "logListener"));
            Trace.WriteLine("Application started.");

            // FIX app settings and related
            QuickFix.SessionSettings settings = new QuickFix.SessionSettings(this.ConfigFile);
            strategy.SessionSettings = settings;

            // FIX application setup
            QuickFix.IMessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
            QuickFix.ILogFactory logFactory = new QuickFix.FileLogFactory(settings);
            _qfapp = new QFApp(settings, strategy);

            QuickFix.IInitiator initiator = new QuickFix.Transport.SocketInitiator(_qfapp, storeFactory, settings, logFactory);
            _qfapp.Initiator = initiator;

            UIExecutor.MainWindow mainWindow = new UIExecutor.MainWindow();
            mainWindow.DataContext = new MainWindowViewModel();
            mainWindow.MessageView.DataContext = new MessageViewModel(_qfapp);
            mainWindow.ConnectionView.DataContext = new ConnectionViewModel(_qfapp);
            mainWindow.TradeView.DataContext = new TradeViewModel(_qfapp);

            /*
            // Window creation and context assignment
            UIDemo.MainWindow mainWindow = new UIDemo.MainWindow();
            mainWindow.DataContext = new MainWindowViewModel();

            mainWindow.MessageView.DataContext = new MessageViewModel(_qfapp);
            mainWindow.ExecutionView.DataContext = new ExecutionViewModel(_qfapp);
            mainWindow.ConnectionView.DataContext = new ConnectionViewModel(_qfapp);
            mainWindow.OrderView.DataContext = new OrderViewModel(_qfapp, strategy);
            mainWindow.NewsSenderView.DataContext = new NewsSenderViewModel(_qfapp);
            */
            // Set the main UI dispatcher
            SmartDispatcher.SetDispatcher(mainWindow.Dispatcher);

            mainWindow.Show();
        }