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
- ResolveMatchesApril2005.cs
- SqlDependency.cs
- SchemaNotation.cs
- Storyboard.cs
- XmlSchemaInferenceException.cs
- NativeBuffer.cs
- HostExecutionContextManager.cs
- ComponentEditorPage.cs
- StorageConditionPropertyMapping.cs
- RegexStringValidator.cs
- RelationshipWrapper.cs
- DefaultParameterValueAttribute.cs
- Blend.cs
- ImageButton.cs
- DesignTimeDataBinding.cs
- xml.cs
- InternalControlCollection.cs
- PngBitmapDecoder.cs
- SRGSCompiler.cs
- SchemaMapping.cs
- SqlDataRecord.cs
- ColumnBinding.cs
- ProcessModuleDesigner.cs
- StylusPlugin.cs
- ISFTagAndGuidCache.cs
- SecurityManager.cs
- TypeContext.cs
- StrokeFIndices.cs
- UserControlFileEditor.cs
- PolicyUnit.cs
- CmsInterop.cs
- WindowsAuthenticationModule.cs
- MbpInfo.cs
- AesCryptoServiceProvider.cs
- mediapermission.cs
- SecurityChannelListener.cs
- ValidationRule.cs
- NativeRightsManagementAPIsStructures.cs
- SafeLocalMemHandle.cs
- DeviceFilterEditorDialog.cs
- DataControlField.cs
- _ContextAwareResult.cs
- BinaryObjectReader.cs
- KerberosSecurityTokenParameters.cs
- ToolStripItemCollection.cs
- PlanCompiler.cs
- ClassHandlersStore.cs
- TextFindEngine.cs
- ThicknessAnimationUsingKeyFrames.cs
- DrawingImage.cs
- Int32Rect.cs
- dsa.cs
- SystemInfo.cs
- DataObjectEventArgs.cs
- XPathSelfQuery.cs
- CodeComment.cs
- QuaternionAnimation.cs
- KeyedQueue.cs
- AvTrace.cs
- FrameworkElementAutomationPeer.cs
- DataRelation.cs
- XmlHierarchicalDataSourceView.cs
- CryptoConfig.cs
- ExecutorLocksHeldException.cs
- CodeSubDirectoriesCollection.cs
- MenuCommands.cs
- ToolboxDataAttribute.cs
- DoubleUtil.cs
- PlatformNotSupportedException.cs
- PrintController.cs
- TreeNodeCollectionEditor.cs
- MenuItemAutomationPeer.cs
- FormView.cs
- FromReply.cs
- HttpListenerRequest.cs
- AsyncDataRequest.cs
- ToolStripPanelSelectionBehavior.cs
- ExtensionFile.cs
- XmlSiteMapProvider.cs
- RadioButtonAutomationPeer.cs
- DataListDesigner.cs
- SolidColorBrush.cs
- ActivationService.cs
- SettingsAttributeDictionary.cs
- CodeGenerator.cs
- TextParaLineResult.cs
- Button.cs
- ComPlusInstanceContextInitializer.cs
- SmiRecordBuffer.cs
- CodeVariableDeclarationStatement.cs
- SafePEFileHandle.cs
- ipaddressinformationcollection.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- SiteMapNode.cs
- RelOps.cs
- NameObjectCollectionBase.cs
- LZCodec.cs
- SystemSounds.cs
- ClientSideProviderDescription.cs
- KeyedQueue.cs