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
- EmptyEnumerable.cs
- GifBitmapEncoder.cs
- UserControlBuildProvider.cs
- CodeNamespaceImport.cs
- PartitionedDataSource.cs
- SqlBinder.cs
- ExtenderProvidedPropertyAttribute.cs
- OneOfConst.cs
- SystemWebCachingSectionGroup.cs
- DesignerTransaction.cs
- UnhandledExceptionEventArgs.cs
- HttpRequest.cs
- Duration.cs
- XpsImageSerializationService.cs
- SharedMemory.cs
- DataGridViewCellStyle.cs
- LineSegment.cs
- RemotingService.cs
- GACIdentityPermission.cs
- ScrollChrome.cs
- WmlControlAdapter.cs
- CachedFontFamily.cs
- FilteredAttributeCollection.cs
- AsyncStreamReader.cs
- PropertyIDSet.cs
- GeometryDrawing.cs
- RegistrationServices.cs
- infer.cs
- _NegoStream.cs
- ObjectReaderCompiler.cs
- NameTable.cs
- UnsafeNativeMethodsPenimc.cs
- SingletonInstanceContextProvider.cs
- SymmetricKeyWrap.cs
- AuthenticationException.cs
- WebPartVerb.cs
- DataRelation.cs
- GiveFeedbackEvent.cs
- ToolBarOverflowPanel.cs
- XamlClipboardData.cs
- AppearanceEditorPart.cs
- RoutingService.cs
- HashHelper.cs
- SharedDp.cs
- PixelShader.cs
- MetadataItem.cs
- WebUtil.cs
- UidPropertyAttribute.cs
- CurrentTimeZone.cs
- PresentationAppDomainManager.cs
- PageClientProxyGenerator.cs
- AsymmetricSignatureFormatter.cs
- ValidatorUtils.cs
- RightsManagementPermission.cs
- SplineKeyFrames.cs
- OleDbFactory.cs
- AuthenticationModuleElementCollection.cs
- GridViewUpdateEventArgs.cs
- HwndMouseInputProvider.cs
- HtmlToClrEventProxy.cs
- VSDExceptions.cs
- DataGridViewUtilities.cs
- EmptyWorkItem.cs
- CodeExporter.cs
- StringUtil.cs
- PartialArray.cs
- infer.cs
- UpdateManifestForBrowserApplication.cs
- ScriptReferenceEventArgs.cs
- AnnotationHelper.cs
- MsmqDecodeHelper.cs
- Scheduler.cs
- LinqDataSourceHelper.cs
- GPRECT.cs
- Socket.cs
- NotifyParentPropertyAttribute.cs
- LabelAutomationPeer.cs
- FolderBrowserDialogDesigner.cs
- DataRelation.cs
- WeakReferenceList.cs
- RegexCharClass.cs
- LogWriteRestartAreaAsyncResult.cs
- TypographyProperties.cs
- CodeAccessPermission.cs
- CaseKeyBox.ViewModel.cs
- ColumnMapCopier.cs
- ToolboxItemCollection.cs
- DbModificationClause.cs
- MobileErrorInfo.cs
- ImageMapEventArgs.cs
- XomlCompilerParameters.cs
- OracleNumber.cs
- DataStorage.cs
- CatalogPartCollection.cs
- CallbackValidator.cs
- PointLightBase.cs
- Recipient.cs
- RoleGroup.cs
- XsdDateTime.cs
- MonitorWrapper.cs