Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- BaseTemplateBuildProvider.cs
- ConversionContext.cs
- Console.cs
- Repeater.cs
- AsymmetricAlgorithm.cs
- StrongNameMembershipCondition.cs
- InstanceDataCollection.cs
- TransactionTraceIdentifier.cs
- Validator.cs
- MetadataCache.cs
- Slider.cs
- XhtmlBasicLabelAdapter.cs
- AttributeEmitter.cs
- ServiceRoute.cs
- XmlSchemaSimpleContent.cs
- regiisutil.cs
- PageSettings.cs
- DBConcurrencyException.cs
- XmlSchemaSet.cs
- FilteredDataSetHelper.cs
- RequiredFieldValidator.cs
- FormatVersion.cs
- HttpCachePolicyElement.cs
- XappLauncher.cs
- HtmlDocument.cs
- NeutralResourcesLanguageAttribute.cs
- SrgsElementFactoryCompiler.cs
- WebPartTransformerCollection.cs
- ColorConvertedBitmap.cs
- HttpModuleAction.cs
- TypeDescriptor.cs
- XsltConvert.cs
- ReachDocumentReferenceCollectionSerializer.cs
- BmpBitmapEncoder.cs
- SrgsToken.cs
- MimeBasePart.cs
- CompilationPass2Task.cs
- SoapTypeAttribute.cs
- XmlDataLoader.cs
- XPathChildIterator.cs
- CompatibleComparer.cs
- PeerNameRegistration.cs
- SHA384.cs
- WebConfigurationFileMap.cs
- ContextMenuStripGroup.cs
- AutoGeneratedField.cs
- ElementsClipboardData.cs
- ComplexObject.cs
- MobileComponentEditorPage.cs
- HtmlLinkAdapter.cs
- MarkupCompilePass2.cs
- ListViewInsertionMark.cs
- HttpProfileGroupBase.cs
- GeometryCombineModeValidation.cs
- BindingManagerDataErrorEventArgs.cs
- PassportIdentity.cs
- PairComparer.cs
- DispatchChannelSink.cs
- ForwardPositionQuery.cs
- WebPartPersonalization.cs
- JoinElimination.cs
- XPathNodeHelper.cs
- LinqDataSourceDisposeEventArgs.cs
- CharAnimationUsingKeyFrames.cs
- AddToCollection.cs
- FilteredReadOnlyMetadataCollection.cs
- Avt.cs
- IxmlLineInfo.cs
- RegularExpressionValidator.cs
- ListViewItem.cs
- Rect.cs
- NegotiateStream.cs
- ValidatorCompatibilityHelper.cs
- ConsumerConnectionPointCollection.cs
- panel.cs
- PrimaryKeyTypeConverter.cs
- DataServiceRequestArgs.cs
- XmlTextWriter.cs
- SoapFormatter.cs
- DelegateSerializationHolder.cs
- SizeF.cs
- Vector3DAnimation.cs
- _CookieModule.cs
- ItemsPanelTemplate.cs
- DateRangeEvent.cs
- PaintValueEventArgs.cs
- CustomSignedXml.cs
- XhtmlTextWriter.cs
- Base64WriteStateInfo.cs
- HandledMouseEvent.cs
- WorkItem.cs
- CachedPathData.cs
- AnnotationAdorner.cs
- AbstractExpressions.cs
- PackagePartCollection.cs
- ObjectTypeMapping.cs
- RegistryPermission.cs
- WebPartVerb.cs
- BufferedStream.cs
- Vector3DCollection.cs