Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / SqlClient / SqlGen / SymbolUsageManager.cs / 1305376 / SymbolUsageManager.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; namespace System.Data.SqlClient.SqlGen { ////// Used for wrapping a boolean value as an object. /// internal class BoolWrapper { internal bool Value {get; set;} internal BoolWrapper() { this.Value = false; } } ////// Tracks the usage of symbols. /// When registering a symbol with the usage manager if an input symbol is specified, /// than the usage of the two is 'connected' - if one ever gets marked as used, /// the other one becomes 'used' too. /// internal class SymbolUsageManager { private readonly DictionaryoptionalColumnUsage = new Dictionary (); internal bool ContainsKey(Symbol key) { return optionalColumnUsage.ContainsKey(key); } internal bool TryGetValue(Symbol key, out bool value) { BoolWrapper wrapper; if (optionalColumnUsage.TryGetValue(key, out wrapper)) { value = wrapper.Value; return true; } value = false; return false; } internal void Add(Symbol sourceSymbol, Symbol symbolToAdd) { BoolWrapper wrapper; if (sourceSymbol == null || !this.optionalColumnUsage.TryGetValue(sourceSymbol, out wrapper)) { wrapper = new BoolWrapper(); } this.optionalColumnUsage.Add(symbolToAdd, wrapper); } internal void MarkAsUsed(Symbol key) { if (optionalColumnUsage.ContainsKey(key)) { optionalColumnUsage[key].Value = true; } } internal bool IsUsed(Symbol key) { return optionalColumnUsage[key].Value; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BindUriHelper.cs
- SecurityAlgorithmSuite.cs
- StylusSystemGestureEventArgs.cs
- Vector3DAnimation.cs
- WebEventCodes.cs
- AnnotationDocumentPaginator.cs
- TracePayload.cs
- XmlSchemaAttributeGroupRef.cs
- LocatorGroup.cs
- precedingquery.cs
- RoutedEventArgs.cs
- PointCollection.cs
- KeyPressEvent.cs
- FormsAuthentication.cs
- XmlElementAttributes.cs
- DecimalSumAggregationOperator.cs
- SqlBulkCopyColumnMapping.cs
- Exceptions.cs
- RegexRunnerFactory.cs
- EpmCustomContentDeSerializer.cs
- TraceEventCache.cs
- ResourceSetExpression.cs
- ItemCollection.cs
- ArraySortHelper.cs
- DependencyObjectPropertyDescriptor.cs
- Helpers.cs
- TrackingDataItem.cs
- BrowserCapabilitiesFactoryBase.cs
- ContextMenu.cs
- AmbientLight.cs
- WindowsListView.cs
- ParenthesizePropertyNameAttribute.cs
- IResourceProvider.cs
- CompiledQueryCacheKey.cs
- TextChangedEventArgs.cs
- Dump.cs
- DefaultObjectMappingItemCollection.cs
- ScrollPattern.cs
- SqlAliasesReferenced.cs
- WindowsStatusBar.cs
- GeometryConverter.cs
- DocumentViewerHelper.cs
- FileBasedResourceGroveler.cs
- JsonServiceDocumentSerializer.cs
- ImportCatalogPart.cs
- TlsnegoTokenProvider.cs
- Debug.cs
- XmlSchemaCompilationSettings.cs
- XmlSchemaChoice.cs
- ContainerParaClient.cs
- SpecularMaterial.cs
- CalendarTable.cs
- XmlSchemaSet.cs
- Pointer.cs
- SettingsAttributeDictionary.cs
- OdbcParameter.cs
- RuntimeHandles.cs
- Empty.cs
- IntegerValidator.cs
- odbcmetadatacolumnnames.cs
- ConfigurationLocationCollection.cs
- ApplicationException.cs
- BaseHashHelper.cs
- StorageFunctionMapping.cs
- CaseStatement.cs
- SqlStatistics.cs
- CryptoApi.cs
- ExpressionHelper.cs
- AdRotatorDesigner.cs
- CodeDirectionExpression.cs
- XmlTextWriter.cs
- IdentifierCollection.cs
- StorageInfo.cs
- Security.cs
- RSAPKCS1KeyExchangeFormatter.cs
- NamedObject.cs
- CapabilitiesUse.cs
- FastEncoder.cs
- AccessedThroughPropertyAttribute.cs
- TextEditorContextMenu.cs
- JoinSymbol.cs
- PatternMatcher.cs
- LicFileLicenseProvider.cs
- SecurityTokenSerializer.cs
- StyleSelector.cs
- XmlHierarchyData.cs
- Page.cs
- UserControl.cs
- MasterPageParser.cs
- Evaluator.cs
- Separator.cs
- EventsTab.cs
- AliasedSlot.cs
- WindowsToolbar.cs
- XmlEncoding.cs
- SourceChangedEventArgs.cs
- DataGridViewDataConnection.cs
- _ConnectionGroup.cs
- Metadata.cs
- Win32.cs