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
- SettingsProviderCollection.cs
- SHA512CryptoServiceProvider.cs
- AnimationClockResource.cs
- SyndicationSerializer.cs
- HandlerBase.cs
- ConnectionManagementElement.cs
- MouseGestureConverter.cs
- GlobalizationAssembly.cs
- ExceptionHandlerDesigner.cs
- ListViewTableRow.cs
- KerberosReceiverSecurityToken.cs
- LinqDataSourceDisposeEventArgs.cs
- DeclaredTypeElement.cs
- Vector3DCollectionConverter.cs
- RelOps.cs
- FlowDocument.cs
- DataControlFieldCollection.cs
- StringUtil.cs
- Decoder.cs
- BinaryObjectWriter.cs
- EncryptedData.cs
- _DynamicWinsockMethods.cs
- RelationshipWrapper.cs
- Span.cs
- TcpTransportSecurity.cs
- Thickness.cs
- ConfigXmlText.cs
- NativeRecognizer.cs
- PropertyToken.cs
- MailWriter.cs
- LoginName.cs
- SafeNativeMethods.cs
- X509Certificate2Collection.cs
- PropertyReferenceSerializer.cs
- SHA256Cng.cs
- ExpandCollapseProviderWrapper.cs
- NavigationFailedEventArgs.cs
- ServerValidateEventArgs.cs
- BufferedGraphics.cs
- InternalBufferManager.cs
- SigningCredentials.cs
- URLAttribute.cs
- ApplicationFileCodeDomTreeGenerator.cs
- DrawToolTipEventArgs.cs
- storepermissionattribute.cs
- AbandonedMutexException.cs
- XmlExtensionFunction.cs
- PropertyPathConverter.cs
- ContextMenuService.cs
- PasswordPropertyTextAttribute.cs
- XPathScanner.cs
- Predicate.cs
- SettingsPropertyIsReadOnlyException.cs
- ChannelManager.cs
- ISAPIWorkerRequest.cs
- SoapSchemaExporter.cs
- SynchronizedInputHelper.cs
- CheckBoxPopupAdapter.cs
- ListItemParagraph.cs
- UniqueEventHelper.cs
- ComboBox.cs
- FilteredDataSetHelper.cs
- XmlKeywords.cs
- OleDbError.cs
- Substitution.cs
- EventTrigger.cs
- ElementUtil.cs
- EntityUtil.cs
- HostExecutionContextManager.cs
- DispatcherObject.cs
- DecimalAnimationBase.cs
- LinearQuaternionKeyFrame.cs
- HwndHostAutomationPeer.cs
- SelectionRange.cs
- FileSystemInfo.cs
- DataAccessException.cs
- DesignerTransactionCloseEvent.cs
- ParseElementCollection.cs
- XmlParser.cs
- DataGridAutoFormat.cs
- LifetimeServices.cs
- FixedSOMImage.cs
- XmlNodeWriter.cs
- WebPermission.cs
- Attributes.cs
- _ConnectOverlappedAsyncResult.cs
- PackagePart.cs
- CurrentChangingEventManager.cs
- RtfFormatStack.cs
- PrintingPermissionAttribute.cs
- Light.cs
- SafeEventLogWriteHandle.cs
- AvtEvent.cs
- XmlAnyElementAttribute.cs
- CapabilitiesUse.cs
- TextTreeNode.cs
- PermissionAttributes.cs
- SwitchElementsCollection.cs
- MethodExpression.cs
- TextBlock.cs