Ejemplo n.º 1
0
        public void DoRecover()
        {
            string[] selectedDeletedItemGUIDs   = this.GetSelectedDeletedItemGUIDs();
            Dictionary <string, int> dictionary = new Dictionary <string, int>();
            int num = 0;

            for (int i = 0; i < selectedDeletedItemGUIDs.Length; i++)
            {
                for (int j = 0; j < this.m_DeletedItems.Length; j++)
                {
                    if (this.m_DeletedItems[j].guid == selectedDeletedItemGUIDs[i])
                    {
                        dictionary[this.m_DeletedItems[j].guid] = j;
                        break;
                    }
                }
            }
            DeletedAsset[] assets = new DeletedAsset[dictionary.Count];
            while (dictionary.Count != 0)
            {
                DeletedAsset asset = null;
                foreach (KeyValuePair <string, int> pair in dictionary)
                {
                    asset = this.m_DeletedItems[pair.Value];
                    if (!dictionary.ContainsKey(asset.parent))
                    {
                        assets[num++] = asset;
                        break;
                    }
                }
                dictionary.Remove(asset.guid);
            }
            AssetServer.SetAfterActionFinishedCallback("ASEditorBackend", "CBReinitASMainWindow");
            AssetServer.DoRecoverOnNextTick(assets);
        }
Ejemplo n.º 2
0
 internal static int Compare(DeletedAsset p1, DeletedAsset p2)
 {
   if (p1.changeset > p2.changeset)
     return -1;
   if (p1.changeset < p2.changeset)
     return 1;
   return string.Compare(p1.fullPath, p2.fullPath, true);
 }
Ejemplo n.º 3
0
 internal static int Compare(DeletedAsset p1, DeletedAsset p2)
 {
     if (p1.changeset > p2.changeset)
     {
         return(-1);
     }
     if (p1.changeset < p2.changeset)
     {
         return(1);
     }
     return(string.Compare(p1.fullPath, p2.fullPath, true));
 }
Ejemplo n.º 4
0
 public void AddAssetItems(DeletedAsset[] assets)
 {
     for (int i = 0; i < assets.Length; i++)
     {
         DeletedAsset deletedAsset = assets[i];
         this.AddAssetItem(deletedAsset.guid, deletedAsset.fullPath, deletedAsset.assetIsDir != 0, ChangeFlags.None, -1);
     }
     Array.Sort <ParentViewFolder>(this.folders, new Comparison <ParentViewFolder>(ParentViewState.CompareViewFolder));
     for (int j = 0; j < this.folders.Length; j++)
     {
         Array.Sort <ParentViewFile>(this.folders[j].files, new Comparison <ParentViewFile>(ParentViewState.CompareViewFile));
     }
 }
Ejemplo n.º 5
0
        public void DoRecover()
        {
            string[] deletedItemGuiDs           = this.GetSelectedDeletedItemGUIDs();
            Dictionary <string, int> dictionary = new Dictionary <string, int>();
            int num = 0;

            for (int index1 = 0; index1 < deletedItemGuiDs.Length; ++index1)
            {
                for (int index2 = 0; index2 < this.m_DeletedItems.Length; ++index2)
                {
                    if (this.m_DeletedItems[index2].guid == deletedItemGuiDs[index1])
                    {
                        dictionary[this.m_DeletedItems[index2].guid] = index2;
                        break;
                    }
                }
            }
            DeletedAsset[] assets = new DeletedAsset[dictionary.Count];
            while (dictionary.Count != 0)
            {
                DeletedAsset deletedAsset = (DeletedAsset)null;
                using (Dictionary <string, int> .Enumerator enumerator = dictionary.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        deletedAsset = this.m_DeletedItems[enumerator.Current.Value];
                        if (!dictionary.ContainsKey(deletedAsset.parent))
                        {
                            assets[num++] = deletedAsset;
                            break;
                        }
                    }
                }
                dictionary.Remove(deletedAsset.guid);
            }
            AssetServer.SetAfterActionFinishedCallback("ASEditorBackend", "CBReinitASMainWindow");
            AssetServer.DoRecoverOnNextTick(assets);
        }
Ejemplo n.º 6
0
		public void AddAssetItems(DeletedAsset[] assets)
		{
			for (int i = 0; i < assets.Length; i++)
			{
				DeletedAsset deletedAsset = assets[i];
				this.AddAssetItem(deletedAsset.guid, deletedAsset.fullPath, deletedAsset.assetIsDir != 0, ChangeFlags.None, -1);
			}
			ParentViewFolder[] arg_61_0 = this.folders;
			if (ParentViewState.<>f__mg$cache4 == null)
			{
				ParentViewState.<>f__mg$cache4 = new Comparison<ParentViewFolder>(ParentViewState.CompareViewFolder);
			}
			Array.Sort<ParentViewFolder>(arg_61_0, ParentViewState.<>f__mg$cache4);
			for (int j = 0; j < this.folders.Length; j++)
			{
				ParentViewFile[] arg_97_0 = this.folders[j].files;
				if (ParentViewState.<>f__mg$cache5 == null)
				{
					ParentViewState.<>f__mg$cache5 = new Comparison<ParentViewFile>(ParentViewState.CompareViewFile);
				}
				Array.Sort<ParentViewFile>(arg_97_0, ParentViewState.<>f__mg$cache5);
			}
		}
