Ejemplo n.º 1
0
        internal static IAlbum Get(ISession session, IntPtr handle)
        {
            lock (_instanceLock)
            {
                NativeAlbum instance;

                if (!_instances.TryGetValue(handle, out instance))
                {
                    instance = new NativeAlbum(session, handle);
                    _instances.Add(handle, instance);
                    instance.Initialize();
                }

                return instance;
            }
        }
Ejemplo n.º 2
0
        internal static IAlbum Get(ISession session, IntPtr handle)
        {
            lock (_instanceLock)
            {
                NativeAlbum album;

                if (_instances.TryGetValue(handle, out album))
                {
                    return album;
                }

                album = new NativeAlbum(session, handle);
                album.Initialize();

                if (SessionFactory.IsInternalCachingEnabled)
                {
                    _instances.SetValue(handle, album);
                }

                return album;
            }
        }