public async Task UnpublishedCommitsUIClickedAsync(ISccUIClickedEventArgs args, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            Debug.Assert(args != null, "Unpublished commits UI coordinates were not received.");

            IVsUIShell uiShell = (IVsUIShell)_sccProvider.GetService(typeof(SVsUIShell));
            if (uiShell != null)
            {
                int result;
                uiShell.ShowMessageBox(dwCompRole: 0,
                                       rclsidComp: Guid.Empty,
                                       pszTitle: Resources.ProviderName,
                                       pszText: string.Format(CultureInfo.CurrentUICulture, Resources.PendingChangesUIClickedMessage, args.ClickedElementPosition.ToString()),
                                       pszHelpFile: string.Empty,
                                       dwHelpContextID: 0,
                                       msgbtn: OLEMSGBUTTON.OLEMSGBUTTON_OK,
                                       msgdefbtn: OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
                                       msgicon: OLEMSGICON.OLEMSGICON_INFO,
                                       fSysAlert: 0,        // false = application modal; true would make it system modal
                                       pnResult: out result);

                // Reset the number of published commits when the Unpublished Commits UI is clicked
                UnpublishedCommitCount = 0;
            }
        }
        public async Task UnpublishedCommitsUIClickedAsync(ISccUIClickedEventArgs args, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            Debug.Assert(args != null, "Unpublished commits UI coordinates were not received.");

            IVsUIShell uiShell = (IVsUIShell)_sccProvider.GetService(typeof(SVsUIShell));

            if (uiShell != null)
            {
                int result;
                uiShell.ShowMessageBox(dwCompRole: 0,
                                       rclsidComp: Guid.Empty,
                                       pszTitle: Resources.ProviderName,
                                       pszText: string.Format(CultureInfo.CurrentUICulture, Resources.PendingChangesUIClickedMessage, args.ClickedElementPosition.ToString()),
                                       pszHelpFile: string.Empty,
                                       dwHelpContextID: 0,
                                       msgbtn: OLEMSGBUTTON.OLEMSGBUTTON_OK,
                                       msgdefbtn: OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
                                       msgicon: OLEMSGICON.OLEMSGICON_INFO,
                                       fSysAlert: 0,        // false = application modal; true would make it system modal
                                       pnResult: out result);

                // Reset the number of published commits when the Unpublished Commits UI is clicked
                UnpublishedCommitCount = 0;
            }
        }
        public async Task RepositoryUIClickedAsync(ISccUIClickedEventArgs args, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            Debug.Assert(args != null, "Repository UI coordinates were not received.");

            IVsUIShell uiShell = (IVsUIShell)_sccProvider.GetService(typeof(SVsUIShell));
            if (uiShell != null)
            {
                POINTS[] p = new POINTS[1];
                p[0] = new POINTS();
                p[0].x = (short)args.ClickedElementPosition.TopLeft.X;
                p[0].y = (short)args.ClickedElementPosition.TopLeft.Y;

                Guid commandSet = GuidList.guidSccProviderCmdSet;
                uiShell.ShowContextMenu(0, ref commandSet, PackageIds.RepositoryMenu, p, _statusBarManager);
            }
            //if (uiShell != null)
            //{
            //    int result;
            //    uiShell.ShowMessageBox(dwCompRole: 0,
            //                           rclsidComp: Guid.Empty,
            //                           pszTitle: Resources.ProviderName,
            //                           pszText: string.Format(CultureInfo.CurrentUICulture, "Clicked", args.ClickedElementPosition.ToString()),
            //                           pszHelpFile: string.Empty,
            //                           dwHelpContextID: 0,
            //                           msgbtn: OLEMSGBUTTON.OLEMSGBUTTON_OK,
            //                           msgdefbtn: OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
            //                           msgicon: OLEMSGICON.OLEMSGICON_INFO,
            //                           fSysAlert: 0,        // false = application modal; true would make it system modal
            //                           pnResult: out result);
            //}
        }
示例#4
0
        public async Task PendingChangesUIClickedAsync(ISccUIClickedEventArgs args, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            Debug.Assert(args != null, "Changes UI coordinates were not received.");

            await _sccProvider.ShowPendingChangesWindow();

            IVsUIShell uiShell = (IVsUIShell)_sccProvider.GetService(typeof(SVsUIShell));
            //if (uiShell != null)
            //{
            //    int result;
            //    uiShell.ShowMessageBox(dwCompRole: 0,
            //                           rclsidComp: Guid.Empty,
            //                           pszTitle: Resources.ProviderName,
            //                           pszText: string.Format(CultureInfo.CurrentUICulture, "Blah", args.ClickedElementPosition.ToString()),
            //                           pszHelpFile: string.Empty,
            //                           dwHelpContextID: 0,
            //                           msgbtn: OLEMSGBUTTON.OLEMSGBUTTON_OK,
            //                           msgdefbtn: OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
            //                           msgicon: OLEMSGICON.OLEMSGICON_INFO,
            //                           fSysAlert: 0,        // false = application modal; true would make it system modal
            //                           pnResult: out result);
            //}
        }
        public async Task PendingChangesUIClickedAsync(ISccUIClickedEventArgs args, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            Debug.Assert(args != null, "Changes UI coordinates were not received.");

            await _sccProvider.ShowPendingChangesWindow();

            IVsUIShell uiShell = (IVsUIShell)_sccProvider.GetService(typeof(SVsUIShell));
            //if (uiShell != null)
            //{
            //    int result;
            //    uiShell.ShowMessageBox(dwCompRole: 0,
            //                           rclsidComp: Guid.Empty,
            //                           pszTitle: Resources.ProviderName,
            //                           pszText: string.Format(CultureInfo.CurrentUICulture, "Blah", args.ClickedElementPosition.ToString()),
            //                           pszHelpFile: string.Empty,
            //                           dwHelpContextID: 0,
            //                           msgbtn: OLEMSGBUTTON.OLEMSGBUTTON_OK,
            //                           msgdefbtn: OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
            //                           msgicon: OLEMSGICON.OLEMSGICON_INFO,
            //                           fSysAlert: 0,        // false = application modal; true would make it system modal
            //                           pnResult: out result);
            //}
        }
