void AsyncCalculateStatus(CancelToken cancelToken) { Dictionary <string, AssetStatus> statusByPathCache = null; IThreadWaiter waiter = ThreadWaiter.GetWaiter(50); waiter.Execute( /*threadOperationDelegate*/ delegate { OutOfDateItems outOfDateItems = OutOfDateUpdater.CalculateOutOfDateItems( mWkInfo, new List <ErrorMessage>(), OutOfDateCalculator.Options.IsIncomingChanges); if (cancelToken.IsCancelled()) { return; } statusByPathCache = BuildStatusByPathCache. ForOutOfDateItems(outOfDateItems, mWkInfo.ClientPath); }, /*afterOperationDelegate*/ delegate { if (waiter.Exception != null) { ExceptionsHandler.LogException( "RemoteStatusCache", waiter.Exception); return; } if (cancelToken.IsCancelled()) { return; } lock (mLock) { mStatusByPathCache = statusByPathCache; } mRepaintProjectWindow(); }); }
internal static Dictionary <string, AssetStatus> ForOutOfDateItems( OutOfDateItems outOfDateItems, string wkPath) { Dictionary <string, AssetStatus> result = BuildPathDictionary.ForPlatform <AssetStatus>(); if (outOfDateItems == null) { return(result); } foreach (OutOfDateItemsByMount diffs in outOfDateItems.GetOutOfDateItemsByMountList()) { foreach (Difference diff in diffs.Changed) { if (diff is DiffXlinkChanged) { continue; } string path = GetPathForDiff(wkPath, diffs.Mount, diff.Path); result.Add(path, AssetStatus.OutOfDate); } foreach (Difference diff in diffs.Deleted) { string path = GetPathForDiff(wkPath, diffs.Mount, diff.Path); result.Add(path, AssetStatus.DeletedOnServer); } } foreach (GluonFileConflict fileConflict in outOfDateItems.GetFileConflicts()) { string path = GetPathForConflict(wkPath, fileConflict.CmPath); result.Add(path, AssetStatus.Conflicted); } return(result); }