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
- RegexCompiler.cs
- GridEntryCollection.cs
- DataReceivedEventArgs.cs
- EmbeddedMailObjectsCollection.cs
- ExceptionHelpers.cs
- MarshalDirectiveException.cs
- CommandPlan.cs
- RenamedEventArgs.cs
- RowsCopiedEventArgs.cs
- StopStoryboard.cs
- AudioException.cs
- ContentDesigner.cs
- ObjectConverter.cs
- SystemInformation.cs
- PrintPreviewControl.cs
- StreamDocument.cs
- MemoryMappedViewAccessor.cs
- AnnotationMap.cs
- CustomAttributeBuilder.cs
- TextOutput.cs
- EventHandlers.cs
- ToolStripSettings.cs
- GenericWebPart.cs
- DataGridViewRowsAddedEventArgs.cs
- Codec.cs
- ScrollData.cs
- AuthorizationBehavior.cs
- PieceDirectory.cs
- SystemException.cs
- StylusPointProperty.cs
- ProfileParameter.cs
- IgnoreFlushAndCloseStream.cs
- SchemaSetCompiler.cs
- XPathDocumentNavigator.cs
- RegexCaptureCollection.cs
- RefreshInfo.cs
- BasicExpandProvider.cs
- DateTimeOffset.cs
- _AutoWebProxyScriptHelper.cs
- BackgroundFormatInfo.cs
- Transform3D.cs
- HtmlGenericControl.cs
- IsolatedStorageFileStream.cs
- LoginName.cs
- BamlStream.cs
- XmlAutoDetectWriter.cs
- MobileContainerDesigner.cs
- SortDescription.cs
- RecognizedPhrase.cs
- StylusEventArgs.cs
- KeyMatchBuilder.cs
- ParameterDataSourceExpression.cs
- LineGeometry.cs
- nulltextcontainer.cs
- SqlBulkCopyColumnMappingCollection.cs
- BitConverter.cs
- WindowsStatic.cs
- ListViewPagedDataSource.cs
- DynamicRenderer.cs
- ItemType.cs
- IndexingContentUnit.cs
- RoleManagerModule.cs
- GorillaCodec.cs
- ModuleBuilder.cs
- PointHitTestResult.cs
- CreationContext.cs
- Transform3DCollection.cs
- LabelLiteral.cs
- MsmqDiagnostics.cs
- SystemEvents.cs
- ISAPIRuntime.cs
- EncodingTable.cs
- ColorMap.cs
- EncoderNLS.cs
- StringDictionaryWithComparer.cs
- SourceItem.cs
- DataGridViewColumnHeaderCell.cs
- EntityClientCacheKey.cs
- PerformanceCounterManager.cs
- XmlNamespaceMapping.cs
- PropertyFilterAttribute.cs
- StyleBamlRecordReader.cs
- PeerTransportSecurityElement.cs
- ping.cs
- ProtocolElementCollection.cs
- AtomServiceDocumentSerializer.cs
- TraceSection.cs
- DesignerDataTableBase.cs
- String.cs
- WmpBitmapEncoder.cs
- FastPropertyAccessor.cs
- DetailsViewPagerRow.cs
- PrintDialog.cs
- XmlSerializerOperationBehavior.cs
- SrgsElement.cs
- FixedHighlight.cs
- ScriptManagerProxy.cs
- ScriptDescriptor.cs
- NumberFormatInfo.cs
- ManagementEventWatcher.cs