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
- TextBoxView.cs
- ProcessModelSection.cs
- FlagsAttribute.cs
- srgsitem.cs
- DoWorkEventArgs.cs
- ScaleTransform.cs
- CachedRequestParams.cs
- MultiSelectRootGridEntry.cs
- WebEncodingValidator.cs
- Size.cs
- HashJoinQueryOperatorEnumerator.cs
- DisposableCollectionWrapper.cs
- IResourceProvider.cs
- InvalidWorkflowException.cs
- SoapHeader.cs
- SqlVisitor.cs
- DynamicValueConverter.cs
- TouchDevice.cs
- TableLayoutColumnStyleCollection.cs
- FrameSecurityDescriptor.cs
- XmlEntity.cs
- SmiMetaDataProperty.cs
- SyndicationDeserializer.cs
- OracleRowUpdatingEventArgs.cs
- DisplayMemberTemplateSelector.cs
- SecurityTraceRecordHelper.cs
- MbpInfo.cs
- SqlTypesSchemaImporter.cs
- TrackingDataItemValue.cs
- GeometryHitTestParameters.cs
- Rotation3D.cs
- SelectionItemProviderWrapper.cs
- ResourcePart.cs
- ProxyWebPartConnectionCollection.cs
- TemplatePartAttribute.cs
- ManagementObjectCollection.cs
- ContextMenu.cs
- WindowsHyperlink.cs
- WebHostUnsafeNativeMethods.cs
- AncestorChangedEventArgs.cs
- Stream.cs
- MemoryFailPoint.cs
- BaseDataBoundControl.cs
- MobilePage.cs
- LayoutExceptionEventArgs.cs
- ProxyHwnd.cs
- Pen.cs
- TextContainer.cs
- MatrixKeyFrameCollection.cs
- TextDecorationUnitValidation.cs
- TextDecorationCollectionConverter.cs
- DefaultPerformanceCounters.cs
- StyleXamlTreeBuilder.cs
- NotImplementedException.cs
- COAUTHIDENTITY.cs
- DataServiceRequest.cs
- TrustLevel.cs
- XmlnsDefinitionAttribute.cs
- KnowledgeBase.cs
- messageonlyhwndwrapper.cs
- Imaging.cs
- RoutedPropertyChangedEventArgs.cs
- ToolTipService.cs
- Timer.cs
- ItemMap.cs
- FrugalMap.cs
- StringUtil.cs
- BitmapEffect.cs
- SurrogateDataContract.cs
- SimpleApplicationHost.cs
- CodeAttachEventStatement.cs
- TypedTableBaseExtensions.cs
- DynamicRouteExpression.cs
- LeafCellTreeNode.cs
- GeometryCombineModeValidation.cs
- GeometryModel3D.cs
- AutomationPatternInfo.cs
- DeclaredTypeValidatorAttribute.cs
- DataSourceGeneratorException.cs
- TextRangeEditTables.cs
- FileInfo.cs
- CodeDirectoryCompiler.cs
- DesignTimeDataBinding.cs
- ScrollEventArgs.cs
- _BasicClient.cs
- ProfilePropertyMetadata.cs
- MessageBox.cs
- FlowLayoutPanel.cs
- AppLevelCompilationSectionCache.cs
- ListParagraph.cs
- ExtensionQuery.cs
- Size3D.cs
- HybridWebProxyFinder.cs
- FontDifferentiator.cs
- JsonCollectionDataContract.cs
- ObjectParameter.cs
- ClaimTypeElement.cs
- AsyncStreamReader.cs
- IPHostEntry.cs
- HwndHost.cs