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
- MenuItemStyleCollection.cs
- Stroke2.cs
- DataControlField.cs
- PathTooLongException.cs
- GroupLabel.cs
- PropertyNames.cs
- Column.cs
- DbConnectionHelper.cs
- ReachSerializerAsync.cs
- DataDocumentXPathNavigator.cs
- DispatcherExceptionFilterEventArgs.cs
- TextTreeRootTextBlock.cs
- Section.cs
- Array.cs
- BitVector32.cs
- KeyInfo.cs
- XmlTextEncoder.cs
- SubqueryRules.cs
- _SslState.cs
- DataGridViewColumnEventArgs.cs
- StorageMappingFragment.cs
- ScrollProviderWrapper.cs
- securitymgrsite.cs
- TemplateKey.cs
- CSharpCodeProvider.cs
- StartUpEventArgs.cs
- PeerPresenceInfo.cs
- rsa.cs
- MatrixTransform.cs
- TypeUnloadedException.cs
- ClientSession.cs
- GridViewEditEventArgs.cs
- PasswordRecovery.cs
- LongValidatorAttribute.cs
- _AuthenticationState.cs
- NameSpaceExtractor.cs
- CellLabel.cs
- ReadOnlyAttribute.cs
- TreeNodeMouseHoverEvent.cs
- SemanticKeyElement.cs
- SoapServerMethod.cs
- EditingScopeUndoUnit.cs
- CollectionViewGroupInternal.cs
- InfoCardSchemas.cs
- LinearGradientBrush.cs
- _RequestLifetimeSetter.cs
- TextEditorContextMenu.cs
- ServicePointManager.cs
- AssemblyAssociatedContentFileAttribute.cs
- DelegateBodyWriter.cs
- SystemEvents.cs
- SrgsDocument.cs
- SuppressMergeCheckAttribute.cs
- WebServiceData.cs
- DataBinding.cs
- HttpHandlerActionCollection.cs
- EventDrivenDesigner.cs
- DLinqColumnProvider.cs
- __FastResourceComparer.cs
- XmlSchemaSimpleContent.cs
- LocatorBase.cs
- FileStream.cs
- MDIWindowDialog.cs
- LinqDataSourceView.cs
- DelegatingConfigHost.cs
- MapPathBasedVirtualPathProvider.cs
- SiteIdentityPermission.cs
- Vector3dCollection.cs
- InstanceLockLostException.cs
- UserControl.cs
- RowSpanVector.cs
- TdsParserSessionPool.cs
- ChtmlCommandAdapter.cs
- util.cs
- DataGridRowHeaderAutomationPeer.cs
- PersianCalendar.cs
- DependencyPropertyAttribute.cs
- TextEffectCollection.cs
- BuiltInExpr.cs
- SqlDataReaderSmi.cs
- KnownTypesHelper.cs
- SchemaLookupTable.cs
- BaseCodePageEncoding.cs
- PeerValidationBehavior.cs
- AdPostCacheSubstitution.cs
- WS2007HttpBindingCollectionElement.cs
- StructuralObject.cs
- Descriptor.cs
- DispatchChannelSink.cs
- StringAnimationUsingKeyFrames.cs
- EventTrigger.cs
- followingsibling.cs
- ReadOnlyCollectionBuilder.cs
- AssociatedControlConverter.cs
- DataRowView.cs
- XmlDocumentFragment.cs
- ExtractCollection.cs
- Typeface.cs
- RepeaterItem.cs
- WebBrowserBase.cs