예제 #1
0
        internal static void OnSubmitted(Task task)
        {
            var winsChange = Resources.FindObjectsOfTypeAll(typeof(WindowChange)) as WindowChange[];

            if (winsChange.Length == 0)
            {
                return; // user closed submit window before submit finished. Just ignore the status callback.
            }
            var win = winsChange[0];

            win.assetList          = task.assetList;
            win.submitResultCode   = task.resultCode;
            win.submitErrorMessage = null;

            if ((task.resultCode & (int)SubmitResult.Error) != 0)
            {
                string delim = "";
                foreach (Message msg in task.messages)
                {
                    if (msg.severity == Message.Severity.Error)
                    {
                        win.submitErrorMessage += delim + msg.message;
                    }
                }
            }

            if ((task.resultCode & ((int)SubmitResult.OK | (int)SubmitResult.Error)) != 0)
            {
                WindowPending.UpdateAllWindows();
                bool isNewChangeSet = win.changeSet == null;
                if (isNewChangeSet)
                {
                    // When change list becomes empty we open it to make "delete empty changessets" button visible
                    Task flushTask = Provider.Status(""); // Make a dummy task and wait for it since that will guarantee up to date lists
                    flushTask.Wait();
                    WindowPending.ExpandLatestChangeSet();
                }
            }

            if ((task.resultCode & (int)SubmitResult.OK) != 0)
            {
                win.ResetAndClose();
            }
            else
            {
                WindowResolve.Open(win.assetList);
                win.ResetAndClose();
            }
        }
예제 #2
0
        internal static void OnSubmitted(Task task)
        {
            WindowChange[] array = Resources.FindObjectsOfTypeAll(typeof(WindowChange)) as WindowChange[];
            if (array.Length == 0)
            {
                return;
            }
            WindowChange windowChange = array[0];

            windowChange.assetList          = task.assetList;
            windowChange.submitResultCode   = task.resultCode;
            windowChange.submitErrorMessage = null;
            if ((task.resultCode & 2) != 0)
            {
                string    empty    = string.Empty;
                Message[] messages = task.messages;
                for (int i = 0; i < messages.Length; i++)
                {
                    Message message = messages[i];
                    if (message.severity == Message.Severity.Error)
                    {
                        WindowChange expr_77 = windowChange;
                        expr_77.submitErrorMessage = expr_77.submitErrorMessage + empty + message.message;
                    }
                }
            }
            if ((task.resultCode & 3) != 0)
            {
                WindowPending.UpdateAllWindows();
                bool flag = windowChange.changeSet == null;
                if (flag)
                {
                    Task task2 = Provider.Status(string.Empty);
                    task2.Wait();
                    WindowPending.ExpandLatestChangeSet();
                }
            }
            if ((task.resultCode & 1) != 0)
            {
                windowChange.ResetAndClose();
            }
            else
            {
                windowChange.RefreshList();
            }
        }
예제 #3
0
        internal static void OnSubmitted(Task task)
        {
            WindowChange[] objectsOfTypeAll = Resources.FindObjectsOfTypeAll(typeof(WindowChange)) as WindowChange[];
            if (objectsOfTypeAll.Length == 0)
            {
                return;
            }
            WindowChange windowChange1 = objectsOfTypeAll[0];

            windowChange1.assetList          = task.assetList;
            windowChange1.submitResultCode   = task.resultCode;
            windowChange1.submitErrorMessage = (string)null;
            if ((task.resultCode & 2) != 0)
            {
                string empty = string.Empty;
                foreach (Message message in task.messages)
                {
                    if (message.severity == Message.Severity.Error)
                    {
                        WindowChange windowChange2 = windowChange1;
                        string       str           = windowChange2.submitErrorMessage + empty + message.message;
                        windowChange2.submitErrorMessage = str;
                    }
                }
            }
            if ((task.resultCode & 3) != 0)
            {
                WindowPending.UpdateAllWindows();
                if (windowChange1.changeSet == null)
                {
                    Provider.Status(string.Empty).Wait();
                    WindowPending.ExpandLatestChangeSet();
                }
            }
            if ((task.resultCode & 1) != 0)
            {
                windowChange1.ResetAndClose();
            }
            else
            {
                windowChange1.RefreshList();
            }
        }
예제 #4
0
 internal static void OnSubmitted(Task task)
 {
     WindowChange[] changeArray = UnityEngine.Resources.FindObjectsOfTypeAll(typeof(WindowChange)) as WindowChange[];
     if (changeArray.Length != 0)
     {
         WindowChange change = changeArray[0];
         change.assetList          = task.assetList;
         change.submitResultCode   = task.resultCode;
         change.submitErrorMessage = null;
         if ((task.resultCode & 2) != 0)
         {
             string str = "";
             foreach (Message message in task.messages)
             {
                 if (message.severity == Message.Severity.Error)
                 {
                     change.submitErrorMessage = change.submitErrorMessage + str + message.message;
                 }
             }
         }
         if ((task.resultCode & 3) != 0)
         {
             WindowPending.UpdateAllWindows();
             if (change.changeSet == null)
             {
                 Provider.Status("").Wait();
                 WindowPending.ExpandLatestChangeSet();
             }
         }
         if ((task.resultCode & 1) != 0)
         {
             change.ResetAndClose();
         }
         else
         {
             change.RefreshList();
         }
     }
 }