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
- MemberCollection.cs
- InputGestureCollection.cs
- TdsParserSafeHandles.cs
- XmlDataSourceView.cs
- BindingSource.cs
- PanelStyle.cs
- XmlNamespaceManager.cs
- SelectionService.cs
- DocumentSequence.cs
- BookmarkInfo.cs
- WebRequestModuleElement.cs
- DbDataReader.cs
- WindowsListViewItemCheckBox.cs
- LayoutEvent.cs
- StrongTypingException.cs
- LinearQuaternionKeyFrame.cs
- Events.cs
- ExpressionBuilder.cs
- SqlTransaction.cs
- SettingsProperty.cs
- CodeMemberEvent.cs
- SafeFindHandle.cs
- ValidationPropertyAttribute.cs
- SelectedDatesCollection.cs
- OutputCacheSettings.cs
- SparseMemoryStream.cs
- WebPartRestoreVerb.cs
- SearchForVirtualItemEventArgs.cs
- UICuesEvent.cs
- Decimal.cs
- SAPICategories.cs
- FunctionImportElement.cs
- EncoderBestFitFallback.cs
- JsonReaderWriterFactory.cs
- HtmlLink.cs
- MultiViewDesigner.cs
- MissingMethodException.cs
- TemplateManager.cs
- IfJoinedCondition.cs
- coordinator.cs
- TraceRecord.cs
- XmlReflectionImporter.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- ServicePrincipalNameElement.cs
- DebuggerAttributes.cs
- NativeObjectSecurity.cs
- RenamedEventArgs.cs
- XmlSchemaImporter.cs
- GridViewUpdatedEventArgs.cs
- SecurityTokenReferenceStyle.cs
- BinaryKeyIdentifierClause.cs
- XmlParserContext.cs
- Application.cs
- Canvas.cs
- XappLauncher.cs
- FileLogRecordHeader.cs
- PageTheme.cs
- PersonalizationDictionary.cs
- TypeElement.cs
- OracleMonthSpan.cs
- SmiGettersStream.cs
- FixUpCollection.cs
- DataServiceHostWrapper.cs
- MembershipUser.cs
- Substitution.cs
- OverflowException.cs
- Attributes.cs
- SafeThemeHandle.cs
- XPathParser.cs
- EmptyEnumerable.cs
- Resources.Designer.cs
- EndOfStreamException.cs
- MemberRelationshipService.cs
- BookmarkScopeManager.cs
- XmlDataLoader.cs
- CounterCreationData.cs
- SQLMoneyStorage.cs
- SchemaImporter.cs
- X509Certificate.cs
- ByteFacetDescriptionElement.cs
- BamlRecords.cs
- ClientTargetCollection.cs
- Funcletizer.cs
- ProjectionPath.cs
- StatusStrip.cs
- XmlSchemaProviderAttribute.cs
- DataGridViewLinkCell.cs
- LoggedException.cs
- ScriptComponentDescriptor.cs
- SvcMapFile.cs
- ConstraintEnumerator.cs
- XomlDesignerLoader.cs
- ContextBase.cs
- ScrollViewerAutomationPeer.cs
- PluralizationService.cs
- SessionPageStateSection.cs
- QueryCacheEntry.cs
- HttpCookie.cs
- SafeHandle.cs
- FigureParagraph.cs