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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Baml2006ReaderFrame.cs
- Encoder.cs
- XPathPatternBuilder.cs
- WpfGeneratedKnownProperties.cs
- SchemaObjectWriter.cs
- _DomainName.cs
- IdentityReference.cs
- EnumerableRowCollection.cs
- GridViewAutoFormat.cs
- DirectoryObjectSecurity.cs
- XmlSchemaCompilationSettings.cs
- WorkflowExecutor.cs
- SqlTypesSchemaImporter.cs
- IsolatedStorageFilePermission.cs
- MessageFault.cs
- CodeArgumentReferenceExpression.cs
- TCEAdapterGenerator.cs
- DebugView.cs
- DependencyObjectPropertyDescriptor.cs
- shaperfactoryquerycacheentry.cs
- TraceHandler.cs
- KeyInterop.cs
- ProxyWebPart.cs
- WsdlBuildProvider.cs
- RuleRefElement.cs
- FontStretch.cs
- ExpressionEditorAttribute.cs
- SQLDecimal.cs
- DrawingBrush.cs
- DesignerRegionCollection.cs
- ISSmlParser.cs
- TimelineClockCollection.cs
- WindowsPrincipal.cs
- DisposableCollectionWrapper.cs
- ColorDialog.cs
- FocusChangedEventArgs.cs
- BasicCellRelation.cs
- recordstate.cs
- ObjectAnimationUsingKeyFrames.cs
- TextDecorationCollection.cs
- Block.cs
- DataGridState.cs
- TextEditor.cs
- ContextMenuStripGroup.cs
- Cursor.cs
- PointHitTestResult.cs
- ConnectionInterfaceCollection.cs
- NamespaceEmitter.cs
- StdValidatorsAndConverters.cs
- DataGridViewColumnHeaderCell.cs
- QuaternionAnimationUsingKeyFrames.cs
- SerTrace.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- XmlExceptionHelper.cs
- ComponentEvent.cs
- SvcFileManager.cs
- TreeNodeCollection.cs
- util.cs
- DataBindingExpressionBuilder.cs
- WebHttpDispatchOperationSelectorData.cs
- Clipboard.cs
- TimelineGroup.cs
- ParentQuery.cs
- Frame.cs
- WriteTimeStream.cs
- ScriptResourceInfo.cs
- WindowsComboBox.cs
- SystemResourceKey.cs
- EntryWrittenEventArgs.cs
- Guid.cs
- QualificationDataAttribute.cs
- LocatorPartList.cs
- DefaultBindingPropertyAttribute.cs
- JpegBitmapEncoder.cs
- DrawListViewItemEventArgs.cs
- RemoteWebConfigurationHostStream.cs
- DataGridViewRow.cs
- ManagedFilter.cs
- MemberDomainMap.cs
- CodeTypeReferenceExpression.cs
- Point3DAnimation.cs
- PathFigureCollectionValueSerializer.cs
- LocatorPartList.cs
- XmlBindingWorker.cs
- RuleProcessor.cs
- XmlAttributeAttribute.cs
- Delegate.cs
- XmlSchemaComplexContentExtension.cs
- DataContractSerializerElement.cs
- MethodToken.cs
- XPathScanner.cs
- BinaryKeyIdentifierClause.cs
- FileFormatException.cs
- FormsAuthenticationTicket.cs
- CachedTypeface.cs
- SimpleTableProvider.cs
- CloudCollection.cs
- CatalogPartCollection.cs
- StorageRoot.cs
- OverflowException.cs