Example #1
0
        public void Create()
        {
            string uri = FolderName + "\\" + FileName;

            appModel_.AddRecent(FolderName + "\\" + FileName);
            appModel_.SaveConfig();

            var scope = appModel_.CreateScope(uri);

            foreach (var colName in ColumnList)
            {
                scope.CreateOrUpdateColumn(new ColumnInfo {
                    Name = colName
                });
            }

            foreach (var rowName in RowList)
            {
                scope.CreateOrUpdateRow(new RowInfo {
                    Name = rowName
                });
            }

            this.Close();

            shell_.ShowView <BoardView>(
                viewRequest: new BoardViewRequest {
                Scope = scope
            },
                options: new UiShowOptions {
                Title = FileName
            });
        }
Example #2
0
        public StartupViewModel(IShell shell, IAppModel appModel)
        {
            shell_    = shell;
            appModel_ = appModel;

            appModel_.LoadConfig();

            var recent = appModel_.GetRecentDocuments();

            BaseList = new ReactiveList <string>(recent);

            OpenRecentDbCommand = ReactiveCommand.Create <string>(uri =>
            {
                if (!OpenBoardView(uri))
                {
                    appModel_.RemoveRecent(uri);
                    appModel_.SaveConfig();

                    BaseList.Remove(uri);

                    DialogCoordinator.Instance.ShowMessageAsync(this, "Ошибка", "База была удалена или перемещена из данной папки");
                }
            });

            NewDbCommand = ReactiveCommand.Create(() => shell.ShowView <WizardView>());

            OpenDbCommand = ReactiveCommand.Create(() =>
            {
                var dialog = new OpenFileDialog()
                {
                    Filter = "SQLite DataBase | *.db",
                    Title  = "Открытие базы"
                };

                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    OpenBoardView(dialog.FileName);
                }
            });
        }//ctor
Example #3
0
        } //ctor

        private void RemoveRecent(string uri)
        {
            appModel.RemoveRecent(uri);
            appModel.SaveConfig();
            BaseList.PublishCollection(appModel.GetRecentDocuments().Take(3));
        }