Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / Serialization / System / Runtime / Serialization / HybridObjectCache.cs / 2 / HybridObjectCache.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.Runtime.Serialization { using System; using System.Xml; using System.Collections.Generic; internal class HybridObjectCache { DictionaryobjectDictionary; Dictionary referencedObjectDictionary; internal HybridObjectCache() { } internal void Add(string id, object obj) { if (objectDictionary == null) objectDictionary = new Dictionary (); object existingObject; if (objectDictionary.TryGetValue(id, out existingObject)) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.MultipleIdDefinition, id))); objectDictionary.Add(id, obj); } internal void Remove(string id) { if (objectDictionary != null) objectDictionary.Remove(id); } internal object GetObject(string id) { if (referencedObjectDictionary == null) { referencedObjectDictionary = new Dictionary (); referencedObjectDictionary.Add(id, null); } else if (!referencedObjectDictionary.ContainsKey(id)) { referencedObjectDictionary.Add(id, null); } if (objectDictionary != null) { object obj; objectDictionary.TryGetValue(id, out obj); return obj; } return null; } internal bool IsObjectReferenced(string id) { if (referencedObjectDictionary != null) { return referencedObjectDictionary.ContainsKey(id); } return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RedBlackList.cs
- CornerRadiusConverter.cs
- ModulesEntry.cs
- HandlerBase.cs
- PassportAuthenticationEventArgs.cs
- OletxEnlistment.cs
- DataList.cs
- ContextStack.cs
- EditCommandColumn.cs
- ResourceReferenceKeyNotFoundException.cs
- CanonicalFormWriter.cs
- ControlParser.cs
- FlatButtonAppearance.cs
- MonitoringDescriptionAttribute.cs
- UpdateException.cs
- altserialization.cs
- FileDataSource.cs
- SmiMetaData.cs
- PartManifestEntry.cs
- ObjectList.cs
- BitmapEffectGroup.cs
- Parser.cs
- SpanIndex.cs
- SplitterEvent.cs
- ErrorHandlerModule.cs
- DomainUpDown.cs
- _emptywebproxy.cs
- HandlerBase.cs
- BinaryCommonClasses.cs
- AuthorizationContext.cs
- iisPickupDirectory.cs
- AppDomainUnloadedException.cs
- TimeSpanValidator.cs
- CustomAttributeSerializer.cs
- SqlCacheDependency.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- CellQuery.cs
- TextBox.cs
- LineBreakRecord.cs
- UrlMappingsModule.cs
- AssemblyResourceLoader.cs
- PageThemeCodeDomTreeGenerator.cs
- SizeChangedEventArgs.cs
- LoadMessageLogger.cs
- FileDataSourceCache.cs
- WinFormsComponentEditor.cs
- MobileUserControlDesigner.cs
- Compiler.cs
- JobPageOrder.cs
- FileClassifier.cs
- ThreadPool.cs
- SortedSetDebugView.cs
- XmlSubtreeReader.cs
- XmlILOptimizerVisitor.cs
- TreeViewEvent.cs
- DetailsViewDeletedEventArgs.cs
- Validator.cs
- StreamUpgradeAcceptor.cs
- HttpHandlersSection.cs
- SerializerDescriptor.cs
- DeferredRunTextReference.cs
- EntitySetBaseCollection.cs
- HttpChannelHelpers.cs
- IndexedString.cs
- ProxyHelper.cs
- WmlControlAdapter.cs
- ConfigurationSectionGroup.cs
- Baml2006Reader.cs
- ToolStripMenuItem.cs
- KeyGesture.cs
- GetPageCompletedEventArgs.cs
- SymbolEqualComparer.cs
- ClassValidator.cs
- SafeRightsManagementHandle.cs
- _SingleItemRequestCache.cs
- remotingproxy.cs
- PrePostDescendentsWalker.cs
- DetailsView.cs
- HttpResponseInternalBase.cs
- MetadataArtifactLoaderFile.cs
- ComPlusSynchronizationContext.cs
- ManagementPath.cs
- DataTrigger.cs
- BindingRestrictions.cs
- JulianCalendar.cs
- SecurityUtils.cs
- FormView.cs
- MdiWindowListStrip.cs
- HandleValueEditor.cs
- PropertyRecord.cs
- CommunicationObject.cs
- controlskin.cs
- Debugger.cs
- SafeMILHandle.cs
- CacheMemory.cs
- EncoderExceptionFallback.cs
- infer.cs
- DataServiceRequestOfT.cs
- ZipIOExtraField.cs
- ScrollBarAutomationPeer.cs