Esempio n. 1
0
        public ITypedStream GetTypedStream(OpenMode mode, Type t)
        {
            lock (SyncRoot)
            {
                AssertNotDisposed();
                if (mode != OpenMode.Read)
                {
                    AssertCurrentVersion();
                }

                // We first check streams in cache, then try to load.
                ManagedTypedStream stream = GetCachedTypedStream(t.FullName, mode);
                if (stream != null)
                {
                    return(stream);
                }

                // We can also check in base node.
                ManagedNode b = CacheBase();
                if (b != null)
                {
                    return(b.GetTypedStream(mode, t));
                }
                return(null);
            }
        }