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
- WebDescriptionAttribute.cs
- AsymmetricKeyExchangeFormatter.cs
- CharAnimationBase.cs
- DrawingCollection.cs
- XmlJsonReader.cs
- PageHandlerFactory.cs
- ByteRangeDownloader.cs
- DataProtection.cs
- PassportIdentity.cs
- FormClosedEvent.cs
- OutputCacheSection.cs
- TaskResultSetter.cs
- AspCompat.cs
- StateManagedCollection.cs
- NameValueConfigurationCollection.cs
- UnknownWrapper.cs
- CharEnumerator.cs
- ListBoxItemWrapperAutomationPeer.cs
- CallbackValidator.cs
- QueryRewriter.cs
- VisualStyleInformation.cs
- MetabaseReader.cs
- InputReport.cs
- MSAAEventDispatcher.cs
- WebPartDisplayModeEventArgs.cs
- DBSchemaTable.cs
- SimpleBitVector32.cs
- RelationshipSet.cs
- WebConfigurationFileMap.cs
- DbDataRecord.cs
- XmlSerializableReader.cs
- UnsafeNetInfoNativeMethods.cs
- BaseParser.cs
- PathTooLongException.cs
- AnchoredBlock.cs
- ConstraintStruct.cs
- GenericParameterDataContract.cs
- BaseProcessor.cs
- NativeWindow.cs
- WebPartConnectionCollection.cs
- SplineKeyFrames.cs
- OdbcConnectionHandle.cs
- DbBuffer.cs
- SecurityToken.cs
- GridViewCancelEditEventArgs.cs
- HtmlWindowCollection.cs
- Monitor.cs
- TextParagraph.cs
- SqlWriter.cs
- Form.cs
- StyleBamlTreeBuilder.cs
- CodeGenerator.cs
- TrackingRecord.cs
- StructuredCompositeActivityDesigner.cs
- URIFormatException.cs
- LayoutSettings.cs
- MetadataUtilsSmi.cs
- PlanCompilerUtil.cs
- LogEntryDeserializer.cs
- DynamicValidatorEventArgs.cs
- StateItem.cs
- RecordsAffectedEventArgs.cs
- Dynamic.cs
- AddInServer.cs
- NavigationWindow.cs
- SessionSwitchEventArgs.cs
- DiagnosticsConfiguration.cs
- HostAdapter.cs
- TextHidden.cs
- JsonReader.cs
- XomlDesignerLoader.cs
- PackagingUtilities.cs
- ViewCellSlot.cs
- QueryCreatedEventArgs.cs
- ConvertBinder.cs
- PageThemeBuildProvider.cs
- HtmlInputFile.cs
- IListConverters.cs
- FieldBuilder.cs
- IssuanceTokenProviderBase.cs
- NetTcpBindingElement.cs
- PersonalizationEntry.cs
- ConsumerConnectionPoint.cs
- bindurihelper.cs
- LinearQuaternionKeyFrame.cs
- ProfilePropertyMetadata.cs
- WindowsHyperlink.cs
- HMACSHA512.cs
- SspiSafeHandles.cs
- PositiveTimeSpanValidatorAttribute.cs
- FixedTextSelectionProcessor.cs
- ProjectionCamera.cs
- FormViewDeleteEventArgs.cs
- LineServicesRun.cs
- Nullable.cs
- AssemblyBuilderData.cs
- TaskbarItemInfo.cs
- Misc.cs
- SearchExpression.cs
- StateMachineSubscriptionManager.cs