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
- AggregateNode.cs
- FocusWithinProperty.cs
- PropertyTabAttribute.cs
- OdbcCommand.cs
- ClipboardData.cs
- EditBehavior.cs
- WebServiceTypeData.cs
- rsa.cs
- PasswordDeriveBytes.cs
- _IPv6Address.cs
- QueryMatcher.cs
- CodeMemberField.cs
- InstanceContextMode.cs
- DbConnectionPoolCounters.cs
- relpropertyhelper.cs
- Imaging.cs
- CodeSnippetStatement.cs
- OleDbPropertySetGuid.cs
- JsonObjectDataContract.cs
- WsdlImporterElementCollection.cs
- MethodAccessException.cs
- TimeIntervalCollection.cs
- GridViewRowEventArgs.cs
- DBCommand.cs
- XamlUtilities.cs
- ListControlConvertEventArgs.cs
- CommonDialog.cs
- XmlDataCollection.cs
- FigureParaClient.cs
- PersonalizationStateInfo.cs
- NegotiateStream.cs
- StructuredTypeInfo.cs
- DynamicMethod.cs
- ReleaseInstanceMode.cs
- SchemaTypeEmitter.cs
- BuildProvidersCompiler.cs
- SizeAnimationUsingKeyFrames.cs
- LinkedResource.cs
- XmlTypeAttribute.cs
- DebugView.cs
- EnvironmentPermission.cs
- CrossAppDomainChannel.cs
- CodeIdentifier.cs
- IsolatedStoragePermission.cs
- FreeFormPanel.cs
- WebResourceAttribute.cs
- LinkButton.cs
- PublishLicense.cs
- PassportAuthentication.cs
- ActivityDesignerLayoutSerializers.cs
- Duration.cs
- XmlAttributes.cs
- _NTAuthentication.cs
- Viewport3DVisual.cs
- NavigateEvent.cs
- SiteMapHierarchicalDataSourceView.cs
- PropertyConverter.cs
- GregorianCalendarHelper.cs
- CompositeDesignerAccessibleObject.cs
- SimpleWebHandlerParser.cs
- ScriptHandlerFactory.cs
- FileChangeNotifier.cs
- WindowsListViewItem.cs
- SqlNotificationRequest.cs
- ExternalFile.cs
- WCFModelStrings.Designer.cs
- XPathNodeInfoAtom.cs
- WebPartEditorApplyVerb.cs
- SettingsPropertyCollection.cs
- ErrorStyle.cs
- HitTestWithPointDrawingContextWalker.cs
- ScriptIgnoreAttribute.cs
- SQLInt32.cs
- StateItem.cs
- DetailsViewPageEventArgs.cs
- ValidationSummary.cs
- GridItemProviderWrapper.cs
- AppDomainUnloadedException.cs
- DataControlButton.cs
- CurrentChangedEventManager.cs
- DispatcherSynchronizationContext.cs
- HttpResponseWrapper.cs
- ToolboxItemImageConverter.cs
- MetadataUtilsSmi.cs
- TargetException.cs
- Nullable.cs
- DefaultProxySection.cs
- initElementDictionary.cs
- BadImageFormatException.cs
- ColorEditor.cs
- ValidationError.cs
- DynamicPropertyReader.cs
- RandomNumberGenerator.cs
- SessionStateItemCollection.cs
- ResumeStoryboard.cs
- SerialErrors.cs
- TextPointerBase.cs
- WSMessageEncoding.cs
- CollectionViewSource.cs
- ToolboxItemFilterAttribute.cs