Exemplo n.º 1
0
        public void InvalidateCacheFor(IPsiSourceFile sourceFile)
        {
            myShellLocks.AssertWriteAccessAllowed();
            var guid = myMetaFileGuidCache.GetAssetGuid(sourceFile);

            if (guid == null) // we have already clear content due to advice on GuidChanged in consructor
            {
                return;
            }

            var visited = new HashSet <Guid>();

            foreach (var deps in myDependencies.GetValuesSafe(guid.Value))
            {
                InvalidateImportCache(deps, visited);
            }

            InvalidateImportCache(guid.Value, visited);
        }
        public void Remove(IPsiSourceFile sourceFile, AssetDocumentHierarchyElement assetDocumentHierarchyElement)
        {
            myShellLocks.AssertWriteAccessAllowed();
            var guid = myMetaFileGuidCache.GetAssetGuid(sourceFile);

            if (guid == null) // we have already clear content due to advice on GuidChanged in consructor
            {
                return;
            }

            var visited = new HashSet <string>();

            foreach (var deps in myDependencies.GetValuesSafe(guid))
            {
                InvalidateImportCache(deps, visited);
            }

            InvalidateImportCache(guid, visited);
        }
        public IAssetValue GetUniqueValueDifferTo(Guid guid, IEnumerable <string> possibleNames, IAssetValue assetValue)
        {
            myShellLocks.AssertReadAccessAllowed();

            var result = new List <IAssetValue>();

            foreach (var possibleName in possibleNames)
            {
                var mbField = new MonoBehaviourField(guid, possibleName.GetPlatformIndependentHashCode());
                foreach (var value in myUniqueValuesInstances.GetValuesSafe(mbField))
                {
                    result.Add(value);
                }
            }

            Assertion.Assert(result.Count <= 2, "result.Count <= 2");
            if (assetValue == null)
            {
                return(result.First());
            }
            return(result.First(t => !t.Equals(assetValue)));
        }