Example #1
0
        public async Task <bool> TryHandleCommandAsync(IImmutableSet <IProjectTree> nodes, long commandId, bool focused, long commandExecuteOptions, IntPtr variantArgIn, IntPtr variantArgOut)
        {
            if (commandId == RPackageCommandId.icmdPublishSProcOptions)
            {
                var dlg = await SqlPublshOptionsDialog.CreateAsync(_appShell, _pss, _pcsp);

                dlg.ShowModal();
                return(true);
            }
            return(false);
        }
Example #2
0
        public async Task <bool> TryHandleCommandAsync(IImmutableSet <IProjectTree> nodes, long commandId, bool focused, long commandExecuteOptions, IntPtr variantArgIn, IntPtr variantArgOut)
        {
            if (commandId == RPackageCommandId.icmdPublishSProcOptions)
            {
                if (_dacServicesProvider.GetDacPackageServices(showMessage: true) != null)
                {
                    var dlg = await SqlPublshOptionsDialog.CreateAsync(_appShell, _pss, _pcsp);

                    await _appShell.SwitchToMainThreadAsync();

                    dlg.ShowModal();
                }
                return(true);
            }
            return(false);
        }
        public async Task Constructor()
        {
            var shell = Substitute.For <ICoreShell>();
            var pss   = Substitute.For <IProjectSystemServices>();
            var pcsp  = Substitute.For <IProjectConfigurationSettingsProvider>();
            var s     = Substitute.For <ISettingsStorage>();

            var dlg = await SqlPublshOptionsDialog.CreateAsync(shell, pss, pcsp, s);

            dlg.Title.Should().Be(Resources.SqlPublishDialog_Title);
            dlg.DataContext.Should().BeOfType(typeof(SqlPublishOptionsDialogViewModel));

            var model = dlg.DataContext as SqlPublishOptionsDialogViewModel;

            model.Settings.TargetType.Should().Be(PublishTargetType.Dacpac);
            model.TargetHasName.Should().BeFalse();
            model.GenerateTable.Should().BeFalse();
            model.Settings.Should().NotBeNull();
        }