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
- XslException.cs
- WindowsTab.cs
- ConfigurationValidatorAttribute.cs
- BaseCodeDomTreeGenerator.cs
- CorrelationService.cs
- ItemDragEvent.cs
- XmlAttributeProperties.cs
- UnmanagedMemoryStream.cs
- RightsManagementInformation.cs
- BasicBrowserDialog.designer.cs
- UnsafeNativeMethods.cs
- NamespaceMapping.cs
- ComEventsInfo.cs
- DataColumnMapping.cs
- ISessionStateStore.cs
- Operator.cs
- DataSourceXmlTextReader.cs
- PagesChangedEventArgs.cs
- GridViewSortEventArgs.cs
- DataGridColumn.cs
- SchemaCollectionCompiler.cs
- EntityContainerEmitter.cs
- DbFunctionCommandTree.cs
- NamespaceList.cs
- SoapFaultCodes.cs
- MainMenu.cs
- PolyBezierSegmentFigureLogic.cs
- MultiBindingExpression.cs
- ActivationServices.cs
- GlyphRun.cs
- DataBindingCollection.cs
- ISAPIRuntime.cs
- EnvelopedSignatureTransform.cs
- ShellProvider.cs
- DemultiplexingClientMessageFormatter.cs
- ApplicationSecurityInfo.cs
- JulianCalendar.cs
- ProxyGenerationError.cs
- FormsAuthenticationConfiguration.cs
- HostedNamedPipeTransportManager.cs
- Context.cs
- Image.cs
- CacheHelper.cs
- ColumnMapCopier.cs
- SerializerDescriptor.cs
- Vector3DValueSerializer.cs
- DateTimeSerializationSection.cs
- CompressEmulationStream.cs
- Util.cs
- VisualStateManager.cs
- InvariantComparer.cs
- WindowsGraphics.cs
- ApplicationServiceManager.cs
- ViewLoader.cs
- FullTrustAssemblyCollection.cs
- Preprocessor.cs
- RelationshipSet.cs
- DefaultPrintController.cs
- SearchExpression.cs
- VirtualDirectoryMappingCollection.cs
- ActivationServices.cs
- ClientRequest.cs
- Unit.cs
- PreviewKeyDownEventArgs.cs
- DataGridCell.cs
- OdbcConnectionString.cs
- WizardForm.cs
- SchemaLookupTable.cs
- DataProtection.cs
- ArgumentException.cs
- IODescriptionAttribute.cs
- CompiledQuery.cs
- securitymgrsite.cs
- AppSettingsExpressionBuilder.cs
- ApplicationTrust.cs
- NavigatingCancelEventArgs.cs
- WebPartAuthorizationEventArgs.cs
- HybridObjectCache.cs
- Expressions.cs
- CodeGen.cs
- ExceptionUtil.cs
- XmlLangPropertyAttribute.cs
- DataGridViewTopRowAccessibleObject.cs
- lengthconverter.cs
- FloatUtil.cs
- DesignTimeDataBinding.cs
- ArraySegment.cs
- SecureStringHasher.cs
- Ref.cs
- ContentFileHelper.cs
- EntityStoreSchemaGenerator.cs
- FieldMetadata.cs
- PersonalizationStateQuery.cs
- MultiBindingExpression.cs
- CodeVariableReferenceExpression.cs
- EventProvider.cs
- InvalidTimeZoneException.cs
- AnimationClockResource.cs
- ToolStripDropDownButton.cs
- SmtpClient.cs