MakeNiceName() public static method

public static MakeNiceName ( string name ) : string
name string
return string
 private void AddAssetItem(string guid, string pathName, bool isDir, ChangeFlags changeFlags, int changeset)
 {
     if (pathName == string.Empty)
     {
         return;
     }
     if (isDir)
     {
         string str   = ParentViewFolder.MakeNiceName(pathName);
         int    index = ParentViewState.IndexOf(this.folders, str);
         if (index == -1)
         {
             ArrayUtility.Add <ParentViewFolder>(ref this.folders, new ParentViewFolder(str, guid, changeFlags));
         }
         else
         {
             this.folders[index].changeFlags = changeFlags;
             this.folders[index].guid        = guid;
         }
     }
     else
     {
         string           str1   = ParentViewFolder.MakeNiceName(FileUtil.DeleteLastPathNameComponent(pathName));
         string           str2   = pathName.Substring(pathName.LastIndexOf("/") + 1);
         int              index1 = ParentViewState.IndexOf(this.folders, str1);
         ParentViewFolder parentViewFolder;
         if (index1 == -1)
         {
             parentViewFolder = new ParentViewFolder(str1, AssetServer.GetParentGUID(guid, changeset));
             ArrayUtility.Add <ParentViewFolder>(ref this.folders, parentViewFolder);
         }
         else
         {
             parentViewFolder = this.folders[index1];
         }
         int index2 = ParentViewState.IndexOf(parentViewFolder.files, str2);
         if (index2 != -1)
         {
             if ((parentViewFolder.files[index2].changeFlags & ChangeFlags.Deleted) != ChangeFlags.None)
             {
                 return;
             }
             parentViewFolder.files[index2].guid        = guid;
             parentViewFolder.files[index2].changeFlags = changeFlags;
         }
         else
         {
             ArrayUtility.Add <ParentViewFile>(ref parentViewFolder.files, new ParentViewFile(str2, guid, changeFlags));
         }
     }
 }
示例#2
0
		private void AddAssetItem(string guid, string pathName, bool isDir, ChangeFlags changeFlags, int changeset)
		{
			if (!(pathName == string.Empty))
			{
				if (isDir)
				{
					string text = ParentViewFolder.MakeNiceName(pathName);
					int num = ParentViewState.IndexOf(this.folders, text);
					if (num == -1)
					{
						ParentViewFolder item = new ParentViewFolder(text, guid, changeFlags);
						ArrayUtility.Add<ParentViewFolder>(ref this.folders, item);
					}
					else
					{
						this.folders[num].changeFlags = changeFlags;
						this.folders[num].guid = guid;
					}
				}
				else
				{
					string text2 = ParentViewFolder.MakeNiceName(FileUtil.DeleteLastPathNameComponent(pathName));
					string text3 = pathName.Substring(pathName.LastIndexOf("/") + 1);
					int num2 = ParentViewState.IndexOf(this.folders, text2);
					ParentViewFolder parentViewFolder;
					if (num2 == -1)
					{
						parentViewFolder = new ParentViewFolder(text2, AssetServer.GetParentGUID(guid, changeset));
						ArrayUtility.Add<ParentViewFolder>(ref this.folders, parentViewFolder);
					}
					else
					{
						parentViewFolder = this.folders[num2];
					}
					num2 = ParentViewState.IndexOf(parentViewFolder.files, text3);
					if (num2 != -1)
					{
						if ((parentViewFolder.files[num2].changeFlags & ChangeFlags.Deleted) == ChangeFlags.None)
						{
							parentViewFolder.files[num2].guid = guid;
							parentViewFolder.files[num2].changeFlags = changeFlags;
						}
					}
					else
					{
						ArrayUtility.Add<ParentViewFile>(ref parentViewFolder.files, new ParentViewFile(text3, guid, changeFlags));
					}
				}
			}
		}
 private void AddAssetItem(string guid, string pathName, bool isDir, ChangeFlags changeFlags, int changeset)
 {
     if (pathName != string.Empty)
     {
         if (isDir)
         {
             string lfname = ParentViewFolder.MakeNiceName(pathName);
             int    index  = IndexOf(this.folders, lfname);
             if (index == -1)
             {
                 ParentViewFolder item = new ParentViewFolder(lfname, guid, changeFlags);
                 ArrayUtility.Add <ParentViewFolder>(ref this.folders, item);
             }
             else
             {
                 this.folders[index].changeFlags = changeFlags;
                 this.folders[index].guid        = guid;
             }
         }
         else
         {
             ParentViewFolder folder2;
             string           str2 = ParentViewFolder.MakeNiceName(FileUtil.DeleteLastPathNameComponent(pathName));
             string           str3 = pathName.Substring(pathName.LastIndexOf("/") + 1);
             int num2 = IndexOf(this.folders, str2);
             if (num2 == -1)
             {
                 folder2 = new ParentViewFolder(str2, AssetServer.GetParentGUID(guid, changeset));
                 ArrayUtility.Add <ParentViewFolder>(ref this.folders, folder2);
             }
             else
             {
                 folder2 = this.folders[num2];
             }
             num2 = IndexOf(folder2.files, str3);
             if (num2 != -1)
             {
                 if ((folder2.files[num2].changeFlags & ChangeFlags.Deleted) == ChangeFlags.None)
                 {
                     folder2.files[num2].guid        = guid;
                     folder2.files[num2].changeFlags = changeFlags;
                 }
             }
             else
             {
                 ArrayUtility.Add <ParentViewFile>(ref folder2.files, new ParentViewFile(str3, guid, changeFlags));
             }
         }
     }
 }
