Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------- //// 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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UnsafeNativeMethods.cs
- HttpCapabilitiesSectionHandler.cs
- ExtendedPropertyInfo.cs
- ContextDataSourceView.cs
- PhysicalAddress.cs
- ContentHostHelper.cs
- CipherData.cs
- SoapHeaderException.cs
- BindingManagerDataErrorEventArgs.cs
- PropertiesTab.cs
- TypeLoadException.cs
- WindowsListViewGroupHelper.cs
- DirectoryInfo.cs
- DirectoryObjectSecurity.cs
- TimeSpanOrInfiniteConverter.cs
- Formatter.cs
- PrimitiveCodeDomSerializer.cs
- ContentElement.cs
- ImageInfo.cs
- FileNotFoundException.cs
- FixedSOMPageConstructor.cs
- BitmapCodecInfo.cs
- DispatcherHooks.cs
- VideoDrawing.cs
- BoolExpressionVisitors.cs
- JavaScriptSerializer.cs
- ISAPIApplicationHost.cs
- IisTraceListener.cs
- QilParameter.cs
- TdsValueSetter.cs
- SystemIPAddressInformation.cs
- SqlCacheDependency.cs
- MemberPath.cs
- ASCIIEncoding.cs
- TraceUtils.cs
- PipelineDeploymentState.cs
- TypeElement.cs
- ThreadStartException.cs
- TextBoxView.cs
- IndicCharClassifier.cs
- WsatAdminException.cs
- LocalValueEnumerator.cs
- ConfigurationSettings.cs
- xmlglyphRunInfo.cs
- WebPartConnectionsConfigureVerb.cs
- FlagsAttribute.cs
- SoapFormatter.cs
- PageCodeDomTreeGenerator.cs
- HttpCachePolicy.cs
- CodeObjectCreateExpression.cs
- Wizard.cs
- IconHelper.cs
- FlagPanel.cs
- externdll.cs
- TextEffectCollection.cs
- DataGridViewDesigner.cs
- MultiPageTextView.cs
- Marshal.cs
- serverconfig.cs
- BackgroundWorker.cs
- UnsafeNativeMethods.cs
- ListBoxItemAutomationPeer.cs
- NumberFormatter.cs
- MsmqIntegrationElement.cs
- NavigationProgressEventArgs.cs
- DataRelationCollection.cs
- TdsParser.cs
- HttpInputStream.cs
- CustomErrorCollection.cs
- ImageListUtils.cs
- BitmapEffectDrawing.cs
- InvokeProviderWrapper.cs
- CompiledQuery.cs
- ValidationErrorEventArgs.cs
- AsyncCodeActivity.cs
- PropertyChangedEventArgs.cs
- WorkflowApplicationEventArgs.cs
- PropertyValueChangedEvent.cs
- AvTrace.cs
- CollectionContainer.cs
- DetailsViewDeleteEventArgs.cs
- KerberosTicketHashIdentifierClause.cs
- GatewayIPAddressInformationCollection.cs
- XmlProcessingInstruction.cs
- CodeDomConfigurationHandler.cs
- CryptoKeySecurity.cs
- dataSvcMapFileLoader.cs
- TargetControlTypeAttribute.cs
- METAHEADER.cs
- CommandBinding.cs
- UnitySerializationHolder.cs
- CodeTryCatchFinallyStatement.cs
- ListViewGroupConverter.cs
- Base64WriteStateInfo.cs
- TextCompositionManager.cs
- _SslSessionsCache.cs
- NonceCache.cs
- CodeDomConfigurationHandler.cs
- AnimatedTypeHelpers.cs
- EmptyReadOnlyDictionaryInternal.cs