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
- XmlDataLoader.cs
- WorkflowOperationAsyncResult.cs
- HighContrastHelper.cs
- StringBuilder.cs
- HttpListenerElement.cs
- GlyphElement.cs
- RequiredAttributeAttribute.cs
- TdsParameterSetter.cs
- XmlSerializerFactory.cs
- NamedElement.cs
- Scripts.cs
- CodeMethodReturnStatement.cs
- ToolBarOverflowPanel.cs
- GeometryHitTestResult.cs
- XmlSchemaDocumentation.cs
- Missing.cs
- SystemWebSectionGroup.cs
- TemplatePagerField.cs
- QuaternionRotation3D.cs
- IndexedGlyphRun.cs
- XmlLoader.cs
- mediapermission.cs
- MethodCallConverter.cs
- XmlSchemaInferenceException.cs
- BamlCollectionHolder.cs
- NumericExpr.cs
- SafeFindHandle.cs
- WindowsGraphicsWrapper.cs
- BinHexEncoder.cs
- DataListDesigner.cs
- XmlAnyElementAttributes.cs
- HttpCacheParams.cs
- BamlVersionHeader.cs
- CollectionCodeDomSerializer.cs
- HttpRequest.cs
- SqlServer2KCompatibilityCheck.cs
- PropertyEmitter.cs
- CheckBoxPopupAdapter.cs
- PrivilegeNotHeldException.cs
- DynamicFilterExpression.cs
- ContextInformation.cs
- XmlStringTable.cs
- DocumentOrderQuery.cs
- CSharpCodeProvider.cs
- _ListenerRequestStream.cs
- IPEndPoint.cs
- LinkConverter.cs
- TempFiles.cs
- MediaScriptCommandRoutedEventArgs.cs
- SequentialWorkflowHeaderFooter.cs
- CrossContextChannel.cs
- MobileControl.cs
- BaseProcessor.cs
- Image.cs
- SmiSettersStream.cs
- ChangesetResponse.cs
- LogicalExpr.cs
- XNodeNavigator.cs
- DirectoryNotFoundException.cs
- MarkupExtensionParser.cs
- XmlElementAttribute.cs
- SchemaImporter.cs
- UrlPath.cs
- InputManager.cs
- ScopelessEnumAttribute.cs
- DbConnectionStringBuilder.cs
- MatrixConverter.cs
- System.Data.OracleClient_BID.cs
- CellTreeSimplifier.cs
- GcSettings.cs
- Scheduler.cs
- DirtyTextRange.cs
- ToolboxDataAttribute.cs
- PackageRelationship.cs
- EventBindingService.cs
- WebPartDisplayModeCancelEventArgs.cs
- ZipIOCentralDirectoryFileHeader.cs
- GZipStream.cs
- EntityDataSourceContextCreatedEventArgs.cs
- TreeViewImageKeyConverter.cs
- WebService.cs
- XmlNamespaceDeclarationsAttribute.cs
- DataGrid.cs
- SafeFileMappingHandle.cs
- InputLangChangeRequestEvent.cs
- SafeEventLogWriteHandle.cs
- StatusBarPanelClickEvent.cs
- OpenTypeLayoutCache.cs
- ConfigurationElement.cs
- AutomationTextAttribute.cs
- DataGridTextBox.cs
- CacheHelper.cs
- DbConnectionHelper.cs
- XmlSerializerAssemblyAttribute.cs
- NavigationPropertyEmitter.cs
- ColumnProvider.cs
- GeneralTransform3DTo2D.cs
- EmptyElement.cs
- IncomingWebRequestContext.cs
- Base64Decoder.cs