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
- ProfilePropertySettingsCollection.cs
- EntityObject.cs
- DialogBaseForm.cs
- ZipIOExtraFieldZip64Element.cs
- Qualifier.cs
- QueryStatement.cs
- DataTableMapping.cs
- ModelServiceImpl.cs
- SizeConverter.cs
- DisplayMemberTemplateSelector.cs
- WebServicesDescriptionAttribute.cs
- CompoundFileStreamReference.cs
- ToolStripDropDownButton.cs
- Matrix3DStack.cs
- DebugView.cs
- ApplicationDirectory.cs
- GlyphElement.cs
- xml.cs
- StorageModelBuildProvider.cs
- WebServiceEnumData.cs
- DataGridHeaderBorder.cs
- ToolStripPanel.cs
- DeflateStream.cs
- LinkTarget.cs
- PreviewKeyDownEventArgs.cs
- DataStreams.cs
- XmlSchemaChoice.cs
- Span.cs
- ReferentialConstraint.cs
- ProjectionCamera.cs
- XmlLinkedNode.cs
- DiscoveryMessageSequenceGenerator.cs
- DrawingAttributes.cs
- DrawingAttributeSerializer.cs
- ComboBoxRenderer.cs
- DataGridViewRowHeaderCell.cs
- FaultImportOptions.cs
- ToolStripDropDownButton.cs
- HtmlLink.cs
- X509LogoTypeExtension.cs
- TextEditorTables.cs
- ThemeDirectoryCompiler.cs
- SpotLight.cs
- ProcessModelInfo.cs
- SortKey.cs
- RemotingServices.cs
- ClientBuildManager.cs
- PathFigureCollectionConverter.cs
- UnionCqlBlock.cs
- PerformanceCounterPermissionEntryCollection.cs
- OperatorExpressions.cs
- GridItemCollection.cs
- WrappedIUnknown.cs
- FontUnitConverter.cs
- XmlBinaryReader.cs
- CompoundFileReference.cs
- ConnectionPoint.cs
- BuildManager.cs
- BindingOperations.cs
- ProfilePropertyNameValidator.cs
- SafeMILHandle.cs
- ListViewItemEventArgs.cs
- SHA384.cs
- MatrixStack.cs
- ChannelServices.cs
- SqlProcedureAttribute.cs
- XsdBuildProvider.cs
- ConfigurationCollectionAttribute.cs
- MdImport.cs
- TrustManagerMoreInformation.cs
- mansign.cs
- TextEditorCharacters.cs
- RangeBaseAutomationPeer.cs
- DbXmlEnabledProviderManifest.cs
- AcceleratedTokenProvider.cs
- Encoder.cs
- AppSettingsReader.cs
- TypeListConverter.cs
- MobileFormsAuthentication.cs
- SchemaLookupTable.cs
- SignedXml.cs
- WindowCollection.cs
- QilUnary.cs
- ButtonRenderer.cs
- EditorResources.cs
- GeneratedView.cs
- DbUpdateCommandTree.cs
- Visual3D.cs
- ObservableDictionary.cs
- WebServiceResponse.cs
- ProcessModuleCollection.cs
- VisualStateChangedEventArgs.cs
- XsdValidatingReader.cs
- RegisteredArrayDeclaration.cs
- InternalTypeHelper.cs
- StatusBar.cs
- SessionParameter.cs
- SystemPens.cs
- OptimizedTemplateContentHelper.cs
- PnrpPermission.cs