EdmItemCollection.OcAssemblyCache.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / EdmItemCollection.OcAssemblyCache.cs / 1305376 / EdmItemCollection.OcAssemblyCache.cs

                            //---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// 
// @owner       [....]
// @backupOwner [....] 
//--------------------------------------------------------------------- 
using System.Collections.Generic;
using System.Reflection; 

namespace System.Data.Metadata.Edm
{
    internal class OcAssemblyCache 
    {
        ///  
        /// cache for loaded assembly 
        /// 
        private Dictionary _conventionalOcCache; 

        internal OcAssemblyCache()
        {
            _conventionalOcCache = new Dictionary(); 
        }
 
        ///  
        /// Please do NOT call this method outside of AssemblyCache. Since AssemblyCache maintain the lock,
        /// this method doesn't provide any locking mechanism. 
        /// 
        /// 
        /// 
        ///  
        internal bool TryGetConventionalOcCacheFromAssemblyCache(Assembly assemblyToLookup, out ImmutableAssemblyCacheEntry cacheEntry)
        { 
            cacheEntry = null; 
            return _conventionalOcCache.TryGetValue(assemblyToLookup, out cacheEntry);
        } 

        /// 
        /// Please do NOT call this method outside of AssemblyCache. Since AssemblyCache maintain the lock,
        /// this method doesn't provide any locking mechanism. 
        /// 
        ///  
        ///  
        internal void AddAssemblyToOcCacheFromAssemblyCache(Assembly assembly, ImmutableAssemblyCacheEntry cacheEntry)
        { 
            if (_conventionalOcCache.ContainsKey(assembly))
            {
                // we shouldn't update the cache if we already have one
                return; 
            }
            _conventionalOcCache.Add(assembly, cacheEntry); 
        } 

    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK