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
- _HeaderInfo.cs
- QueryStringParameter.cs
- RemotingHelper.cs
- SystemIPv6InterfaceProperties.cs
- _CookieModule.cs
- DispatcherOperation.cs
- DbConnectionStringCommon.cs
- Path.cs
- DataService.cs
- TextComposition.cs
- EpmCustomContentSerializer.cs
- iisPickupDirectory.cs
- EndpointInfoCollection.cs
- ActivityMetadata.cs
- ParamArrayAttribute.cs
- EventTrigger.cs
- TypeListConverter.cs
- BrushValueSerializer.cs
- InputQueue.cs
- RoutingSection.cs
- InkCanvasSelectionAdorner.cs
- LinkArea.cs
- ProxyWebPart.cs
- DesignerAutoFormatCollection.cs
- SerialPinChanges.cs
- TableRow.cs
- GridViewEditEventArgs.cs
- DbConnectionPoolGroup.cs
- ShaderRenderModeValidation.cs
- SecurityBindingElementImporter.cs
- WorkflowRuntimeSection.cs
- XXXInfos.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- SoundPlayerAction.cs
- ConstructorBuilder.cs
- SqlErrorCollection.cs
- GridViewRow.cs
- BitmapMetadataBlob.cs
- MenuCommands.cs
- Errors.cs
- TcpServerChannel.cs
- Attribute.cs
- Emitter.cs
- Confirm.cs
- DiagnosticTraceSchemas.cs
- EntityUtil.cs
- ForceCopyBuildProvider.cs
- TableColumnCollection.cs
- DataSourceXmlAttributeAttribute.cs
- TreeNodeMouseHoverEvent.cs
- TemplateBuilder.cs
- HtmlElementCollection.cs
- Enlistment.cs
- CssStyleCollection.cs
- TreeNodeBindingDepthConverter.cs
- BatchWriter.cs
- TransformerConfigurationWizardBase.cs
- ValidationPropertyAttribute.cs
- VariantWrapper.cs
- DataTableNewRowEvent.cs
- InputMethodStateTypeInfo.cs
- PerfCounters.cs
- Group.cs
- SweepDirectionValidation.cs
- DriveNotFoundException.cs
- VScrollProperties.cs
- HtmlInputText.cs
- Freezable.cs
- ApplicationInfo.cs
- mil_commands.cs
- unsafenativemethodstextservices.cs
- XamlSerializationHelper.cs
- ProcessThreadCollection.cs
- TextEditorContextMenu.cs
- TraceHandler.cs
- UnhandledExceptionEventArgs.cs
- PerformanceCounterPermission.cs
- RelationshipConstraintValidator.cs
- securitycriticaldataClass.cs
- EnumValidator.cs
- DirectionalLight.cs
- MDIClient.cs
- ComboBoxItem.cs
- PrintingPermission.cs
- ProjectionCamera.cs
- NavigateUrlConverter.cs
- SystemWebCachingSectionGroup.cs
- StreamGeometry.cs
- XPathDocumentBuilder.cs
- BaseCollection.cs
- RootContext.cs
- SymbolEqualComparer.cs
- SqlLiftWhereClauses.cs
- Msmq4SubqueuePoisonHandler.cs
- StringPropertyBuilder.cs
- PrintingPermission.cs
- FilteredXmlReader.cs
- MessageEncoder.cs
- DrawListViewSubItemEventArgs.cs
- FontDialog.cs