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
- FtpWebResponse.cs
- HtmlEmptyTagControlBuilder.cs
- EventProviderWriter.cs
- PartialTrustHelpers.cs
- HMACSHA384.cs
- IChannel.cs
- SessionParameter.cs
- PartitionedDataSource.cs
- PreviewKeyDownEventArgs.cs
- FrameworkObject.cs
- IpcServerChannel.cs
- ContentDefinition.cs
- OleServicesContext.cs
- DynamicQueryableWrapper.cs
- CategoryGridEntry.cs
- ListSortDescriptionCollection.cs
- ZipIOLocalFileHeader.cs
- QilNode.cs
- HwndKeyboardInputProvider.cs
- HMACRIPEMD160.cs
- WindowsPrincipal.cs
- FlowThrottle.cs
- ConfigUtil.cs
- PropertyConverter.cs
- AssemblyCache.cs
- XmlSerializerOperationBehavior.cs
- Grid.cs
- cookiecollection.cs
- DefaultClaimSet.cs
- DataRowView.cs
- StringOutput.cs
- XPathLexer.cs
- HostVisual.cs
- SQLByteStorage.cs
- TextureBrush.cs
- LinqDataView.cs
- ObjectDataSourceEventArgs.cs
- SchemaAttDef.cs
- SequenceDesigner.xaml.cs
- DataTransferEventArgs.cs
- DataGridViewRowConverter.cs
- GregorianCalendarHelper.cs
- HttpStreamMessageEncoderFactory.cs
- FormViewInsertedEventArgs.cs
- RSACryptoServiceProvider.cs
- OdbcFactory.cs
- Activity.cs
- PathFigureCollectionValueSerializer.cs
- MailMessageEventArgs.cs
- MappingException.cs
- QueryRewriter.cs
- EntitySetDataBindingList.cs
- ProxyElement.cs
- ThreadSafeList.cs
- BezierSegment.cs
- RealProxy.cs
- SoapHeaderException.cs
- SafeProcessHandle.cs
- Query.cs
- ApplicationHost.cs
- DurableMessageDispatchInspector.cs
- WebUtil.cs
- InfoCardSymmetricCrypto.cs
- MonikerSyntaxException.cs
- DependentList.cs
- LogReservationCollection.cs
- TypeForwardedToAttribute.cs
- MouseGestureConverter.cs
- Interlocked.cs
- HMACSHA384.cs
- DetailsViewUpdatedEventArgs.cs
- initElementDictionary.cs
- FontFamily.cs
- XmlHierarchicalDataSourceView.cs
- CatalogPart.cs
- DataKey.cs
- AsyncMethodInvoker.cs
- XmlDataSource.cs
- TableHeaderCell.cs
- WebBrowserDocumentCompletedEventHandler.cs
- RequestResizeEvent.cs
- ReflectionServiceProvider.cs
- Stopwatch.cs
- OracleBFile.cs
- WebBodyFormatMessageProperty.cs
- WebBrowserBase.cs
- Scheduler.cs
- ScrollableControl.cs
- PointAnimationUsingKeyFrames.cs
- DataBindingHandlerAttribute.cs
- OleDbPropertySetGuid.cs
- HtmlTernaryTree.cs
- Byte.cs
- ImageDrawing.cs
- KeyGestureConverter.cs
- XmlSerializationWriter.cs
- XmlDigitalSignatureProcessor.cs
- Keywords.cs
- FileEnumerator.cs
- UseManagedPresentationElement.cs