示例#6
0
        /// <summary>
        /// Handler called when the pending changes UI is clicked.
        /// A Source Control provider is expected to begin a workflow that will enable the user to
        /// commit pending changes.
        /// </summary>
        async System.Threading.Tasks.Task IVsSccChanges.PendingChangesUIClickedAsync(ISccUIClickedEventArgs args, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            _P4VsProvider.P4VsViewPendingChangelistsToolWindow(null, null);
            IVsUIShell uiShell = (IVsUIShell)ScmProvider.SccService;
        }
        /// <summary>
        /// Handler called when the branch UI is clicked
        /// </summary>
        /// <remarks>
        /// The UI has an upward arrow visually indicating that a menu would be displayed which when clicked
        /// would lead the user to a workflow that enables the switching of branches
        /// </remarks>
        public async Task BranchUIClickedAsync(ISccUIClickedEventArgs args, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            Debug.Assert(args != null, "Branch UI coordinates were not received.");

            IVsUIShell uiShell = (IVsUIShell)_sccProvider.GetService(typeof(SVsUIShell));
            if (uiShell != null)
            {
                POINTS[] p = new POINTS[1];
                p[0] = new POINTS();
                p[0].x = (short)args.ClickedElementPosition.TopRight.X;
                p[0].y = (short)args.ClickedElementPosition.TopRight.Y;

                Guid commandSet = GuidList.guidSccProviderCmdSet;
                uiShell.ShowContextMenu(0, ref commandSet, CommandId.BranchMenu, p, null);
            }
        }
示例#8
0
        /// <summary>
        /// Handler called when the branch UI is clicked
        /// </summary>
        /// <remarks>
        /// The UI has an upward arrow visually indicating that a menu would be displayed which when clicked
        /// would lead the user to a workflow that enables the switching of branches
        /// </remarks>
        public async Task BranchUIClickedAsync(ISccUIClickedEventArgs args, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            Debug.Assert(args != null, "Branch UI coordinates were not received.");

            IVsUIShell uiShell = (IVsUIShell)_sccProvider.GetService(typeof(SVsUIShell));

            if (uiShell != null)
            {
                POINTS[] p = new POINTS[1];
                p[0]   = new POINTS();
                p[0].x = (short)args.ClickedElementPosition.TopRight.X;
                p[0].y = (short)args.ClickedElementPosition.TopRight.Y;

                Guid commandSet = GuidList.guidSccProviderCmdSet;
                uiShell.ShowContextMenu(0, ref commandSet, CommandId.BranchMenu, p, null);
            }
        }
示例#9
0
        public async Task RepositoryUIClickedAsync(ISccUIClickedEventArgs args, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            Debug.Assert(args != null, "Repository UI coordinates were not received.");

            IVsUIShell uiShell = (IVsUIShell)_sccProvider.GetService(typeof(SVsUIShell));

            if (uiShell != null)
            {
                POINTS[] p = new POINTS[1];
                p[0]   = new POINTS();
                p[0].x = (short)args.ClickedElementPosition.TopLeft.X;
                p[0].y = (short)args.ClickedElementPosition.TopLeft.Y;

                Guid commandSet = GuidList.guidSccProviderCmdSet;
                uiShell.ShowContextMenu(0, ref commandSet, PackageIds.RepositoryMenu, p, _statusBarManager);
            }
            //if (uiShell != null)
            //{
            //    int result;
            //    uiShell.ShowMessageBox(dwCompRole: 0,
            //                           rclsidComp: Guid.Empty,
            //                           pszTitle: Resources.ProviderName,
            //                           pszText: string.Format(CultureInfo.CurrentUICulture, "Clicked", args.ClickedElementPosition.ToString()),
            //                           pszHelpFile: string.Empty,
            //                           dwHelpContextID: 0,
            //                           msgbtn: OLEMSGBUTTON.OLEMSGBUTTON_OK,
            //                           msgdefbtn: OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
            //                           msgicon: OLEMSGICON.OLEMSGICON_INFO,
            //                           fSysAlert: 0,        // false = application modal; true would make it system modal
            //                           pnResult: out result);
            //}
        }
示例#10
0
 System.Threading.Tasks.Task IVsSccCurrentRepository.RepositoryUIClickedAsync(ISccUIClickedEventArgs args, CancellationToken cancellationToken)
 {
     return(RunAsyncOnMainThread(delegate { OnRepositoryUIClicked(GetPoint(args)); }));
 }
示例#11
0
 System.Threading.Tasks.Task IVsSccChanges.PendingChangesUIClickedAsync(ISccUIClickedEventArgs args, CancellationToken cancellationToken)
 {
     return(RunAsyncOnMainThread(delegate { OnPendingChangesClicked(GetPoint(args)); }));
 }
示例#12
0
 System.Drawing.Point GetPoint(ISccUIClickedEventArgs args)
 {
     System.Windows.Point p = args.ClickedElementPosition.TopRight;
     return(new System.Drawing.Point((int)p.X, (int)p.Y));
 }