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
- PerfCounters.cs
- VirtualizedCellInfoCollection.cs
- CompilationRelaxations.cs
- OleDbError.cs
- NativeMethods.cs
- HelpEvent.cs
- Vector3DAnimationBase.cs
- WinInetCache.cs
- HtmlToClrEventProxy.cs
- IndentTextWriter.cs
- XslCompiledTransform.cs
- SqlDataSourceEnumerator.cs
- TdsParserStateObject.cs
- EventlogProvider.cs
- CollectionBuilder.cs
- ReflectionHelper.cs
- ComplexLine.cs
- DataGridViewSelectedRowCollection.cs
- MenuAdapter.cs
- ProgressBarRenderer.cs
- UseLicense.cs
- SQLMoney.cs
- XPathDocumentNavigator.cs
- TextChange.cs
- VirtualPathProvider.cs
- WindowsAuthenticationEventArgs.cs
- DataSourceExpressionCollection.cs
- Control.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- QueryLifecycle.cs
- HttpModuleAction.cs
- EncoderExceptionFallback.cs
- BufferModesCollection.cs
- ProjectionCamera.cs
- AssemblySettingAttributes.cs
- TableHeaderCell.cs
- AuthorizationContext.cs
- basecomparevalidator.cs
- ConnectionsZoneAutoFormat.cs
- NameSpaceExtractor.cs
- AuthorizationPolicyTypeElement.cs
- XmlNode.cs
- StopStoryboard.cs
- StorageInfo.cs
- LinkArea.cs
- ExpressionWriter.cs
- VideoDrawing.cs
- PropertyItemInternal.cs
- CompilationSection.cs
- ReferenceAssemblyAttribute.cs
- XmlTypeAttribute.cs
- FlowLayoutSettings.cs
- ArrayList.cs
- ClientScriptManager.cs
- ValidationManager.cs
- SerializationSectionGroup.cs
- NotifyCollectionChangedEventArgs.cs
- DiscoveryDocument.cs
- Padding.cs
- ContractComponent.cs
- TextViewDesigner.cs
- WmlCalendarAdapter.cs
- DesignSurfaceManager.cs
- XComponentModel.cs
- BindingMAnagerBase.cs
- TreeViewImageKeyConverter.cs
- Simplifier.cs
- SerializableTypeCodeDomSerializer.cs
- DeferredReference.cs
- _NetworkingPerfCounters.cs
- SettingsProviderCollection.cs
- LogEntryDeserializer.cs
- BuildDependencySet.cs
- XPathParser.cs
- RegexTypeEditor.cs
- SslStream.cs
- DBCommand.cs
- NullableFloatSumAggregationOperator.cs
- DesignerCategoryAttribute.cs
- XmlQueryContext.cs
- BooleanStorage.cs
- XmlHelper.cs
- OnOperation.cs
- DataServiceConfiguration.cs
- GradientStop.cs
- documentsequencetextview.cs
- CredentialCache.cs
- serverconfig.cs
- DataGridViewAutoSizeModeEventArgs.cs
- ApplicationFileParser.cs
- Camera.cs
- DocumentReference.cs
- ListViewUpdateEventArgs.cs
- RegexRunnerFactory.cs
- thaishape.cs
- XmlNodeReader.cs
- QilIterator.cs
- Transform3DGroup.cs
- XNameConverter.cs
- ExecutedRoutedEventArgs.cs