ObjectItemCachedAssemblyLoader.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / ObjectLayer / ObjectItemCachedAssemblyLoader.cs / 1305376 / ObjectItemCachedAssemblyLoader.cs

                            //---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// 
// @owner       [....]
// @backupOwner [....] 
//--------------------------------------------------------------------- 

 
using System.Reflection;
using System.Data.Entity;

namespace System.Data.Metadata.Edm 
{
    internal sealed class ObjectItemCachedAssemblyLoader : ObjectItemAssemblyLoader 
    { 
        private new ImmutableAssemblyCacheEntry CacheEntry { get { return (ImmutableAssemblyCacheEntry)base.CacheEntry; } }
 
        internal ObjectItemCachedAssemblyLoader(Assembly assembly, ImmutableAssemblyCacheEntry cacheEntry, ObjectItemLoadingSessionData sessionData)
            : base(assembly, cacheEntry, sessionData)
        {
        } 

        protected override void AddToAssembliesLoaded() 
        { 
            // wasn't loaded, was pulled from cache instead
            // so don't load it 
        }


        protected override void LoadTypesFromAssembly() 
        {
            foreach (EdmType type in CacheEntry.TypesInAssembly) 
            { 
                if (!SessionData.TypesInLoading.ContainsKey(type.Identity))
                { 
                    SessionData.TypesInLoading.Add(type.Identity, type);
                }
            }
        } 

 
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// 
// @owner       [....]
// @backupOwner [....] 
//--------------------------------------------------------------------- 

 
using System.Reflection;
using System.Data.Entity;

namespace System.Data.Metadata.Edm 
{
    internal sealed class ObjectItemCachedAssemblyLoader : ObjectItemAssemblyLoader 
    { 
        private new ImmutableAssemblyCacheEntry CacheEntry { get { return (ImmutableAssemblyCacheEntry)base.CacheEntry; } }
 
        internal ObjectItemCachedAssemblyLoader(Assembly assembly, ImmutableAssemblyCacheEntry cacheEntry, ObjectItemLoadingSessionData sessionData)
            : base(assembly, cacheEntry, sessionData)
        {
        } 

        protected override void AddToAssembliesLoaded() 
        { 
            // wasn't loaded, was pulled from cache instead
            // so don't load it 
        }


        protected override void LoadTypesFromAssembly() 
        {
            foreach (EdmType type in CacheEntry.TypesInAssembly) 
            { 
                if (!SessionData.TypesInLoading.ContainsKey(type.Identity))
                { 
                    SessionData.TypesInLoading.Add(type.Identity, type);
                }
            }
        } 

 
    } 
}

// 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