コード例 #1
0
        public AddTablesAndColumnsViewModel(DatabaseSchemaViewModel vm)
        {
            Ok     = new DelegateCommand(() => DoOk());
            Cancel = new DelegateCommand(() => DoCancel());

            ViewModel = vm;
        }
コード例 #2
0
        public MainWindowViewModel(MainViewModel mainViewModel, DatabaseSchemaViewModel databaseSchemaViewModel, IEventAggregator evAgg, ConnectNotification connectNotification)
        {
            eventAgg = evAgg;

            ConnectRequest = new ConnectRequest();

            this.connectNotification = connectNotification;
            MainViewModel            = mainViewModel;
            DatabaseSchemaViewModel  = databaseSchemaViewModel;

            //ConnectRequest = new ConnectRequest(evAgg);
            Connect = new DelegateCommand(() => {
                DoConnect();
            });

            LoadDbSchema = new DelegateCommand(() =>
            {
                DoLoadDbSchema();
            });
        }
コード例 #3
0
        public MainViewModel(IEventAggregator evAgg, UISprints sprints, DatabaseSchemaViewModel dataViewModel)
        {
            DataViewModel = dataViewModel;
            Sprints       = sprints.Sprints;
            eventAgg      = evAgg;

            rootTables = new NodeDbTableRoot(evAgg)
            {
                Name        = "ROOT for DB Tables",
                Description = "just helper instance...",
                Nodes       = new ObservableCollection <NodeDbTableToExcel>()
            };

            eventAgg.GetEvent <PathViewAddedEvent>().Subscribe(() => {
                Task.Run(() =>
                {
                    DoLoad();
                });
            });

            evAgg.GetEvent <SelectionChangedEvent>().Subscribe(SelectionChanged());

            Import = new DelegateCommand(() => DoImport());
            Save   = new DelegateCommand(() => DoSave());
            Load   = new DelegateCommand(() => DoLoad());

            ShowLog = new DelegateCommand(() =>
            {
                Process process = new Process();
                // Configure the process using the StartInfo properties.
                var rootAppender = ((Hierarchy)LogManager.GetRepository())
                                   .Root.Appenders.OfType <log4net.Appender.FileAppender>()
                                   .FirstOrDefault();

                string filename            = rootAppender != null ? rootAppender.File : string.Empty;
                process.StartInfo.FileName = rootAppender.File;
                //process.StartInfo.Arguments = @"c:\!! LOGs\EscapeDBUsage.log";
                process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
                process.Start();
                //process.WaitForExit();// Waits here for the process to exit.
            });

            ShowDataFolder = new DelegateCommand(() =>
            {
                Process process = new Process();
                // Configure the process using the StartInfo properties.
                process.StartInfo.FileName    = "explorer";
                process.StartInfo.Arguments   = FoldersHelper.DataFolder;
                process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
                process.Start();
                //process.WaitForExit();// Waits here for the process to exit.
            });

            Refresh        = new DelegateCommand(() => DoRefresh());
            RefreshColumns = new DelegateCommand(() => DoRefreshColumns());

            ExpandAll   = new DelegateCommand(() => DoExpandAll());
            CollapseAll = new DelegateCommand(() => DoCollapseAll());

            SaveSprints = new DelegateCommand(() => DoSaveSprints());

            AddExcel = new DelegateCommand(() => DoAddExcel());

            AddTables = new DelegateCommand(() => DoAddTables());
        }