Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- XmlBaseReader.cs
- PropertyPushdownHelper.cs
- ListenerTraceUtility.cs
- EncoderParameter.cs
- UrlAuthorizationModule.cs
- XpsImage.cs
- SpeechRecognitionEngine.cs
- FamilyTypefaceCollection.cs
- ApplicationTrust.cs
- SmiEventSink.cs
- Exceptions.cs
- DataGridCaption.cs
- ToolStripArrowRenderEventArgs.cs
- VirtualDirectoryMappingCollection.cs
- APCustomTypeDescriptor.cs
- GroupLabel.cs
- ExpressionDumper.cs
- DataGridViewLinkCell.cs
- TrackingProfile.cs
- MessageQueueInstaller.cs
- ResourceProperty.cs
- SqlCacheDependencyDatabase.cs
- PathFigureCollection.cs
- EventLogEntryCollection.cs
- AssemblyInfo.cs
- SqlDependency.cs
- DataGridViewColumnHeaderCell.cs
- WebExceptionStatus.cs
- IdentifierService.cs
- _HeaderInfoTable.cs
- NumberEdit.cs
- CodeDesigner.cs
- TextSimpleMarkerProperties.cs
- DynamicUpdateCommand.cs
- SafeLibraryHandle.cs
- SettingsPropertyIsReadOnlyException.cs
- ColorEditor.cs
- ProcessThread.cs
- ToolBarOverflowPanel.cs
- AutoGeneratedFieldProperties.cs
- FormViewModeEventArgs.cs
- ObjectTag.cs
- StructuredTypeEmitter.cs
- XmlNavigatorStack.cs
- Brush.cs
- DataGridViewHeaderCell.cs
- Reference.cs
- CodeDirectoryCompiler.cs
- IncrementalHitTester.cs
- FlowLayoutSettings.cs
- MetaTable.cs
- CodeAssignStatement.cs
- DataGridColumnCollection.cs
- EdmProviderManifest.cs
- SyndicationFeed.cs
- LocatorPart.cs
- EastAsianLunisolarCalendar.cs
- XsltArgumentList.cs
- BamlWriter.cs
- JoinGraph.cs
- AnchoredBlock.cs
- ContainerUIElement3D.cs
- WS2007FederationHttpBinding.cs
- _PooledStream.cs
- AlgoModule.cs
- IndexedEnumerable.cs
- DiscoveryEndpointElement.cs
- ConstraintStruct.cs
- InkPresenterAutomationPeer.cs
- ParserHooks.cs
- StandardTransformFactory.cs
- DataSourceControlBuilder.cs
- RewritingSimplifier.cs
- newitemfactory.cs
- _DigestClient.cs
- CodeMemberField.cs
- WhileDesigner.cs
- TypeResolvingOptions.cs
- StrongNamePublicKeyBlob.cs
- AdornerDecorator.cs
- SqlTopReducer.cs
- DecoderFallbackWithFailureFlag.cs
- ElapsedEventArgs.cs
- WebPartEditorOkVerb.cs
- SqlGatherProducedAliases.cs
- PagesChangedEventArgs.cs
- Pkcs7Recipient.cs
- HttpRuntime.cs
- Solver.cs
- DbConnectionPoolIdentity.cs
- ByteStorage.cs
- EventDrivenDesigner.cs
- RC2CryptoServiceProvider.cs
- HMAC.cs
- DummyDataSource.cs
- Unit.cs
- ColumnReorderedEventArgs.cs
- OleDbReferenceCollection.cs
- PageStatePersister.cs
- ByteStreamGeometryContext.cs