Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / UI / WebControls / Expressions / DataSourceExpression.cs / 1305376 / DataSourceExpression.cs
#if ORYX_VNEXT namespace Microsoft.Web.Data.UI.WebControls.Expressions { #else namespace System.Web.UI.WebControls.Expressions { #endif using System; using System.ComponentModel; using System.Linq; using System.Linq.Expressions; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public abstract class DataSourceExpression : IStateManager { private bool _tracking; private StateBag _viewState; protected HttpContext Context { get; private set; } protected Control Owner { get; private set; } public IQueryableDataSource DataSource { get; // Internal set for unit testing internal set; } protected bool IsTrackingViewState { get { return _tracking; } } [ Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), ] protected StateBag ViewState { get { if (_viewState == null) { _viewState = new StateBag(); if (_tracking) ((IStateManager)_viewState).TrackViewState(); } return _viewState; } } protected DataSourceExpression() { } // internal for unit testing internal DataSourceExpression(Control owner) { Owner = owner; } public void SetDirty() { ViewState.SetDirty(true); } protected virtual void LoadViewState(object savedState) { if (savedState != null) { ((IStateManager)ViewState).LoadViewState(savedState); } } protected virtual object SaveViewState() { return (_viewState != null) ? ((IStateManager)_viewState).SaveViewState() : null; } protected virtual void TrackViewState() { _tracking = true; if (_viewState != null) { ((IStateManager)_viewState).TrackViewState(); } } public abstract IQueryable GetQueryable(IQueryable source); public virtual void SetContext(Control owner, HttpContext context, IQueryableDataSource dataSource) { if (owner == null) { throw new ArgumentNullException("owner"); } if (context == null) { throw new ArgumentNullException("context"); } if (dataSource == null) { throw new ArgumentNullException("dataSource"); } Owner = owner; Context = context; DataSource = dataSource; } #region IStateManager Members bool IStateManager.IsTrackingViewState { get { return IsTrackingViewState; } } void IStateManager.LoadViewState(object state) { LoadViewState(state); } object IStateManager.SaveViewState() { return SaveViewState(); } void IStateManager.TrackViewState() { TrackViewState(); } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MobileCapabilities.cs
- ExpressionTextBoxAutomationPeer.cs
- ValueSerializer.cs
- ReadWriteObjectLock.cs
- PresentationUIStyleResources.cs
- MimeTypePropertyAttribute.cs
- DecimalAnimation.cs
- DesignerImageAdapter.cs
- ConstraintConverter.cs
- ToolBarButton.cs
- BitmapSource.cs
- UTF8Encoding.cs
- Point3DAnimation.cs
- ContextMenu.cs
- DataControlFieldHeaderCell.cs
- Context.cs
- GroupDescription.cs
- TextTabProperties.cs
- WindowsStatusBar.cs
- XamlStream.cs
- SHA256Managed.cs
- mactripleDES.cs
- LoginCancelEventArgs.cs
- RoutedEventConverter.cs
- DataExchangeServiceBinder.cs
- UdpMessageProperty.cs
- RegionInfo.cs
- PeerResolverElement.cs
- MatrixAnimationBase.cs
- PostBackOptions.cs
- TrackBar.cs
- SerializationBinder.cs
- NavigationProperty.cs
- DiscoveryExceptionDictionary.cs
- IntSecurity.cs
- InstanceKeyView.cs
- HtmlToClrEventProxy.cs
- XmlSchemaSimpleType.cs
- ToolStripHighContrastRenderer.cs
- SqlMethodAttribute.cs
- MenuItem.cs
- LingerOption.cs
- StyleHelper.cs
- IndentedWriter.cs
- PipelineDeploymentState.cs
- GlyphShapingProperties.cs
- ControlCachePolicy.cs
- TraceListener.cs
- GridViewRow.cs
- ListViewSelectEventArgs.cs
- ScrollItemProviderWrapper.cs
- SQLInt64.cs
- TypeContext.cs
- CultureInfoConverter.cs
- FixedSOMFixedBlock.cs
- AppDomainFactory.cs
- ShaperBuffers.cs
- CodeArrayCreateExpression.cs
- ProtocolsConfigurationEntry.cs
- LiteralTextParser.cs
- XmlComment.cs
- PageThemeParser.cs
- TemplateControlParser.cs
- _AutoWebProxyScriptHelper.cs
- ThemeableAttribute.cs
- GeneralTransformCollection.cs
- CounterCreationDataCollection.cs
- Queue.cs
- SelectionEditor.cs
- CodeBinaryOperatorExpression.cs
- DateTimeFormatInfoScanner.cs
- StrokeCollectionDefaultValueFactory.cs
- InputBinding.cs
- _CookieModule.cs
- SatelliteContractVersionAttribute.cs
- TextServicesLoader.cs
- __ConsoleStream.cs
- KeyedHashAlgorithm.cs
- CodeExpressionCollection.cs
- DesignerVerbCollection.cs
- SamlAuthenticationClaimResource.cs
- RequestCacheValidator.cs
- BinaryObjectWriter.cs
- BinaryMessageEncodingBindingElement.cs
- control.ime.cs
- TransportChannelListener.cs
- AndCondition.cs
- LinqDataSource.cs
- PersonalizationDictionary.cs
- AssertFilter.cs
- WorkflowQueuingService.cs
- XPathDescendantIterator.cs
- KnownBoxes.cs
- ServiceModelEnumValidator.cs
- VersionedStream.cs
- Graphics.cs
- Environment.cs
- IPPacketInformation.cs
- RawStylusSystemGestureInputReport.cs
- DbParameterCollection.cs