Пример #1
0
        private static bool DeleteChangeSetTest(int userData)
        {
            ListControl listControl        = ListControl.FromID(userData);
            ChangeSets  selectedChangeSets = listControl.SelectedChangeSets;

            if (selectedChangeSets.Count == 0)
            {
                return(false);
            }
            ChangeSet changeSet = ChangeSetContextMenu.GetChangeSet(selectedChangeSets);

            if (changeSet.id == "-1")
            {
                return(false);
            }
            ListItem changeSetItem = listControl.GetChangeSetItem(changeSet);
            bool     flag          = changeSetItem != null && changeSetItem.HasChildren && changeSetItem.FirstChild.Asset != null && changeSetItem.FirstChild.Name != "Empty change list";

            if (!flag)
            {
                Task task = Provider.ChangeSetStatus(changeSet);
                task.Wait();
                flag = (task.assetList.Count != 0);
            }
            return(!flag && Provider.DeleteChangeSetsIsValid(selectedChangeSets));
        }
Пример #2
0
        private static void Resolve(int userData)
        {
            ChangeSets selectedChangeSets = ListControl.FromID(userData).SelectedChangeSets;
            ChangeSet  changeSet          = ChangeSetContextMenu.GetChangeSet(selectedChangeSets);

            if (changeSet != null)
            {
                WindowResolve.Open(changeSet);
            }
        }
Пример #3
0
        private static void Submit(int userData)
        {
            ChangeSets selectedChangeSets = ListControl.FromID(userData).SelectedChangeSets;
            ChangeSet  changeSet          = ChangeSetContextMenu.GetChangeSet(selectedChangeSets);

            if (changeSet != null)
            {
                WindowChange.Open(changeSet, new AssetList(), true);
            }
        }
Пример #4
0
        private static bool EditChangeSetTest(int userData)
        {
            ChangeSets selectedChangeSets = ListControl.FromID(userData).SelectedChangeSets;

            if (selectedChangeSets.Count == 0 || !(ChangeSetContextMenu.GetChangeSet(selectedChangeSets).id != "-1"))
            {
                return(false);
            }
            return(Provider.SubmitIsValid(selectedChangeSets[0], (AssetList)null));
        }
Пример #5
0
        private static void Revert(int userData)
        {
            ChangeSet changeSet = ChangeSetContextMenu.GetChangeSet(ListControl.FromID(userData).SelectedChangeSets);

            if (changeSet == null)
            {
                return;
            }
            WindowRevert.Open(changeSet);
        }
Пример #6
0
        private static void EditChangeSet(int userData)
        {
            ChangeSet changeSet = ChangeSetContextMenu.GetChangeSet(ListControl.FromID(userData).SelectedChangeSets);

            if (changeSet == null)
            {
                return;
            }
            WindowChange.Open(changeSet, new AssetList(), false);
        }
Пример #7
0
        private static bool EditChangeSetTest(int userData)
        {
            ChangeSets selectedChangeSets = ListControl.FromID(userData).SelectedChangeSets;

            if (selectedChangeSets.Count == 0)
            {
                return(false);
            }
            ChangeSet changeSet = ChangeSetContextMenu.GetChangeSet(selectedChangeSets);

            return(changeSet.id != "-1" && Provider.SubmitIsValid(selectedChangeSets[0], null));
        }
        private static bool DeleteChangeSetTest(int userData)
        {
            ListControl listControl        = ListControl.FromID(userData);
            ChangeSets  selectedChangeSets = listControl.SelectedChangeSets;

            if (selectedChangeSets.Count == 0)
            {
                return(false);
            }
            ChangeSet changeSet     = ChangeSetContextMenu.GetChangeSet(selectedChangeSets);
            ListItem  changeSetItem = listControl.GetChangeSetItem(changeSet);

            return((changeSetItem == null || !changeSetItem.HasChildren || changeSetItem.FirstChild.Asset == null || !(changeSetItem.FirstChild.Name != "Empty change list")) && changeSet.id != "-1" && Provider.DeleteChangeSetsIsValid(selectedChangeSets));
        }