Ejemplo n.º 7
0
 internal static int Compare(DeletedAsset p1, DeletedAsset p2)
 {
     return((p1.changeset <= p2.changeset) ? ((p1.changeset >= p2.changeset) ? string.Compare(p1.fullPath, p2.fullPath, true) : 1) : -1);
 }
Ejemplo n.º 8
0
 internal static int Compare(DeletedAsset p1, DeletedAsset p2)
 {
     return ((p1.changeset <= p2.changeset) ? ((p1.changeset >= p2.changeset) ? string.Compare(p1.fullPath, p2.fullPath, true) : 1) : -1);
 }
Ejemplo n.º 9
0
		public static extern void DoRecoverOnNextTick(DeletedAsset[] assets);
Ejemplo n.º 10
0
		public void DoRecover()
		{
			string[] selectedDeletedItemGUIDs = this.GetSelectedDeletedItemGUIDs();
			Dictionary<string, int> dictionary = new Dictionary<string, int>();
			int num = 0;
			for (int i = 0; i < selectedDeletedItemGUIDs.Length; i++)
			{
				for (int j = 0; j < this.m_DeletedItems.Length; j++)
				{
					if (this.m_DeletedItems[j].guid == selectedDeletedItemGUIDs[i])
					{
						dictionary[this.m_DeletedItems[j].guid] = j;
						break;
					}
				}
			}
			DeletedAsset[] array = new DeletedAsset[dictionary.Count];
			while (dictionary.Count != 0)
			{
				DeletedAsset deletedAsset = null;
				foreach (KeyValuePair<string, int> current in dictionary)
				{
					deletedAsset = this.m_DeletedItems[current.Value];
					if (!dictionary.ContainsKey(deletedAsset.parent))
					{
						array[num++] = deletedAsset;
						break;
					}
				}
				dictionary.Remove(deletedAsset.guid);
			}
			AssetServer.SetAfterActionFinishedCallback("ASEditorBackend", "CBReinitASMainWindow");
			AssetServer.DoRecoverOnNextTick(array);
		}
Ejemplo n.º 11
0
 public void AddAssetItems(DeletedAsset[] assets)
 {
     foreach (DeletedAsset asset in assets)
     {
         this.AddAssetItem(asset.guid, asset.fullPath, asset.assetIsDir != 0, ChangeFlags.None, -1);
     }
     Array.Sort<ParentViewFolder>(this.folders, new Comparison<ParentViewFolder>(ParentViewState.CompareViewFolder));
     for (int i = 0; i < this.folders.Length; i++)
     {
         Array.Sort<ParentViewFile>(this.folders[i].files, new Comparison<ParentViewFile>(ParentViewState.CompareViewFile));
     }
 }
Ejemplo n.º 12
0
		public void AddAssetItems(DeletedAsset[] assets)
		{
			for (int i = 0; i < assets.Length; i++)
			{
				DeletedAsset deletedAsset = assets[i];
				this.AddAssetItem(deletedAsset.guid, deletedAsset.fullPath, deletedAsset.assetIsDir != 0, ChangeFlags.None, -1);
			}
			Array.Sort<ParentViewFolder>(this.folders, new Comparison<ParentViewFolder>(ParentViewState.CompareViewFolder));
			for (int j = 0; j < this.folders.Length; j++)
			{
				Array.Sort<ParentViewFile>(this.folders[j].files, new Comparison<ParentViewFile>(ParentViewState.CompareViewFile));
			}
		}
 public void DoRecover()
 {
   string[] deletedItemGuiDs = this.GetSelectedDeletedItemGUIDs();
   Dictionary<string, int> dictionary = new Dictionary<string, int>();
   int num = 0;
   for (int index1 = 0; index1 < deletedItemGuiDs.Length; ++index1)
   {
     for (int index2 = 0; index2 < this.m_DeletedItems.Length; ++index2)
     {
       if (this.m_DeletedItems[index2].guid == deletedItemGuiDs[index1])
       {
         dictionary[this.m_DeletedItems[index2].guid] = index2;
         break;
       }
     }
   }
   DeletedAsset[] assets = new DeletedAsset[dictionary.Count];
   while (dictionary.Count != 0)
   {
     DeletedAsset deletedAsset = (DeletedAsset) null;
     using (Dictionary<string, int>.Enumerator enumerator = dictionary.GetEnumerator())
     {
       while (enumerator.MoveNext())
       {
         deletedAsset = this.m_DeletedItems[enumerator.Current.Value];
         if (!dictionary.ContainsKey(deletedAsset.parent))
         {
           assets[num++] = deletedAsset;
           break;
         }
       }
     }
     dictionary.Remove(deletedAsset.guid);
   }
   AssetServer.SetAfterActionFinishedCallback("ASEditorBackend", "CBReinitASMainWindow");
   AssetServer.DoRecoverOnNextTick(assets);
 }