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
- COM2PropertyPageUITypeConverter.cs
- BigInt.cs
- CustomValidator.cs
- DomNameTable.cs
- FileUtil.cs
- TriggerAction.cs
- BaseCodeDomTreeGenerator.cs
- MultipleViewPatternIdentifiers.cs
- PresentationAppDomainManager.cs
- CharUnicodeInfo.cs
- TearOffProxy.cs
- MouseButtonEventArgs.cs
- AssemblyResourceLoader.cs
- TextBoxBase.cs
- FixedSOMContainer.cs
- DataBindingHandlerAttribute.cs
- FolderLevelBuildProvider.cs
- XhtmlBasicValidatorAdapter.cs
- IPGlobalProperties.cs
- Model3D.cs
- TreeWalkHelper.cs
- ToolStripTextBox.cs
- SystemFonts.cs
- CheckPair.cs
- BinaryFormatter.cs
- ConnectionProviderAttribute.cs
- SelectionBorderGlyph.cs
- StrokeNodeData.cs
- EventlogProvider.cs
- COM2PropertyDescriptor.cs
- AnnotationHighlightLayer.cs
- SystemInfo.cs
- FontUnitConverter.cs
- RtfNavigator.cs
- RawUIStateInputReport.cs
- SymLanguageType.cs
- HtmlLink.cs
- Baml2006KnownTypes.cs
- IdentityManager.cs
- Base64Decoder.cs
- TextViewSelectionProcessor.cs
- ProcessModule.cs
- CodeTypeDeclaration.cs
- MouseActionConverter.cs
- OdbcErrorCollection.cs
- TriggerCollection.cs
- SqlGenericUtil.cs
- TagPrefixCollection.cs
- XmlNotation.cs
- WebPartZoneCollection.cs
- WindowsTab.cs
- SafeFindHandle.cs
- InfocardChannelParameter.cs
- RangeValueProviderWrapper.cs
- ADMembershipProvider.cs
- DrawingCollection.cs
- CopyNamespacesAction.cs
- _HelperAsyncResults.cs
- ParserStack.cs
- InitializingNewItemEventArgs.cs
- WindowsRegion.cs
- Int32RectValueSerializer.cs
- ToolStripPanelRenderEventArgs.cs
- UIElementParaClient.cs
- SapiInterop.cs
- BaseAddressElement.cs
- nulltextcontainer.cs
- AuditLogLocation.cs
- RowUpdatingEventArgs.cs
- PassportPrincipal.cs
- MessageQueueException.cs
- TimeSpanConverter.cs
- VersionPair.cs
- SQLMembershipProvider.cs
- WebBrowsableAttribute.cs
- PathFigureCollectionConverter.cs
- BamlResourceContent.cs
- LoadRetryConstantStrategy.cs
- IFlowDocumentViewer.cs
- NativeCppClassAttribute.cs
- ImageSourceTypeConverter.cs
- AlternateView.cs
- VirtualizingStackPanel.cs
- FormsAuthentication.cs
- NamespaceInfo.cs
- CounterSample.cs
- ProfessionalColors.cs
- BrowserDefinition.cs
- StatusInfoItem.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- Constants.cs
- WmpBitmapEncoder.cs
- ImageClickEventArgs.cs
- Row.cs
- ServiceChannelFactory.cs
- ParserStack.cs
- SocketException.cs
- DataError.cs
- DesignTimeSiteMapProvider.cs
- FieldBuilder.cs