예제 #1
0
 private void DoOpen(AssetList assets, bool alreadyOpen)
 {
     if (alreadyOpen)
     {
         using (List <Asset> .Enumerator enumerator = assets.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 Asset current = enumerator.Current;
                 bool  flag    = false;
                 int   count   = this.assetList.Count;
                 for (int index = 0; index < count; ++index)
                 {
                     if (this.assetList[index].path == current.path)
                     {
                         flag = true;
                         this.assetList[index] = current;
                         break;
                     }
                 }
                 if (!flag)
                 {
                     this.assetList.Add(current);
                 }
             }
         }
     }
     else
     {
         this.assetList.AddRange((IEnumerable <Asset>)assets);
     }
     this.RefreshList();
 }
예제 #2
0
        private void OnChangeContents(Task task)
        {
            ListItem itemWithIdentifier = this.pendingList.FindItemWithIdentifier(task.userIdentifier);
            ListItem parent             = itemWithIdentifier ?? this.incomingList.FindItemWithIdentifier(task.userIdentifier);

            if (parent == null)
            {
                return;
            }
            ListControl listControl = itemWithIdentifier != null ? this.pendingList : this.incomingList;

            parent.RemoveAll();
            AssetList assetList = task.assetList;

            if (assetList.Count == 0)
            {
                listControl.Add(parent, "Empty change list", (Asset)null).Dummy = true;
            }
            else
            {
                using (List <Asset> .Enumerator enumerator = assetList.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Asset current = enumerator.Current;
                        listControl.Add(parent, current.prettyPath, current);
                    }
                }
            }
            listControl.Refresh(false);
            this.Repaint();
        }
예제 #3
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);
        }