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
- DPAPIProtectedConfigurationProvider.cs
- Utils.cs
- OracleTransaction.cs
- ProxyAssemblyNotLoadedException.cs
- HttpResponse.cs
- RijndaelManaged.cs
- WindowsStatic.cs
- RankException.cs
- Int64AnimationUsingKeyFrames.cs
- HTTPNotFoundHandler.cs
- OutputCacheProviderCollection.cs
- PTUtility.cs
- WindowsEditBoxRange.cs
- OdbcStatementHandle.cs
- EdmSchemaAttribute.cs
- RoleExceptions.cs
- MeasurementDCInfo.cs
- SpellerStatusTable.cs
- VectorAnimationUsingKeyFrames.cs
- LongTypeConverter.cs
- HandlerWithFactory.cs
- JsonWriterDelegator.cs
- coordinatorfactory.cs
- XPathDocumentNavigator.cs
- TreeView.cs
- QueryStringParameter.cs
- UrlUtility.cs
- InvokeHandlers.cs
- ProfileServiceManager.cs
- TextMarkerSource.cs
- Signature.cs
- ContextMarshalException.cs
- SafeRightsManagementPubHandle.cs
- XmlNodeChangedEventManager.cs
- BaseHashHelper.cs
- PermissionListSet.cs
- OptimizerPatterns.cs
- UnsafeNativeMethods.cs
- UnsafeNativeMethods.cs
- WindowsAuthenticationEventArgs.cs
- DistributedTransactionPermission.cs
- MulticastNotSupportedException.cs
- SizeFConverter.cs
- XmlWrappingWriter.cs
- ArrangedElement.cs
- ConfigurationElementCollection.cs
- ToolStripScrollButton.cs
- QueueProcessor.cs
- TypedReference.cs
- StreamingContext.cs
- Command.cs
- DataGridViewDataConnection.cs
- XmlSchemaAnnotated.cs
- SendDesigner.xaml.cs
- SignatureDescription.cs
- Enlistment.cs
- WebHttpSecurityModeHelper.cs
- GridViewUpdatedEventArgs.cs
- PictureBox.cs
- ObjRef.cs
- TextTreeInsertUndoUnit.cs
- CodeSnippetExpression.cs
- GlyphInfoList.cs
- EnumerableCollectionView.cs
- HostProtectionException.cs
- EntityContainerEmitter.cs
- CheckBoxList.cs
- SecurityCookieModeValidator.cs
- WmlTextBoxAdapter.cs
- ObfuscationAttribute.cs
- SchemaCollectionCompiler.cs
- StringKeyFrameCollection.cs
- PathNode.cs
- WebPartConnectionsConfigureVerb.cs
- EditorPartChrome.cs
- cookiecontainer.cs
- PropertyPushdownHelper.cs
- TdsParameterSetter.cs
- ObjectDataSourceEventArgs.cs
- ScrollBarAutomationPeer.cs
- CommandConverter.cs
- ObjectHelper.cs
- GacUtil.cs
- CommandLibraryHelper.cs
- DeleteIndexBinder.cs
- DataTableReaderListener.cs
- RequestNavigateEventArgs.cs
- SearchForVirtualItemEventArgs.cs
- SQLInt64.cs
- SplitterEvent.cs
- SerTrace.cs
- UserInitiatedRoutedEventPermission.cs
- SQLStringStorage.cs
- HwndTarget.cs
- DesignerOptionService.cs
- TreeViewImageKeyConverter.cs
- LogReservationCollection.cs
- DBCommandBuilder.cs
- IProvider.cs
- VirtualDirectoryMapping.cs