Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DLinq / Dlinq / SqlClient / Common / SqlNodeAnnotations.cs / 1305376 / SqlNodeAnnotations.cs
using System; using System.Collections.Generic; using System.Text; namespace System.Data.Linq.SqlClient { ////// Associate annotations with SqlNodes. /// internal class SqlNodeAnnotations { Dictionary> annotationMap = new Dictionary >(); Dictionary uniqueTypes = new Dictionary (); /// /// Add an annotation to the given node. /// internal void Add(SqlNode node, SqlNodeAnnotation annotation) { Listlist = null; if (!this.annotationMap.TryGetValue(node, out list)) { list = new List (); this.annotationMap[node]=list; } uniqueTypes[annotation.GetType()] = String.Empty; list.Add(annotation); } /// /// Gets the annotations for the given node. Null if none. /// internal ListGet(SqlNode node) { List list = null; this.annotationMap.TryGetValue(node, out list); return list; } /// /// Whether the given node has annotations. /// internal bool NodeIsAnnotated(SqlNode node) { if (node == null) return false; return this.annotationMap.ContainsKey(node); } ////// Checks whether there's at least one annotation of the given type. /// internal bool HasAnnotationType(Type type) { return this.uniqueTypes.ContainsKey(type); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Collections.Generic; using System.Text; namespace System.Data.Linq.SqlClient { ////// Associate annotations with SqlNodes. /// internal class SqlNodeAnnotations { Dictionary> annotationMap = new Dictionary >(); Dictionary uniqueTypes = new Dictionary (); /// /// Add an annotation to the given node. /// internal void Add(SqlNode node, SqlNodeAnnotation annotation) { Listlist = null; if (!this.annotationMap.TryGetValue(node, out list)) { list = new List (); this.annotationMap[node]=list; } uniqueTypes[annotation.GetType()] = String.Empty; list.Add(annotation); } /// /// Gets the annotations for the given node. Null if none. /// internal ListGet(SqlNode node) { List list = null; this.annotationMap.TryGetValue(node, out list); return list; } /// /// Whether the given node has annotations. /// internal bool NodeIsAnnotated(SqlNode node) { if (node == null) return false; return this.annotationMap.ContainsKey(node); } ////// Checks whether there's at least one annotation of the given type. /// internal bool HasAnnotationType(Type type) { return this.uniqueTypes.ContainsKey(type); } } } // 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
- RequestCacheValidator.cs
- DataGridViewUtilities.cs
- QuaternionRotation3D.cs
- Exceptions.cs
- ConversionHelper.cs
- Timer.cs
- XmlSchemaObject.cs
- EraserBehavior.cs
- OdbcCommand.cs
- BookmarkNameHelper.cs
- CodeTypeParameterCollection.cs
- indexingfiltermarshaler.cs
- ChtmlCommandAdapter.cs
- DBNull.cs
- TableParaClient.cs
- VBIdentifierName.cs
- ManagementQuery.cs
- SecureEnvironment.cs
- ToggleButtonAutomationPeer.cs
- TextBoxBase.cs
- PartialTrustVisibleAssembly.cs
- XmlSchemaValidationException.cs
- DependencyObjectPropertyDescriptor.cs
- QilTernary.cs
- SizeAnimation.cs
- GeometryModel3D.cs
- PostBackOptions.cs
- TraceContextRecord.cs
- TimeZoneInfo.cs
- CachedFontFace.cs
- SourceFilter.cs
- XmlSchemaElement.cs
- HttpMethodAttribute.cs
- PerformanceCounterPermission.cs
- MatrixAnimationBase.cs
- CatalogZone.cs
- EndpointDiscoveryBehavior.cs
- PlainXmlWriter.cs
- EntityDataSourceDesigner.cs
- ConnectorMovedEventArgs.cs
- TheQuery.cs
- AutoGeneratedField.cs
- GridErrorDlg.cs
- FileLogRecordEnumerator.cs
- DataGridColumnHeader.cs
- DataGridViewAutoSizeModeEventArgs.cs
- SaveFileDialog.cs
- ISAPIWorkerRequest.cs
- UserInitiatedNavigationPermission.cs
- SimpleBitVector32.cs
- Font.cs
- RegexCode.cs
- PointIndependentAnimationStorage.cs
- SmiEventSink_DeferedProcessing.cs
- EnumUnknown.cs
- CompilerScopeManager.cs
- TCPClient.cs
- AutomationElement.cs
- ServicePoint.cs
- FormViewDeleteEventArgs.cs
- BaseAppDomainProtocolHandler.cs
- TableDesigner.cs
- PasswordDeriveBytes.cs
- RegionInfo.cs
- StaticDataManager.cs
- GlobalProxySelection.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- StrongNameIdentityPermission.cs
- MasterPage.cs
- DtdParser.cs
- ClientUIRequest.cs
- EnumMemberAttribute.cs
- SafeBuffer.cs
- ReferenceConverter.cs
- ResourceWriter.cs
- FontWeight.cs
- SortedDictionary.cs
- PartialCachingAttribute.cs
- TimeStampChecker.cs
- DependencyObject.cs
- SinglePageViewer.cs
- UpdateDelegates.Generated.cs
- EntitySetBase.cs
- __ComObject.cs
- CodeRegionDirective.cs
- OracleNumber.cs
- assertwrapper.cs
- DialogWindow.cs
- ArrayEditor.cs
- ObjectConverter.cs
- StaticTextPointer.cs
- ProjectedWrapper.cs
- LogExtentCollection.cs
- SafeRegistryHandle.cs
- QueryContinueDragEventArgs.cs
- WebPartDisplayMode.cs
- CodeTypeOfExpression.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- PersonalizationDictionary.cs
- InternalConfigEventArgs.cs