Exemplo n.º 1
0
        public static void Initialise( MainWindow window, QueryManager manager )
        {
            _window = window;
            _manager = manager;
            _filenames = new Filenames();

            window.CommandBindings.Add ( new CommandBinding ( RunQuery, RunQueryHandler ) );
            window.CommandBindings.Add ( new CommandBinding ( NextQuery, NextQueryHandler ) );
            window.CommandBindings.Add ( new CommandBinding ( PreviousQuery, PreviousQueryHandler ) );
            window.CommandBindings.Add ( new CommandBinding ( LoadFile, LoadFileHandler ) );
            window.CommandBindings.Add ( new CommandBinding ( SaveFile, SaveFileHandler ) );
        }
Exemplo n.º 2
0
        protected override void OnStartup( StartupEventArgs e )
        {
            base.OnStartup ( e );

            // Initialise the objects and set them on the main window.
            var mainWindow = new MainWindow ();
            var manager = new QueryManager ( new Filenames (), new Database ( new SQLRefactor.MainWindow.Progress ( mainWindow.progressBar ) ) );
            Commands.Initialise ( mainWindow, manager );
            mainWindow.DataContext = manager;
            mainWindow.Show ();

            var connectionWindow = new Connection ();
            var connection = new ConnectionManager ();
            connectionWindow.DataContext = connection;

            connectionWindow.Owner = mainWindow;
            connectionWindow.ShowDialog ();
            manager.ConnectionString = connection.ConnectionString;
        }