HasDeletionConflict() private method

private HasDeletionConflict ( string guid ) : bool
guid string
return bool
示例#1
0
        private bool DoShowDiff(bool binary)
        {
            List <string>      list  = new List <string>();
            List <CompareInfo> list2 = new List <CompareInfo>();

            for (int i = 0; i < this.selectedLV1Items.Length; i++)
            {
                if (this.selectedLV1Items[i])
                {
                    int serverItemChangeset = AssetServer.GetServerItemChangeset(this.downloadConflicts[i], -1);
                    int ver = (!AssetServer.HasDeletionConflict(this.downloadConflicts[i])) ? -1 : -2;
                    list.Add(this.downloadConflicts[i]);
                    list2.Add(new CompareInfo(serverItemChangeset, ver, (!binary) ? 0 : 1, (!binary) ? 1 : 0));
                }
            }
            bool result;

            if (list.Count != 0)
            {
                AssetServer.CompareFiles(list.ToArray(), list2.ToArray());
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }
        private bool DoShowDiff(bool binary)
        {
            List <string>      stringList      = new List <string>();
            List <CompareInfo> compareInfoList = new List <CompareInfo>();

            for (int index = 0; index < this.selectedLV1Items.Length; ++index)
            {
                if (this.selectedLV1Items[index])
                {
                    int serverItemChangeset = AssetServer.GetServerItemChangeset(this.downloadConflicts[index], -1);
                    int ver2 = !AssetServer.HasDeletionConflict(this.downloadConflicts[index]) ? -1 : -2;
                    stringList.Add(this.downloadConflicts[index]);
                    compareInfoList.Add(new CompareInfo(serverItemChangeset, ver2, !binary ? 0 : 1, !binary ? 1 : 0));
                }
            }
            if (stringList.Count == 0)
            {
                return(false);
            }
            AssetServer.CompareFiles(stringList.ToArray(), compareInfoList.ToArray());
            return(true);
        }
示例#3
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();
        }
示例#4
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();
        }