Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Serialization / System / Runtime / Serialization / HybridObjectCache.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ImportContext.cs
- CornerRadius.cs
- GacUtil.cs
- HtmlInputPassword.cs
- XmlDataSourceView.cs
- CodeNamespaceImport.cs
- AppSettingsSection.cs
- StoreAnnotationsMap.cs
- AutomationPeer.cs
- AssociationEndMember.cs
- SelectionRangeConverter.cs
- DataMemberConverter.cs
- ZeroOpNode.cs
- COM2Enum.cs
- SessionEndingEventArgs.cs
- RemoteDebugger.cs
- XPathDocumentBuilder.cs
- ClientOptions.cs
- DocumentCollection.cs
- HtmlListAdapter.cs
- FixedSOMLineCollection.cs
- TemplateColumn.cs
- AnimationTimeline.cs
- TraceHelpers.cs
- MultiTrigger.cs
- EtwTrace.cs
- CdpEqualityComparer.cs
- PauseStoryboard.cs
- PackageRelationship.cs
- CommandField.cs
- cookiecollection.cs
- IUnknownConstantAttribute.cs
- Single.cs
- DataGridViewButtonCell.cs
- FixedSOMTable.cs
- SqlUserDefinedAggregateAttribute.cs
- coordinatorfactory.cs
- XmlQueryOutput.cs
- CanonicalFontFamilyReference.cs
- NavigationHelper.cs
- BulletDecorator.cs
- ReadOnlyPermissionSet.cs
- TextBoxAutoCompleteSourceConverter.cs
- RowUpdatedEventArgs.cs
- recordstatefactory.cs
- ObjectContext.cs
- FormViewCommandEventArgs.cs
- SpeakCompletedEventArgs.cs
- RSACryptoServiceProvider.cs
- FixedSOMPage.cs
- RootAction.cs
- _SafeNetHandles.cs
- WebPartAddingEventArgs.cs
- DeleteMemberBinder.cs
- InputMethod.cs
- ExtensionFile.cs
- TextMessageEncodingElement.cs
- PolyLineSegmentFigureLogic.cs
- Oid.cs
- XmlObjectSerializerReadContext.cs
- InheritablePropertyChangeInfo.cs
- ClientSponsor.cs
- SQLString.cs
- TransformValueSerializer.cs
- XhtmlTextWriter.cs
- assemblycache.cs
- Int16Animation.cs
- DocumentPage.cs
- RecognizerBase.cs
- MobileControl.cs
- SupportingTokenAuthenticatorSpecification.cs
- PauseStoryboard.cs
- DocumentationServerProtocol.cs
- OdbcParameter.cs
- XhtmlConformanceSection.cs
- ToolStripItemCollection.cs
- NonSerializedAttribute.cs
- SqlFacetAttribute.cs
- Subtree.cs
- XmlCodeExporter.cs
- FolderLevelBuildProviderCollection.cs
- BindingCompleteEventArgs.cs
- ProgressBar.cs
- RelatedCurrencyManager.cs
- tooltip.cs
- SafeNativeMethods.cs
- WebConfigurationHost.cs
- StringResourceManager.cs
- WebControlsSection.cs
- HitTestWithGeometryDrawingContextWalker.cs
- FileInfo.cs
- ReadOnlyNameValueCollection.cs
- TagPrefixCollection.cs
- IProvider.cs
- StrokeCollection.cs
- DefinitionBase.cs
- SqlVisitor.cs
- ErrorEventArgs.cs
- AudioFormatConverter.cs
- wgx_sdk_version.cs