예제 #1
0
        private void OnOpenFromCloudDrive(object sender, EventArgs eventArgs)
        {
            // First usage: register new account
            if (!HasAccounts())
            {
                return;
            }

            _uiService.ShowDonationDialog();

            var form = new CloudDriveFilePicker();

            form.InitEx(_configService, _storageService, _kpResources, CloudDriveFilePicker.Mode.Open);
            var result = UIUtil.ShowDialogAndDestroy(form);

            if (result != DialogResult.OK)
            {
                return;
            }

            var ci = IOConnectionInfo.FromPath(form.ResultUri);

            ci.CredSaveMode = IOCredSaveMode.SaveCred;

            _host.MainWindow.OpenDatabase(ci, null, false);
        }
예제 #2
0
        private void OnSaveToCloudDrive(object sender, EventArgs e)
        {
            if (_host.Database == null)
            {
                return;
            }

            // First usage: register new account
            if (!HasAccounts())
            {
                return;
            }

            _uiService.ShowDonationDialog();

            var form = new CloudDriveFilePicker();

            form.InitEx(_configService, _storageService, _kpResources, CloudDriveFilePicker.Mode.Save);
            var result = UIUtil.ShowDialogAndDestroy(form);

            if (result != DialogResult.OK)
            {
                return;
            }

            var ci = IOConnectionInfo.FromPath(form.ResultUri);

            ci.CredSaveMode = IOCredSaveMode.SaveCred;

            var isCopy = sender == _tsSaveCopyToCloudDrive;

            _host.MainWindow.SaveDatabaseAs(_host.Database, ci, true, null, isCopy);
        }