Example #1
0
        private string SelectDataBase()
        {
            var dialog = new SelectDataBaseViewModel(this.authenticator, this.cremaAppHost, (item) => item.Name != this.cremaAppHost.DataBaseName);

            if (dialog.ShowDialog() == true)
            {
                return(dialog.SelectedValue);
            }
            return(null);
        }
        protected async override void OnExecute(object parameter)
        {
            var dialog = new SelectDataBaseViewModel(this.authenticator, this.cremaAppHost);

            if (await dialog.ShowDialogAsync() != true)
            {
                return;
            }
            await DataBaseUtility.CopyAsync(this.authenticator, dialog.SelectedItem);
        }
Example #3
0
        private async Task <string> SelectDataBaseAsync()
        {
            var dialog = new SelectDataBaseViewModel(this.authenticator, this.cremaAppHost, (info) => info.Name != this.cremaAppHost.DataBaseName);

            if (await dialog.ShowDialogAsync() == true)
            {
                return(dialog.SelectedValue);
            }
            return(null);
        }
Example #4
0
        public async void SelectDataBase()
        {
            var dialog = new SelectDataBaseViewModel(this.authenticator, this.CremaAppHost);

            if (await dialog.ShowDialogAsync() != true)
            {
                return;
            }

            try
            {
                await this.CremaAppHost.LoadAsync(dialog.SelectedItem.Name);
            }
            catch (Exception e)
            {
                await AppMessageBox.ShowErrorAsync(e);
            }
        }
Example #5
0
        protected async override void OnExecute(object parameter)
        {
            var dialog = new SelectDataBaseViewModel(this.authenticator, this.cremaAppHost, (s) => DataBaseDescriptorUtility.IsLoaded(this.authenticator, s) == false);

            if (await dialog.ShowDialogAsync() != true)
            {
                return;
            }
            if (DataBaseDescriptorUtility.IsLoaded(this.authenticator, dialog.SelectedItem) == true)
            {
                await AppMessageBox.ShowAsync("현재 사용중인 데이터베이스는 삭제할 수 없습니다.");

                return;
            }
            if (await new DeleteViewModel().ShowDialogAsync() != true)
            {
                return;
            }
            await DataBaseUtility.DeleteAsync(this.authenticator, dialog.SelectedItem);
        }
        protected async override void OnExecute(object parameter)
        {
            var dialog = new SelectDataBaseViewModel(this.authenticator, this.cremaAppHost, (item) =>
            {
                if (item.Name == this.cremaAppHost.DataBaseName)
                {
                    return(false);
                }
                return(item.ConnectionItem != null);
            })
            {
                ConnectableOnly = true,
            };

            if (await dialog.ShowDialogAsync() != true)
            {
                return;
            }
            this.cremaAppHost.ConnectionItem = dialog.SelectedItem.ConnectionItem;
        }