Example #1
0
        void UpdateMenuItems(GenericMenu menu)
        {
            SelectedIncomingChangesGroupInfo info =
                mIncomingChangesViewMenuOperations.GetSelectedIncomingChangesGroupInfo();
            IncomingChangesMenuOperations operations =
                UpdateIncomingChangesMenu.GetAvailableMenuOperations(info);

            if (operations == IncomingChangesMenuOperations.None)
            {
                menu.AddDisabledItem(GetNoActionMenuItemContent());
                return;
            }

            AddMergeActions(menu, operations);

            menu.AddSeparator(string.Empty);

            AddDiffActions(menu, operations);

            if (!mIncomingChangesMetaMenuOperations.SelectionHasMeta())
            {
                return;
            }

            menu.AddSeparator(string.Empty);

            AddMetaActions(menu, operations);
        }
Example #2
0
        void AddMergeActions(
            GenericMenu menu,
            IncomingChangesMenuOperations operations)
        {
            if (operations.HasFlag(IncomingChangesMenuOperations.MergeContributors))
            {
                menu.AddItem(mMergeSelectedFilesMenuItemContent, false,
                             MergeSelectedFilesMenuItem_Click);
            }
            else
            {
                menu.AddDisabledItem(mMergeSelectedFilesMenuItemContent);
            }

            if (operations.HasFlag(IncomingChangesMenuOperations.MergeKeepingSourceChanges))
            {
                menu.AddItem(mMergeKeepingSourceChangesMenuItemContent, false,
                             MergeKeepingSourceChangesMenuItem_Click);
            }
            else
            {
                menu.AddDisabledItem(mMergeKeepingSourceChangesMenuItemContent);
            }

            if (operations.HasFlag(IncomingChangesMenuOperations.MergeKeepingWorkspaceChanges))
            {
                menu.AddItem(mMergeKeepingWorkspaceChangesMenuItemContent, false,
                             MergeKeepingWorkspaceChangesMenuItem_Click);
            }
            else
            {
                menu.AddDisabledItem(mMergeKeepingWorkspaceChangesMenuItemContent);
            }
        }
Example #3
0
        void AddMetaActions(GenericMenu menu, IncomingChangesMenuOperations operations)
        {
            if (operations.HasFlag(IncomingChangesMenuOperations.DiffYoursWithIncoming))
            {
                menu.AddItem(mDiffMetaYoursWithIncomingMenuItemContent, false,
                             DiffMetaYoursWithIncomingMenuItem_Click);
            }
            else
            {
                menu.AddDisabledItem(mDiffMetaYoursWithIncomingMenuItemContent);
            }

            if (operations.HasFlag(IncomingChangesMenuOperations.DiffIncomingChanges))
            {
                menu.AddItem(mDiffMetaIncomingChangesMenuItemContent, false,
                             DiffMetaIncomingChangesMenuItem_Click);
            }
            else
            {
                menu.AddDisabledItem(mDiffMetaIncomingChangesMenuItemContent);
            }
        }