Няма описание
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AssetStatusCache.cs 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using Codice.CM.Common;
  2. namespace Unity.PlasticSCM.Editor.AssetsOverlays.Cache
  3. {
  4. internal interface IAssetStatusCache
  5. {
  6. AssetStatus GetStatus(string fullPath);
  7. LockStatusData GetLockStatusData(string fullPath);
  8. void Clear();
  9. }
  10. internal class AssetStatusCache : IAssetStatusCache
  11. {
  12. internal AssetStatusCache(
  13. WorkspaceInfo wkInfo,
  14. bool isGluonMode)
  15. {
  16. mLocalStatusCache = new LocalStatusCache(wkInfo);
  17. mRemoteStatusCache = new RemoteStatusCache(
  18. wkInfo,
  19. isGluonMode,
  20. ProjectWindow.Repaint);
  21. mLockStatusCache = new LockStatusCache(
  22. wkInfo,
  23. ProjectWindow.Repaint);
  24. }
  25. AssetStatus IAssetStatusCache.GetStatus(string fullPath)
  26. {
  27. AssetStatus localStatus = mLocalStatusCache.GetStatus(fullPath);
  28. if (!ClassifyAssetStatus.IsControlled(localStatus))
  29. return localStatus;
  30. AssetStatus remoteStatus = mRemoteStatusCache.GetStatus(fullPath);
  31. AssetStatus lockStatus = mLockStatusCache.GetStatus(fullPath);
  32. return localStatus | remoteStatus | lockStatus;
  33. }
  34. LockStatusData IAssetStatusCache.GetLockStatusData(string fullPath)
  35. {
  36. return mLockStatusCache.GetLockStatusData(fullPath);
  37. }
  38. void IAssetStatusCache.Clear()
  39. {
  40. mLocalStatusCache.Clear();
  41. mRemoteStatusCache.Clear();
  42. mLockStatusCache.Clear();
  43. }
  44. readonly LocalStatusCache mLocalStatusCache;
  45. readonly RemoteStatusCache mRemoteStatusCache;
  46. readonly LockStatusCache mLockStatusCache;
  47. }
  48. }