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
- StorageAssociationSetMapping.cs
- RsaSecurityKey.cs
- HtmlEncodedRawTextWriter.cs
- XmlHierarchyData.cs
- PrintController.cs
- CounterSample.cs
- ScriptingJsonSerializationSection.cs
- LoginName.cs
- ArraySubsetEnumerator.cs
- SystemFonts.cs
- CodeVariableDeclarationStatement.cs
- SvcMapFileSerializer.cs
- AdCreatedEventArgs.cs
- HttpHostedTransportConfiguration.cs
- TitleStyle.cs
- ReadWriteControlDesigner.cs
- RegexFCD.cs
- SqlDataReader.cs
- BitStream.cs
- TreeNodeStyleCollection.cs
- RawMouseInputReport.cs
- ChannelEndpointElement.cs
- BamlLocalizableResource.cs
- WorkflowTransactionService.cs
- AttributeEmitter.cs
- EncryptedXml.cs
- Dynamic.cs
- IntPtr.cs
- InvalidAsynchronousStateException.cs
- DataGridSortCommandEventArgs.cs
- NamespaceMapping.cs
- TextDecorationCollectionConverter.cs
- DropDownList.cs
- ToolStripDropDownClosingEventArgs.cs
- SqlNode.cs
- securitycriticaldataformultiplegetandset.cs
- QueryableDataSourceHelper.cs
- NamespaceQuery.cs
- _ConnectionGroup.cs
- WebPartMenu.cs
- CreatingCookieEventArgs.cs
- WSSecureConversation.cs
- SmtpFailedRecipientsException.cs
- DescendentsWalkerBase.cs
- ChannelBinding.cs
- ScriptHandlerFactory.cs
- StatusBarAutomationPeer.cs
- HttpRequestBase.cs
- InputBuffer.cs
- Hash.cs
- TypeSemantics.cs
- XmlSerializerFactory.cs
- ValidatorCollection.cs
- Converter.cs
- ManifestResourceInfo.cs
- RuntimeConfig.cs
- XmlSchemaSimpleContent.cs
- ITextView.cs
- SecurityManager.cs
- Clause.cs
- DecimalStorage.cs
- SafeNativeMethods.cs
- ProgressBarRenderer.cs
- CodeDelegateCreateExpression.cs
- RayHitTestParameters.cs
- ReadOnlyKeyedCollection.cs
- XsltOutput.cs
- ListComponentEditor.cs
- StylusPlugInCollection.cs
- XmlTextReaderImplHelpers.cs
- RequestQueryProcessor.cs
- AggregateNode.cs
- CommonObjectSecurity.cs
- XPathSelectionIterator.cs
- WindowsGraphicsWrapper.cs
- VirtualPath.cs
- DependentTransaction.cs
- InfoCardKeyedHashAlgorithm.cs
- PartialCachingControl.cs
- TreeNodeBindingCollection.cs
- TrustLevel.cs
- StreamingContext.cs
- Statements.cs
- KnownBoxes.cs
- WMICapabilities.cs
- TreeView.cs
- XdrBuilder.cs
- VirtualizedCellInfoCollection.cs
- SecurityUtils.cs
- TextDecoration.cs
- PlaceHolder.cs
- ApplicationSettingsBase.cs
- RtfFormatStack.cs
- FactoryGenerator.cs
- DateTimeFormatInfo.cs
- DoubleAnimationUsingKeyFrames.cs
- ContextMenu.cs
- DateTimeConverter2.cs
- ShapingWorkspace.cs
- CopyOnWriteList.cs