Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DLinq / Dlinq / SqlClient / Common / SqlNodeAnnotations.cs / 1 / 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
- ToolStripDropDown.cs
- DateTimeValueSerializerContext.cs
- CodeAttributeDeclarationCollection.cs
- MessageSmuggler.cs
- RecordBuilder.cs
- DataRecord.cs
- WmfPlaceableFileHeader.cs
- ConstantCheck.cs
- MappingMetadataHelper.cs
- StructuralType.cs
- CodeVariableReferenceExpression.cs
- versioninfo.cs
- GB18030Encoding.cs
- MenuEventArgs.cs
- Variant.cs
- AndMessageFilterTable.cs
- Int16Converter.cs
- EventBookmark.cs
- BitmapDecoder.cs
- SerialErrors.cs
- DelegatedStream.cs
- ToolStripLabel.cs
- PageRanges.cs
- MultiSelectRootGridEntry.cs
- DESCryptoServiceProvider.cs
- StaticDataManager.cs
- NavigationPropertyEmitter.cs
- SqlXmlStorage.cs
- HtmlMobileTextWriter.cs
- TableItemPattern.cs
- TrackPoint.cs
- AffineTransform3D.cs
- DataRowExtensions.cs
- Bezier.cs
- SafeNativeMethods.cs
- QueryAsyncResult.cs
- AccessibleObject.cs
- AnimatedTypeHelpers.cs
- NotifyInputEventArgs.cs
- PenThread.cs
- ToolstripProfessionalRenderer.cs
- LiteralControl.cs
- DurationConverter.cs
- DiagnosticTraceSource.cs
- ReversePositionQuery.cs
- GridViewColumnCollection.cs
- TypeResolvingOptionsAttribute.cs
- XsdDateTime.cs
- CompressedStack.cs
- RefExpr.cs
- IncrementalReadDecoders.cs
- KeyValueConfigurationCollection.cs
- WorkflowMarkupSerializationManager.cs
- InheritablePropertyChangeInfo.cs
- GB18030Encoding.cs
- RoutedEventConverter.cs
- EpmTargetPathSegment.cs
- IconConverter.cs
- TextRangeSerialization.cs
- TextBoxRenderer.cs
- MimeFormImporter.cs
- TextAutomationPeer.cs
- FtpWebRequest.cs
- WebBrowserPermission.cs
- DeclaredTypeValidatorAttribute.cs
- _ConnectOverlappedAsyncResult.cs
- WorkItem.cs
- ComponentManagerBroker.cs
- IPAddress.cs
- COM2ComponentEditor.cs
- Stacktrace.cs
- TypeBrowserDialog.cs
- XmlNamespaceManager.cs
- CollectionViewGroup.cs
- ConfigXmlComment.cs
- EFAssociationProvider.cs
- ParallelTimeline.cs
- Types.cs
- HTMLTagNameToTypeMapper.cs
- PublishLicense.cs
- QueryComponents.cs
- DefaultTraceListener.cs
- FormView.cs
- HostDesigntimeLicenseContext.cs
- InputLanguageManager.cs
- ResourceExpression.cs
- SearchForVirtualItemEventArgs.cs
- SourceLocationProvider.cs
- DataGridViewButtonCell.cs
- PointLight.cs
- TemplateGroupCollection.cs
- safex509handles.cs
- HtmlForm.cs
- Queue.cs
- Int16AnimationBase.cs
- RegexCaptureCollection.cs
- BitmapEffectDrawingContextWalker.cs
- FieldToken.cs
- ApplicationManager.cs
- ComboBoxAutomationPeer.cs