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
- SqlUserDefinedAggregateAttribute.cs
- panel.cs
- storagemappingitemcollection.viewdictionary.cs
- BlobPersonalizationState.cs
- ModuleBuilderData.cs
- DateTime.cs
- EventManager.cs
- FileLogRecordEnumerator.cs
- SqlTypeSystemProvider.cs
- QilDataSource.cs
- FileUtil.cs
- MenuItemCollection.cs
- UserControl.cs
- OutOfProcStateClientManager.cs
- MemberHolder.cs
- DataServiceOperationContext.cs
- SqlDeflator.cs
- CachedTypeface.cs
- TraceLevelStore.cs
- FontSource.cs
- DataGridViewCellStyle.cs
- Keywords.cs
- WebPartMenuStyle.cs
- QueryParameter.cs
- AccessDataSourceView.cs
- JsonCollectionDataContract.cs
- CodeVariableReferenceExpression.cs
- XsltInput.cs
- DelayLoadType.cs
- HijriCalendar.cs
- WsatProxy.cs
- SecureStringHasher.cs
- SchemaImporter.cs
- CodeDirectionExpression.cs
- ExpandableObjectConverter.cs
- CornerRadius.cs
- XPathNodeIterator.cs
- NetworkInformationPermission.cs
- ComplexPropertyEntry.cs
- MappingItemCollection.cs
- FormsAuthentication.cs
- BitmapData.cs
- URL.cs
- DropShadowBitmapEffect.cs
- COM2FontConverter.cs
- ReadOnlyActivityGlyph.cs
- StatusBarPanelClickEvent.cs
- HelpPage.cs
- TokenFactoryCredential.cs
- HttpModulesSection.cs
- TextElementAutomationPeer.cs
- GCHandleCookieTable.cs
- MasterPageParser.cs
- ComponentConverter.cs
- MobileRedirect.cs
- XmlTextReaderImplHelpers.cs
- _NestedSingleAsyncResult.cs
- AnnotationDocumentPaginator.cs
- ItemCheckedEvent.cs
- ReliableSessionBindingElement.cs
- Int16Converter.cs
- Executor.cs
- MatchingStyle.cs
- ColumnTypeConverter.cs
- DefaultTraceListener.cs
- FolderBrowserDialog.cs
- ComPlusTraceRecord.cs
- ObjectHandle.cs
- Light.cs
- MessagePartDescriptionCollection.cs
- HwndHostAutomationPeer.cs
- MutexSecurity.cs
- dtdvalidator.cs
- SpinLock.cs
- XmlSchemaImporter.cs
- EndpointAddress.cs
- FilteredXmlReader.cs
- SessionPageStatePersister.cs
- SeekStoryboard.cs
- HtmlButton.cs
- ToolStripPanelDesigner.cs
- ACE.cs
- VisualStyleInformation.cs
- TitleStyle.cs
- CodeSnippetStatement.cs
- PropertyPathWorker.cs
- OlePropertyStructs.cs
- SafeMILHandle.cs
- returneventsaver.cs
- DataGridViewElement.cs
- SubclassTypeValidatorAttribute.cs
- ToolBar.cs
- DetailsViewPagerRow.cs
- SqlUtils.cs
- WindowsEditBoxRange.cs
- CompilerErrorCollection.cs
- BindingExpressionBase.cs
- TagMapInfo.cs
- StylusPointPropertyUnit.cs
- FontNameConverter.cs