示例#4
0
        public ASUpdateConflictResolveWindow(string[] conflicting)
        {
            this.downloadConflictsToResolve = 0;
            ArrayList arrayList  = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            ArrayList arrayList3 = new ArrayList();
            ArrayList arrayList4 = new ArrayList();

            for (int i = 0; i < conflicting.Length; i++)
            {
                AssetStatus statusGUID = AssetServer.GetStatusGUID(conflicting[i]);
                if (statusGUID == AssetStatus.Conflict)
                {
                    arrayList.Add(conflicting[i]);
                    DownloadResolution downloadResolution = AssetServer.GetDownloadResolution(conflicting[i]);
                    arrayList2.Add(downloadResolution);
                    if (downloadResolution == DownloadResolution.Unresolved)
                    {
                        this.downloadConflictsToResolve++;
                    }
                }
                if (AssetServer.GetPathNameConflict(conflicting[i]) != null && statusGUID != AssetStatus.ServerOnly)
                {
                    arrayList4.Add(conflicting[i]);
                    NameConflictResolution nameConflictResolution = AssetServer.GetNameConflictResolution(conflicting[i]);
                    arrayList3.Add(nameConflictResolution);
                    if (nameConflictResolution == NameConflictResolution.Unresolved)
                    {
                        this.downloadConflictsToResolve++;
                    }
                }
            }
            this.downloadConflicts    = (arrayList.ToArray(typeof(string)) as string[]);
            this.downloadResolutions  = (arrayList2.ToArray(typeof(DownloadResolution)) as DownloadResolution[]);
            this.namingResolutions    = (arrayList3.ToArray(typeof(NameConflictResolution)) as NameConflictResolution[]);
            this.nameConflicts        = (arrayList4.ToArray(typeof(string)) as string[]);
            this.enableContinueButton = (this.downloadConflictsToResolve == 0);
            this.dConflictPaths       = new string[this.downloadConflicts.Length];
            this.deletionConflict     = new bool[this.downloadConflicts.Length];
            for (int j = 0; j < this.downloadConflicts.Length; j++)
            {
                if (AssetServer.HasDeletionConflict(this.downloadConflicts[j]))
                {
                    this.dConflictPaths[j]   = ParentViewFolder.MakeNiceName(AssetServer.GetDeletedItemPathAndName(this.downloadConflicts[j]));
                    this.deletionConflict[j] = true;
                }
                else
                {
                    this.dConflictPaths[j]   = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.downloadConflicts[j]));
                    this.deletionConflict[j] = false;
                }
            }
            this.dNamingPaths = new string[this.nameConflicts.Length];
            for (int k = 0; k < this.nameConflicts.Length; k++)
            {
                this.dNamingPaths[k] = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.nameConflicts[k]));
            }
            this.showDownloadConflicts = (this.downloadConflicts.Length > 0);
            this.showNamingConflicts   = (this.nameConflicts.Length > 0);
            this.lv1.totalRows         = this.downloadConflicts.Length;
            this.lv2.totalRows         = this.nameConflicts.Length;
            this.selectedLV1Items      = new bool[this.downloadConflicts.Length];
            this.selectedLV2Items      = new bool[this.nameConflicts.Length];
            this.DoSelectionChange();
        }
