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
- brushes.cs
- Sorting.cs
- AuthenticationException.cs
- XpsFilter.cs
- ActivityBuilderHelper.cs
- CodeCompileUnit.cs
- WbmpConverter.cs
- AttachInfo.cs
- TextHidden.cs
- WeakEventTable.cs
- HandlerBase.cs
- ViewCellRelation.cs
- DrawingVisualDrawingContext.cs
- Timer.cs
- FunctionDescription.cs
- DataContractSerializerOperationFormatter.cs
- MaxValueConverter.cs
- DateTimeFormatInfoScanner.cs
- SqlDataSourceCommandParser.cs
- AsynchronousChannelMergeEnumerator.cs
- XmlSortKey.cs
- Vector.cs
- DisplayNameAttribute.cs
- PageThemeParser.cs
- ObjectContext.cs
- WebBrowserNavigatingEventHandler.cs
- SecurityException.cs
- SoapAttributeAttribute.cs
- ListViewPagedDataSource.cs
- TextSerializer.cs
- UnknownBitmapEncoder.cs
- XmlnsDictionary.cs
- DataRowChangeEvent.cs
- IMembershipProvider.cs
- PlatformCulture.cs
- SmiMetaData.cs
- SmtpException.cs
- EncoderParameter.cs
- FormViewCommandEventArgs.cs
- AspNetPartialTrustHelpers.cs
- XLinq.cs
- ImageButton.cs
- ListItemCollection.cs
- ContextDataSourceView.cs
- FtpCachePolicyElement.cs
- CellNormalizer.cs
- MexBindingBindingCollectionElement.cs
- RegexFCD.cs
- ClientSponsor.cs
- AppSettingsReader.cs
- InlineCollection.cs
- ListViewItemCollectionEditor.cs
- ListView.cs
- Literal.cs
- DocumentGrid.cs
- ComponentResourceKey.cs
- TextRangeEdit.cs
- AutomationIdentifierGuids.cs
- TemplateControl.cs
- GlyphRun.cs
- ToolStripContentPanel.cs
- QueryStringParameter.cs
- BamlRecords.cs
- PointLight.cs
- PageThemeCodeDomTreeGenerator.cs
- LeaseManager.cs
- TextTreeExtractElementUndoUnit.cs
- InfoCardKeyedHashAlgorithm.cs
- MsmqVerifier.cs
- SystemIcmpV6Statistics.cs
- XmlProcessingInstruction.cs
- DbXmlEnabledProviderManifest.cs
- AsymmetricAlgorithm.cs
- WindowsFormsHostAutomationPeer.cs
- DocumentXPathNavigator.cs
- ExtenderProvidedPropertyAttribute.cs
- X509AudioLogo.cs
- MembershipPasswordException.cs
- BaseDataList.cs
- AssertHelper.cs
- BufferBuilder.cs
- SqlTypeConverter.cs
- Baml2006ReaderContext.cs
- HealthMonitoringSection.cs
- _AutoWebProxyScriptEngine.cs
- SelectionChangedEventArgs.cs
- RemoteCryptoTokenProvider.cs
- RightsManagementLicense.cs
- AppDomainGrammarProxy.cs
- DataGrid.cs
- BaseAsyncResult.cs
- PersistenceTypeAttribute.cs
- LinkArea.cs
- SqlGenericUtil.cs
- Nodes.cs
- StatusStrip.cs
- WindowsStartMenu.cs
- DataGridToolTip.cs
- TemplateField.cs
- AuthorizationBehavior.cs