Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- GlyphRunDrawing.cs
- HtmlImage.cs
- ServiceModelActivationSectionGroup.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- XmlDocumentType.cs
- PolicyUnit.cs
- FormatConvertedBitmap.cs
- hresults.cs
- UnaryNode.cs
- ExpressionBuilderContext.cs
- PointLight.cs
- GZipDecoder.cs
- SemanticResolver.cs
- ExceptionUtil.cs
- MachinePropertyVariants.cs
- FontDialog.cs
- XmlCharType.cs
- CacheModeValueSerializer.cs
- AuthenticationServiceManager.cs
- Set.cs
- SkewTransform.cs
- GridViewDeletedEventArgs.cs
- PagesSection.cs
- DisplayClaim.cs
- KeyGesture.cs
- ToolStripItemBehavior.cs
- XmlReaderSettings.cs
- MimeMultiPart.cs
- x509store.cs
- XmlSerializerFactory.cs
- GetLastErrorDetailsRequest.cs
- SoundPlayer.cs
- MouseActionConverter.cs
- DataRelationPropertyDescriptor.cs
- ScriptResourceAttribute.cs
- StyleCollection.cs
- RecognizerBase.cs
- EdmScalarPropertyAttribute.cs
- LayoutExceptionEventArgs.cs
- SqlAliasesReferenced.cs
- MonitorWrapper.cs
- TextContainerChangedEventArgs.cs
- EntityClassGenerator.cs
- DesignerSerializationVisibilityAttribute.cs
- PeerToPeerException.cs
- MetadataArtifactLoaderFile.cs
- TableSectionStyle.cs
- DataDesignUtil.cs
- HiddenField.cs
- InstalledVoice.cs
- CodeObject.cs
- DataGridTable.cs
- ContainerUtilities.cs
- SystemIcons.cs
- PopupControlService.cs
- KeyTime.cs
- CultureTableRecord.cs
- DecryptRequest.cs
- DeviceContexts.cs
- DeploymentExceptionMapper.cs
- ConfigurationStrings.cs
- ComponentResourceKeyConverter.cs
- RawStylusActions.cs
- RotateTransform3D.cs
- XmlAutoDetectWriter.cs
- VisualProxy.cs
- TextTreeInsertUndoUnit.cs
- IriParsingElement.cs
- XmlAttributeAttribute.cs
- Array.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- Vector3DAnimation.cs
- ApplicationFileCodeDomTreeGenerator.cs
- Delegate.cs
- ipaddressinformationcollection.cs
- InstalledVoice.cs
- DataGridColumn.cs
- ResourceReferenceExpression.cs
- ReadingWritingEntityEventArgs.cs
- ServiceModelEnhancedConfigurationElementCollection.cs
- DataRowChangeEvent.cs
- LoginUtil.cs
- ScrollViewerAutomationPeer.cs
- DocumentGridPage.cs
- Geometry.cs
- BindableAttribute.cs
- TdsParameterSetter.cs
- CodeNamespaceImportCollection.cs
- ComponentEditorForm.cs
- DataGridTable.cs
- ChunkedMemoryStream.cs
- SiteMapNodeItem.cs
- XXXOnTypeBuilderInstantiation.cs
- XmlSchemaSimpleContentRestriction.cs
- SiteMapNodeCollection.cs
- RadialGradientBrush.cs
- SecurityPolicySection.cs
- DataControlLinkButton.cs
- DataServiceRequestOfT.cs
- PolicyException.cs