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
- VariableAction.cs
- RequestContext.cs
- Misc.cs
- UInt32.cs
- IISMapPath.cs
- XPathNavigatorKeyComparer.cs
- Util.cs
- StringWriter.cs
- DesignerAdapterUtil.cs
- SessionSwitchEventArgs.cs
- DocumentAutomationPeer.cs
- _KerberosClient.cs
- JumpTask.cs
- XmlUtil.cs
- QilInvoke.cs
- RunInstallerAttribute.cs
- OrderedDictionaryStateHelper.cs
- Pair.cs
- MergeFilterQuery.cs
- PageTheme.cs
- DiscreteKeyFrames.cs
- SystemInfo.cs
- CodeAttributeDeclaration.cs
- IconHelper.cs
- BoolLiteral.cs
- DoubleAnimationUsingPath.cs
- LicenseManager.cs
- X509RawDataKeyIdentifierClause.cs
- PreservationFileReader.cs
- ChineseLunisolarCalendar.cs
- Vector3D.cs
- SafeFindHandle.cs
- TrustSection.cs
- RemotingException.cs
- OutputCacheSettingsSection.cs
- UnsafeNativeMethods.cs
- BinHexDecoder.cs
- Win32Exception.cs
- TimeSpanConverter.cs
- ObjectListSelectEventArgs.cs
- ComplexBindingPropertiesAttribute.cs
- CopyOnWriteList.cs
- TempFiles.cs
- ImportContext.cs
- GridViewSelectEventArgs.cs
- DateBoldEvent.cs
- SafeNativeMethods.cs
- DesignerVerbCollection.cs
- VisualCollection.cs
- ToolboxItemFilterAttribute.cs
- TextElementCollectionHelper.cs
- ImplicitInputBrush.cs
- AnimationStorage.cs
- HttpException.cs
- BindingContext.cs
- PageAdapter.cs
- DataObjectAttribute.cs
- JapaneseLunisolarCalendar.cs
- ThreadStartException.cs
- DocumentPageHost.cs
- CapabilitiesRule.cs
- ProjectionAnalyzer.cs
- UpdateProgress.cs
- ToolStripSeparatorRenderEventArgs.cs
- SocketPermission.cs
- IPAddress.cs
- DataGridViewAccessibleObject.cs
- VisualStyleRenderer.cs
- SettingsBase.cs
- SettingsAttributeDictionary.cs
- exports.cs
- TraceLevelStore.cs
- Mappings.cs
- Subtract.cs
- ExpressionBuilderCollection.cs
- BypassElement.cs
- RotateTransform.cs
- TypeInitializationException.cs
- ProvideValueServiceProvider.cs
- GridViewRow.cs
- SerialPort.cs
- CompositeKey.cs
- BitStack.cs
- NamedElement.cs
- XmlTextWriter.cs
- SystemEvents.cs
- DateTimeFormat.cs
- XDRSchema.cs
- XamlClipboardData.cs
- ScaleTransform.cs
- xdrvalidator.cs
- PageContent.cs
- XmlHierarchyData.cs
- RelatedView.cs
- ContractHandle.cs
- NativeWindow.cs
- Errors.cs
- IndicCharClassifier.cs
- UpdatableGenericsFeature.cs
- OverflowException.cs