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
- SqlFunctionAttribute.cs
- webeventbuffer.cs
- CellCreator.cs
- ErrorEventArgs.cs
- hwndwrapper.cs
- XmlWriter.cs
- AutomationElement.cs
- ClearTypeHintValidation.cs
- SocketCache.cs
- DefaultSection.cs
- NullNotAllowedCollection.cs
- ParallelLoopState.cs
- AnimationLayer.cs
- TextBoxLine.cs
- DetailsViewCommandEventArgs.cs
- X509Utils.cs
- SHA256.cs
- ActiveXContainer.cs
- ApplicationHost.cs
- EnumUnknown.cs
- VisualTarget.cs
- ScrollItemProviderWrapper.cs
- CultureData.cs
- ISFTagAndGuidCache.cs
- GridViewColumnCollectionChangedEventArgs.cs
- OracleParameterCollection.cs
- WriteFileContext.cs
- TextTreeFixupNode.cs
- SamlSecurityTokenAuthenticator.cs
- SizeAnimationClockResource.cs
- WsdlInspector.cs
- CollectionEditorDialog.cs
- WindowsTitleBar.cs
- ErrorHandlerModule.cs
- EncodingDataItem.cs
- RC2.cs
- StateDesigner.LayoutSelectionGlyph.cs
- ResourceProviderFactory.cs
- RestClientProxyHandler.cs
- ZipIOLocalFileHeader.cs
- SByteConverter.cs
- OracleRowUpdatedEventArgs.cs
- ListBoxItem.cs
- SessionStateContainer.cs
- EntityParameterCollection.cs
- Exceptions.cs
- ContentFilePart.cs
- DecimalConstantAttribute.cs
- Sequence.cs
- ArglessEventHandlerProxy.cs
- MruCache.cs
- ProtocolsConfigurationHandler.cs
- GridItemCollection.cs
- DisplayClaim.cs
- GridViewColumn.cs
- EncodingInfo.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- XmlNamespaceManager.cs
- ParserStack.cs
- SignatureHelper.cs
- ISAPIWorkerRequest.cs
- Pen.cs
- BitSet.cs
- SystemTcpConnection.cs
- RuntimeHelpers.cs
- UndoEngine.cs
- XmlDocumentSchema.cs
- RtfControls.cs
- ExpressionBuilder.cs
- MethodToken.cs
- FlowDocument.cs
- DocumentAutomationPeer.cs
- ColumnWidthChangingEvent.cs
- TypeBuilder.cs
- DebugViewWriter.cs
- ImmutableObjectAttribute.cs
- TableAutomationPeer.cs
- MaskedTextBoxDesignerActionList.cs
- Msec.cs
- LockCookie.cs
- SQLInt16.cs
- TimerElapsedEvenArgs.cs
- TextWriterEngine.cs
- PolicyStatement.cs
- EmptyStringExpandableObjectConverter.cs
- DecoderBestFitFallback.cs
- TabletDeviceInfo.cs
- XmlDataSourceNodeDescriptor.cs
- ApplicationInterop.cs
- Operator.cs
- ReadOnlyNameValueCollection.cs
- TcpStreams.cs
- DataObjectFieldAttribute.cs
- BuildProviderCollection.cs
- TagNameToTypeMapper.cs
- ParameterRefs.cs
- Compiler.cs
- HostingEnvironment.cs
- Emitter.cs
- Assert.cs