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
- CroppedBitmap.cs
- Vertex.cs
- XPathAncestorQuery.cs
- PrePrepareMethodAttribute.cs
- PersonalizationState.cs
- DynamicRendererThreadManager.cs
- XmlReaderSettings.cs
- DataBoundControlAdapter.cs
- ToolStripItemDataObject.cs
- DocumentReference.cs
- NGCPageContentSerializerAsync.cs
- ProjectionPruner.cs
- ListViewItemEventArgs.cs
- Size3DConverter.cs
- TreeNodeCollection.cs
- TextElementEnumerator.cs
- DrawingGroup.cs
- HelpFileFileNameEditor.cs
- WindowsComboBox.cs
- SchemaLookupTable.cs
- FileVersionInfo.cs
- LocalizationParserHooks.cs
- NeutralResourcesLanguageAttribute.cs
- BooleanAnimationBase.cs
- Pts.cs
- DataGridViewSelectedColumnCollection.cs
- SerialErrors.cs
- CodeGroup.cs
- CodeTypeReferenceCollection.cs
- PropertyCollection.cs
- WebPartCloseVerb.cs
- HandlerMappingMemo.cs
- ScalarOps.cs
- DelimitedListTraceListener.cs
- PageStatePersister.cs
- MenuCommandService.cs
- WSMessageEncoding.cs
- ReadOnlyMetadataCollection.cs
- SuppressMergeCheckAttribute.cs
- AlgoModule.cs
- InternalDuplexChannelFactory.cs
- TaskbarItemInfo.cs
- InfoCardTrace.cs
- WhitespaceRuleReader.cs
- FrameworkElementFactory.cs
- XmlLinkedNode.cs
- DataTableReader.cs
- WebPartHeaderCloseVerb.cs
- DictionaryManager.cs
- CorrelationScope.cs
- ServiceObjectContainer.cs
- DataTableNewRowEvent.cs
- HandleExceptionArgs.cs
- QilIterator.cs
- EqualityComparer.cs
- StatusBar.cs
- AssociatedControlConverter.cs
- MergeFilterQuery.cs
- securitycriticaldataClass.cs
- altserialization.cs
- UmAlQuraCalendar.cs
- Application.cs
- PersonalizationEntry.cs
- AuthenticateEventArgs.cs
- ApplyTemplatesAction.cs
- DirtyTextRange.cs
- GlyphTypeface.cs
- Property.cs
- ListenDesigner.cs
- MethodBody.cs
- TraceSection.cs
- AssemblyAssociatedContentFileAttribute.cs
- EnvironmentPermission.cs
- DotNetATv1WindowsLogEntryDeserializer.cs
- CollectionExtensions.cs
- OracleString.cs
- DataGridCell.cs
- VersionValidator.cs
- ChildTable.cs
- JumpList.cs
- _LoggingObject.cs
- Panel.cs
- __TransparentProxy.cs
- Block.cs
- SQLRoleProvider.cs
- Nodes.cs
- ItemsPanelTemplate.cs
- CounterCreationData.cs
- SingleResultAttribute.cs
- Inflater.cs
- OverrideMode.cs
- NativeMethods.cs
- TableLayoutSettingsTypeConverter.cs
- RelatedImageListAttribute.cs
- DataGridPagerStyle.cs
- FreezableDefaultValueFactory.cs
- OperatorExpressions.cs
- SqlUnionizer.cs
- ListGeneralPage.cs
- DmlSqlGenerator.cs