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
- VerificationAttribute.cs
- ObjectStateManagerMetadata.cs
- HtmlTableCellCollection.cs
- BasicHttpSecurityElement.cs
- AmbiguousMatchException.cs
- Site.cs
- ExpressionBuilderCollection.cs
- InputProviderSite.cs
- XPathCompileException.cs
- httpapplicationstate.cs
- InvalidFilterCriteriaException.cs
- XmlSortKey.cs
- WebPartAddingEventArgs.cs
- TextEvent.cs
- TrustManagerPromptUI.cs
- dataSvcMapFileLoader.cs
- Decimal.cs
- ObjectContextServiceProvider.cs
- PassportIdentity.cs
- CachedPathData.cs
- DragEventArgs.cs
- DataRowChangeEvent.cs
- DocumentXPathNavigator.cs
- BooleanSwitch.cs
- DocumentPageView.cs
- VectorAnimationUsingKeyFrames.cs
- FunctionQuery.cs
- UnregisterInfo.cs
- FormatterConverter.cs
- JsonReader.cs
- BufferedWebEventProvider.cs
- InteropDesigner.xaml.cs
- LineServicesCallbacks.cs
- HybridObjectCache.cs
- InstalledFontCollection.cs
- ControlBuilderAttribute.cs
- LinkLabelLinkClickedEvent.cs
- ManagementObjectSearcher.cs
- OrthographicCamera.cs
- XmlSortKeyAccumulator.cs
- PassportAuthentication.cs
- CloseSequence.cs
- ConnectionPoint.cs
- MissingManifestResourceException.cs
- ping.cs
- OdbcParameterCollection.cs
- CultureTable.cs
- CharEntityEncoderFallback.cs
- CopyAttributesAction.cs
- DynamicUpdateCommand.cs
- StateRuntime.cs
- FigureParaClient.cs
- BitmapEffectInputData.cs
- TableCellCollection.cs
- XPathNavigator.cs
- TemplateComponentConnector.cs
- SharedDp.cs
- FindCompletedEventArgs.cs
- SizeValueSerializer.cs
- SchemaMapping.cs
- MetadataItemEmitter.cs
- AxImporter.cs
- NetworkCredential.cs
- CatalogPart.cs
- ViewManager.cs
- ControlEvent.cs
- Expressions.cs
- MembershipUser.cs
- MenuEventArgs.cs
- SmiContext.cs
- Stroke2.cs
- ChtmlMobileTextWriter.cs
- complextypematerializer.cs
- HtmlTableCellCollection.cs
- DbMetaDataCollectionNames.cs
- WebPartCloseVerb.cs
- BuildManagerHost.cs
- EntityDataSourceContainerNameConverter.cs
- Stream.cs
- SystemTcpStatistics.cs
- Point4D.cs
- RegexRunnerFactory.cs
- PanelContainerDesigner.cs
- OSFeature.cs
- DoubleConverter.cs
- PointAnimation.cs
- ProgressBarBrushConverter.cs
- DataGridViewLinkColumn.cs
- DataBindingsDialog.cs
- PeerResolverElement.cs
- SeparatorAutomationPeer.cs
- ILGenerator.cs
- WindowsFormsEditorServiceHelper.cs
- DbConnectionPoolGroup.cs
- AncestorChangedEventArgs.cs
- TextLine.cs
- DefaultProxySection.cs
- SafeProcessHandle.cs
- DataGridViewComboBoxCell.cs
- DetailsViewRowCollection.cs