Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / SqlClient / SqlGen / OptionalColumn.cs / 1305376 / OptionalColumn.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Diagnostics; namespace System.Data.SqlClient.SqlGen { ////// Represents a column in a select list that should be printed only if it is later used. /// Such columns get added by internal sealed class OptionalColumn { #region Private State private readonly SymbolUsageManager m_usageManager; // The SqlBuilder that contains the column building blocks (e.g: "c.X as X1") private readonly SqlBuilder m_builder = new SqlBuilder(); // The symbol representing the optional column private readonly Symbol m_symbol; #endregion #region Internal Methods ///. /// The SymbolUsageManager associated with the OptionalColumn has the information whether the column /// has been used based on its symbol. /// /// Append to the "fragment" representing this column /// internal void Append(object s) { m_builder.Append(s); } internal void MarkAsUsed() { this.m_usageManager.MarkAsUsed(this.m_symbol); } #endregion #region Constructor internal OptionalColumn(SymbolUsageManager usageManager, Symbol symbol) { this.m_usageManager = usageManager; this.m_symbol = symbol; } #endregion #region Internal members ////// Writes that fragment that represents the optional column /// if the usage manager says it is used. /// /// /// public bool WriteSqlIfUsed(SqlWriter writer, SqlGenerator sqlGenerator, string separator) { if (m_usageManager.IsUsed(m_symbol)) { writer.Write(separator); m_builder.WriteSql(writer, sqlGenerator); return true; } return false; } #endregion } } // 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
- IxmlLineInfo.cs
- Light.cs
- XsltInput.cs
- MessageContractImporter.cs
- FormViewDeletedEventArgs.cs
- ViewBox.cs
- LinkConverter.cs
- XPathNodeInfoAtom.cs
- SchemaInfo.cs
- RadioButtonBaseAdapter.cs
- XPathDocumentBuilder.cs
- Graph.cs
- Configuration.cs
- ResourceProviderFactory.cs
- BulletedListEventArgs.cs
- _TLSstream.cs
- Configuration.cs
- AdCreatedEventArgs.cs
- DbProviderFactoriesConfigurationHandler.cs
- Internal.cs
- DbQueryCommandTree.cs
- ExtensibleClassFactory.cs
- CalendarDataBindingHandler.cs
- CatalogZone.cs
- ArrayTypeMismatchException.cs
- MimeTypePropertyAttribute.cs
- BindingOperations.cs
- DataServiceQueryProvider.cs
- Vector3DValueSerializer.cs
- SchemaEntity.cs
- HttpCachePolicy.cs
- RenderData.cs
- TextEvent.cs
- TogglePattern.cs
- ADMembershipUser.cs
- TypeHelpers.cs
- InitializationEventAttribute.cs
- WebPartCancelEventArgs.cs
- ProfileSettingsCollection.cs
- WpfKnownMember.cs
- ToolBarButtonClickEvent.cs
- PageContentAsyncResult.cs
- InstanceDescriptor.cs
- NativeMethods.cs
- WebEventCodes.cs
- SinglePageViewer.cs
- ObjectHandle.cs
- DrawingAttributeSerializer.cs
- SqlReferenceCollection.cs
- PublisherMembershipCondition.cs
- ThreadStateException.cs
- DATA_BLOB.cs
- GeometryGroup.cs
- StyleBamlTreeBuilder.cs
- PartialCachingControl.cs
- CacheMemory.cs
- AddInEnvironment.cs
- IncrementalHitTester.cs
- SQLBoolean.cs
- AuthenticationModulesSection.cs
- safex509handles.cs
- BinaryParser.cs
- TagElement.cs
- WebServiceFault.cs
- IIS7UserPrincipal.cs
- FilteredDataSetHelper.cs
- TypeTypeConverter.cs
- Region.cs
- PriorityItem.cs
- MethodToken.cs
- InheritanceService.cs
- SymbolPair.cs
- ServiceEndpoint.cs
- TypeDelegator.cs
- HttpResponseInternalWrapper.cs
- ToolStripItemRenderEventArgs.cs
- Authorization.cs
- LineBreak.cs
- WebPartActionVerb.cs
- InProcStateClientManager.cs
- XsltLoader.cs
- GenericPrincipal.cs
- HttpServerVarsCollection.cs
- ListParagraph.cs
- InfoCardSymmetricAlgorithm.cs
- QuaternionConverter.cs
- WebService.cs
- ParamArrayAttribute.cs
- ImpersonateTokenRef.cs
- QuestionEventArgs.cs
- BStrWrapper.cs
- DashStyle.cs
- SecUtil.cs
- PropertyChangedEventArgs.cs
- RecognizerBase.cs
- TableCellCollection.cs
- ObjectSecurity.cs
- Mouse.cs
- OleDbException.cs
- XmlDataLoader.cs