Example #1
0
        public static void OpenIfCheckoutFailed(AssetList assets)
        {
            Object[] windows             = Resources.FindObjectsOfTypeAll(typeof(WindowCheckoutFailure));
            WindowCheckoutFailure window = (windows.Length > 0 ? windows[0] as WindowCheckoutFailure : null);

            bool alreadyOpen = (window != null);
            bool shouldOpen  = alreadyOpen;

            if (!shouldOpen)
            {
                foreach (var asset in assets)
                {
                    if (!asset.IsState(Asset.States.CheckedOutLocal))
                    {
                        shouldOpen = true;
                        break;
                    }
                }
            }

            if (shouldOpen)
            {
                GetWindow().DoOpen(assets, alreadyOpen);
            }
        }
Example #2
0
        public static void OpenIfCheckoutFailed(AssetList assets)
        {
            Object[] objectsOfTypeAll = Resources.FindObjectsOfTypeAll(typeof(WindowCheckoutFailure));
            bool     alreadyOpen      = (objectsOfTypeAll.Length <= 0 ? (Object)null : (Object)(objectsOfTypeAll[0] as WindowCheckoutFailure)) != (Object)null;
            bool     flag             = alreadyOpen;

            if (!flag)
            {
                using (List <Asset> .Enumerator enumerator = assets.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        if (!enumerator.Current.IsState(Asset.States.CheckedOutLocal))
                        {
                            flag = true;
                            break;
                        }
                    }
                }
            }
            if (!flag)
            {
                return;
            }
            WindowCheckoutFailure.GetWindow().DoOpen(assets, alreadyOpen);
        }
        static void OnVCTaskCompletedEvent(Task task, CompletionAction completionAction)
        {
            // inspector should re-calculate which VCS buttons it needs to show
            InspectorWindow.ClearVersionControlBarState();

            var wins = Resources.FindObjectsOfTypeAll(typeof(WindowPending)) as WindowPending[];

            foreach (WindowPending win in wins)
            {
                switch (completionAction)
                {
                case CompletionAction.UpdatePendingWindow:     // fallthrough
                case CompletionAction.OnCheckoutCompleted:
                    win.UpdateWindow();
                    break;

                case CompletionAction.OnChangeContentsPendingWindow:
                    win.OnChangeContents(task);
                    break;

                case CompletionAction.OnIncomingPendingWindow:
                    win.OnIncoming(task);
                    break;

                case CompletionAction.OnChangeSetsPendingWindow:
                    win.OnChangeSets(task);
                    break;

                case CompletionAction.OnGotLatestPendingWindow:
                    win.OnGotLatest(task);
                    break;
                }
            }

            switch (completionAction)
            {
            case CompletionAction.OnSubmittedChangeWindow:
                WindowChange.OnSubmitted(task);
                break;

            case CompletionAction.OnAddedChangeWindow:
                WindowChange.OnAdded(task);
                break;

            case CompletionAction.OnCheckoutCompleted:
                if (EditorUserSettings.showFailedCheckout)
                {
                    WindowCheckoutFailure.OpenIfCheckoutFailed(task.assetList);
                }
                break;
            }

            task.Dispose();
        }
Example #4
0
        private static void OnVCTaskCompletedEvent(Task task, CompletionAction completionAction)
        {
            WindowPending[] array  = Resources.FindObjectsOfTypeAll(typeof(WindowPending)) as WindowPending[];
            WindowPending[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                WindowPending windowPending = array2[i];
                switch (completionAction)
                {
                case CompletionAction.UpdatePendingWindow:
                case CompletionAction.OnCheckoutCompleted:
                    windowPending.UpdateWindow();
                    break;

                case CompletionAction.OnChangeContentsPendingWindow:
                    windowPending.OnChangeContents(task);
                    break;

                case CompletionAction.OnIncomingPendingWindow:
                    windowPending.OnIncoming(task);
                    break;

                case CompletionAction.OnChangeSetsPendingWindow:
                    windowPending.OnChangeSets(task);
                    break;

                case CompletionAction.OnGotLatestPendingWindow:
                    windowPending.OnGotLatest(task);
                    break;
                }
            }
            if (completionAction != CompletionAction.OnSubmittedChangeWindow)
            {
                if (completionAction != CompletionAction.OnAddedChangeWindow)
                {
                    if (completionAction == CompletionAction.OnCheckoutCompleted)
                    {
                        if (EditorUserSettings.showFailedCheckout)
                        {
                            WindowCheckoutFailure.OpenIfCheckoutFailed(task.assetList);
                        }
                    }
                }
                else
                {
                    WindowChange.OnAdded(task);
                }
            }
            else
            {
                WindowChange.OnSubmitted(task);
            }
            task.Dispose();
        }
Example #5
0
        private static void OnVCTaskCompletedEvent(Task task, CompletionAction completionAction)
        {
            foreach (WindowPending windowPending in Resources.FindObjectsOfTypeAll(typeof(WindowPending)) as WindowPending[])
            {
                switch (completionAction)
                {
                case CompletionAction.UpdatePendingWindow:
                case CompletionAction.OnCheckoutCompleted:
                    windowPending.UpdateWindow();
                    break;

                case CompletionAction.OnChangeContentsPendingWindow:
                    windowPending.OnChangeContents(task);
                    break;

                case CompletionAction.OnIncomingPendingWindow:
                    windowPending.OnIncoming(task);
                    break;

                case CompletionAction.OnChangeSetsPendingWindow:
                    windowPending.OnChangeSets(task);
                    break;

                case CompletionAction.OnGotLatestPendingWindow:
                    windowPending.OnGotLatest(task);
                    break;
                }
            }
            switch (completionAction)
            {
            case CompletionAction.OnSubmittedChangeWindow:
                WindowChange.OnSubmitted(task);
                break;

            case CompletionAction.OnAddedChangeWindow:
                WindowChange.OnAdded(task);
                break;

            case CompletionAction.OnCheckoutCompleted:
                if (EditorUserSettings.showFailedCheckout)
                {
                    WindowCheckoutFailure.OpenIfCheckoutFailed(task.assetList);
                    break;
                }
                break;
            }
            task.Dispose();
        }
Example #6
0
        public static void OpenIfCheckoutFailed(AssetList assets)
        {
            UnityEngine.Object[]  array = Resources.FindObjectsOfTypeAll(typeof(WindowCheckoutFailure));
            WindowCheckoutFailure x     = (array.Length <= 0) ? null : (array[0] as WindowCheckoutFailure);
            bool flag  = x != null;
            bool flag2 = flag;

            if (!flag2)
            {
                foreach (Asset current in assets)
                {
                    if (!current.IsState(Asset.States.CheckedOutLocal))
                    {
                        flag2 = true;
                        break;
                    }
                }
            }
            if (flag2)
            {
                WindowCheckoutFailure.GetWindow().DoOpen(assets, flag);
            }
        }
Example #7
0
        public static void OpenIfCheckoutFailed(AssetList assets)
        {
            UnityEngine.Object[]  objArray = Resources.FindObjectsOfTypeAll(typeof(WindowCheckoutFailure));
            WindowCheckoutFailure failure  = (objArray.Length <= 0) ? null : (objArray[0] as WindowCheckoutFailure);
            bool alreadyOpen = failure != null;
            bool flag2       = alreadyOpen;

            if (!flag2)
            {
                foreach (Asset asset in assets)
                {
                    if (!asset.IsState(Asset.States.CheckedOutLocal))
                    {
                        flag2 = true;
                        break;
                    }
                }
            }
            if (flag2)
            {
                GetWindow().DoOpen(assets, alreadyOpen);
            }
        }