示例#5
0
        public ASUpdateConflictResolveWindow(string[] conflicting)
        {
            float[] relativeSizes = new float[] { 20f, 80f };
            int[]   minSizes      = new int[] { 100, 100 };
            this.lvHeaderSplit1 = new SplitterState(relativeSizes, minSizes, null);
            float[] singleArray2 = new float[] { 20f, 80f };
            int[]   numArray2    = new int[] { 100, 100 };
            this.lvHeaderSplit2             = new SplitterState(singleArray2, numArray2, null);
            this.dropDownMenuItems          = new string[] { "Compare", "Compare Binary" };
            this.downloadConflicts          = new string[0];
            this.nameConflicts              = new string[0];
            this.dConflictPaths             = new string[0];
            this.dNamingPaths               = new string[0];
            this.downloadResolutions        = new DownloadResolution[0];
            this.namingResolutions          = new NameConflictResolution[0];
            this.enableMergeButton          = true;
            this.iconSize                   = new Vector2(16f, 16f);
            this.downloadResolutionString   = new string[] { "Unresolved", "Skip Asset", "Discard My Changes", "Ignore Server Changes", "Merge" };
            this.namingResolutionString     = new string[] { "Unresolved", "Rename Local Asset", "Rename Server Asset" };
            this.downloadConflictsToResolve = 0;
            ArrayList list  = new ArrayList();
            ArrayList list2 = new ArrayList();
            ArrayList list3 = new ArrayList();
            ArrayList list4 = new ArrayList();

            for (int i = 0; i < conflicting.Length; i++)
            {
                AssetStatus statusGUID = AssetServer.GetStatusGUID(conflicting[i]);
                if (statusGUID == AssetStatus.Conflict)
                {
                    list.Add(conflicting[i]);
                    DownloadResolution downloadResolution = AssetServer.GetDownloadResolution(conflicting[i]);
                    list2.Add(downloadResolution);
                    if (downloadResolution == DownloadResolution.Unresolved)
                    {
                        this.downloadConflictsToResolve++;
                    }
                }
                if ((AssetServer.GetPathNameConflict(conflicting[i]) != null) && (statusGUID != AssetStatus.ServerOnly))
                {
                    list4.Add(conflicting[i]);
                    NameConflictResolution nameConflictResolution = AssetServer.GetNameConflictResolution(conflicting[i]);
                    list3.Add(nameConflictResolution);
                    if (nameConflictResolution == NameConflictResolution.Unresolved)
                    {
                        this.downloadConflictsToResolve++;
                    }
                }
            }
            this.downloadConflicts    = list.ToArray(typeof(string)) as string[];
            this.downloadResolutions  = list2.ToArray(typeof(DownloadResolution)) as DownloadResolution[];
            this.namingResolutions    = list3.ToArray(typeof(NameConflictResolution)) as NameConflictResolution[];
            this.nameConflicts        = list4.ToArray(typeof(string)) as string[];
            this.enableContinueButton = this.downloadConflictsToResolve == 0;
            this.dConflictPaths       = new string[this.downloadConflicts.Length];
            this.deletionConflict     = new bool[this.downloadConflicts.Length];
            for (int j = 0; j < this.downloadConflicts.Length; j++)
            {
                if (AssetServer.HasDeletionConflict(this.downloadConflicts[j]))
                {
                    this.dConflictPaths[j]   = ParentViewFolder.MakeNiceName(AssetServer.GetDeletedItemPathAndName(this.downloadConflicts[j]));
                    this.deletionConflict[j] = true;
                }
                else
                {
                    this.dConflictPaths[j]   = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.downloadConflicts[j]));
                    this.deletionConflict[j] = false;
                }
            }
            this.dNamingPaths = new string[this.nameConflicts.Length];
            for (int k = 0; k < this.nameConflicts.Length; k++)
            {
                this.dNamingPaths[k] = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.nameConflicts[k]));
            }
            this.showDownloadConflicts = this.downloadConflicts.Length > 0;
            this.showNamingConflicts   = this.nameConflicts.Length > 0;
            this.lv1.totalRows         = this.downloadConflicts.Length;
            this.lv2.totalRows         = this.nameConflicts.Length;
            this.selectedLV1Items      = new bool[this.downloadConflicts.Length];
            this.selectedLV2Items      = new bool[this.nameConflicts.Length];
            this.DoSelectionChange();
        }
        public ASUpdateConflictResolveWindow(string[] conflicting)
        {
            this.downloadConflictsToResolve = 0;
            ArrayList arrayList1 = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            ArrayList arrayList3 = new ArrayList();
            ArrayList arrayList4 = new ArrayList();

            for (int index = 0; index < conflicting.Length; ++index)
            {
                AssetStatus statusGuid = AssetServer.GetStatusGUID(conflicting[index]);
                if (statusGuid == AssetStatus.Conflict)
                {
                    arrayList1.Add((object)conflicting[index]);
                    DownloadResolution downloadResolution = AssetServer.GetDownloadResolution(conflicting[index]);
                    arrayList2.Add((object)downloadResolution);
                    if (downloadResolution == DownloadResolution.Unresolved)
                    {
                        ++this.downloadConflictsToResolve;
                    }
                }
                if (AssetServer.GetPathNameConflict(conflicting[index]) != null && statusGuid != AssetStatus.ServerOnly)
                {
                    arrayList4.Add((object)conflicting[index]);
                    NameConflictResolution conflictResolution = AssetServer.GetNameConflictResolution(conflicting[index]);
                    arrayList3.Add((object)conflictResolution);
                    if (conflictResolution == NameConflictResolution.Unresolved)
                    {
                        ++this.downloadConflictsToResolve;
                    }
                }
            }
            this.downloadConflicts    = arrayList1.ToArray(typeof(string)) as string[];
            this.downloadResolutions  = arrayList2.ToArray(typeof(DownloadResolution)) as DownloadResolution[];
            this.namingResolutions    = arrayList3.ToArray(typeof(NameConflictResolution)) as NameConflictResolution[];
            this.nameConflicts        = arrayList4.ToArray(typeof(string)) as string[];
            this.enableContinueButton = this.downloadConflictsToResolve == 0;
            this.dConflictPaths       = new string[this.downloadConflicts.Length];
            this.deletionConflict     = new bool[this.downloadConflicts.Length];
            for (int index = 0; index < this.downloadConflicts.Length; ++index)
            {
                if (AssetServer.HasDeletionConflict(this.downloadConflicts[index]))
                {
                    this.dConflictPaths[index]   = ParentViewFolder.MakeNiceName(AssetServer.GetDeletedItemPathAndName(this.downloadConflicts[index]));
                    this.deletionConflict[index] = true;
                }
                else
                {
                    this.dConflictPaths[index]   = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.downloadConflicts[index]));
                    this.deletionConflict[index] = false;
                }
            }
            this.dNamingPaths = new string[this.nameConflicts.Length];
            for (int index = 0; index < this.nameConflicts.Length; ++index)
            {
                this.dNamingPaths[index] = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.nameConflicts[index]));
            }
            this.showDownloadConflicts = this.downloadConflicts.Length > 0;
            this.showNamingConflicts   = this.nameConflicts.Length > 0;
            this.lv1.totalRows         = this.downloadConflicts.Length;
            this.lv2.totalRows         = this.nameConflicts.Length;
            this.selectedLV1Items      = new bool[this.downloadConflicts.Length];
            this.selectedLV2Items      = new bool[this.nameConflicts.Length];
            this.DoSelectionChange();
        }