Esempio n. 1
0
        public MainWindowViewModel(ITreeSaveHelper treeSaveHelper)
        {
            this.treeSaveHelper = treeSaveHelper;
            TreeViewItems       = treeSaveHelper.Load();

            MainTreeHandler.Register(TreeViewItems);

            createDatabaseCommand = new DelegateCommand(CreateDatabase);
            openDatabaseCommand   = new DelegateCommand(OpenDatabase);
            documentationCommand  = new DelegateCommand(OpenDocumentation);
        }
Esempio n. 2
0
        public void SetUp()
        {
            testTree = new ObservableCollection <TreeItem>
            {
                new DatabaseItem
                {
                    DisplayName  = "Db1",
                    DatabasePath = DATABASEPATH1,
                    Items        = new ObservableCollection <TreeItem>
                    {
                        new TableFolderItem
                        {
                            DatabasePath = DATABASEPATH1,
                            Items        = new ObservableCollection <TreeItem>
                            {
                                new TableItem
                                {
                                    DisplayName  = "Table",
                                    DatabasePath = DATABASEPATH1
                                }
                            }
                        },
                        new ViewFolderItem
                        {
                            DatabasePath = DATABASEPATH1,
                            Items        = new ObservableCollection <TreeItem>
                            {
                                new ViewItem
                                {
                                    DisplayName  = "View",
                                    DatabasePath = DATABASEPATH1
                                }
                            }
                        },
                        new TriggerFolderItem
                        {
                            DatabasePath = DATABASEPATH1,
                            Items        = new ObservableCollection <TreeItem>
                            {
                                new TriggerItem
                                {
                                    DisplayName  = "Trigger",
                                    DatabasePath = DATABASEPATH1
                                }
                            }
                        }
                    }
                },
                new DatabaseItem
                {
                    DisplayName  = "Db2",
                    DatabasePath = DATABASEPATH2,
                    Items        = new ObservableCollection <TreeItem>
                    {
                        new TableFolderItem
                        {
                            DatabasePath = DATABASEPATH2,
                            Items        = new ObservableCollection <TreeItem>
                            {
                                new TableItem
                                {
                                    DisplayName  = "Table",
                                    DatabasePath = DATABASEPATH2
                                }
                            }
                        },
                        new ViewFolderItem
                        {
                            DatabasePath = DATABASEPATH2,
                            Items        = new ObservableCollection <TreeItem>
                            {
                                new ViewItem
                                {
                                    DisplayName  = "View",
                                    DatabasePath = DATABASEPATH2
                                }
                            }
                        },
                        new TriggerFolderItem
                        {
                            DatabasePath = DATABASEPATH1,
                            Items        = new ObservableCollection <TreeItem>
                            {
                                new TriggerItem
                                {
                                    DisplayName  = "Trigger",
                                    DatabasePath = DATABASEPATH2
                                }
                            }
                        }
                    }
                }
            };

            MainTreeHandler.Register(testTree);
        }
 public void SetUp()
 {
     MainTreeHandler.Register(new ObservableCollection <TreeItem>());
     viewModel = new TriggerCreatorViewModel();
 }