Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / DynamicData / DynamicData / DynamicFilterExpression.cs / 1305376 / DynamicFilterExpression.cs
using System.Linq.Expressions; using System.Web.UI; using System.Globalization; using System.Diagnostics.CodeAnalysis; using System.Linq; #if ORYX_VNEXT using Microsoft.Web.Data.UI.WebControls.Expressions; using Microsoft.Web.Data.UI.WebControls; #else using System.Web.UI.WebControls.Expressions; using System.Web.UI.WebControls; #endif namespace System.Web.DynamicData { ////// This is a Dynamic Data-specific extension of DataSourceExpression that works by forwarding the processing of an IQueryable to /// a specialized control such as QueryableFilterRepeater or DynamicFilter. /// public class DynamicFilterExpression : DataSourceExpression { ////// References the ID of a QueryableFilterRepeater or DynamicFilter control on the page. /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "ID", Justification = "This refers to a Control ID")] public string ControlID { get; set; } private IFilterExpressionProvider FilterExpressionProvider { get; set; } public override void SetContext(Control owner, HttpContext context, IQueryableDataSource dataSource) { base.SetContext(owner, context, dataSource); FilterExpressionProvider = FindControl(Owner); FilterExpressionProvider.Initialize(dataSource); } private IFilterExpressionProvider FindControl(Control control) { var result = Misc.FindControl(control, ControlID) as IFilterExpressionProvider; if (result == null) { throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, "The control '{0}' could not be found.", ControlID)); } return result; } ////// Delegates the processing of the source queryable to the control referenced by ControlID. /// /// ///public override IQueryable GetQueryable(IQueryable source) { IQueryable result = FilterExpressionProvider.GetQueryable(source); return result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System.Linq.Expressions; using System.Web.UI; using System.Globalization; using System.Diagnostics.CodeAnalysis; using System.Linq; #if ORYX_VNEXT using Microsoft.Web.Data.UI.WebControls.Expressions; using Microsoft.Web.Data.UI.WebControls; #else using System.Web.UI.WebControls.Expressions; using System.Web.UI.WebControls; #endif namespace System.Web.DynamicData { /// /// This is a Dynamic Data-specific extension of DataSourceExpression that works by forwarding the processing of an IQueryable to /// a specialized control such as QueryableFilterRepeater or DynamicFilter. /// public class DynamicFilterExpression : DataSourceExpression { ////// References the ID of a QueryableFilterRepeater or DynamicFilter control on the page. /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "ID", Justification = "This refers to a Control ID")] public string ControlID { get; set; } private IFilterExpressionProvider FilterExpressionProvider { get; set; } public override void SetContext(Control owner, HttpContext context, IQueryableDataSource dataSource) { base.SetContext(owner, context, dataSource); FilterExpressionProvider = FindControl(Owner); FilterExpressionProvider.Initialize(dataSource); } private IFilterExpressionProvider FindControl(Control control) { var result = Misc.FindControl(control, ControlID) as IFilterExpressionProvider; if (result == null) { throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, "The control '{0}' could not be found.", ControlID)); } return result; } ////// Delegates the processing of the source queryable to the control referenced by ControlID. /// /// ///public override IQueryable GetQueryable(IQueryable source) { IQueryable result = FilterExpressionProvider.GetQueryable(source); return result; } } } // 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
- EntityTypeBase.cs
- DbConnectionHelper.cs
- SqlBinder.cs
- WindowsScrollBarBits.cs
- PointCollection.cs
- QilStrConcat.cs
- LinearGradientBrush.cs
- InkPresenter.cs
- CodeActivityContext.cs
- DesignerDeviceConfig.cs
- DragDeltaEventArgs.cs
- PropertyDescriptorCollection.cs
- AssemblyAttributes.cs
- XmlAttributeOverrides.cs
- CaseInsensitiveHashCodeProvider.cs
- LogReserveAndAppendState.cs
- TextBlockAutomationPeer.cs
- AssemblyCache.cs
- ImageDrawing.cs
- ListSourceHelper.cs
- RtfToken.cs
- ISAPIRuntime.cs
- CategoryGridEntry.cs
- ToolStripGrip.cs
- ServiceDeploymentInfo.cs
- NeutralResourcesLanguageAttribute.cs
- ServiceAuthorizationManager.cs
- SystemIPGlobalProperties.cs
- TdsValueSetter.cs
- ThumbAutomationPeer.cs
- TailCallAnalyzer.cs
- DebuggerAttributes.cs
- ServiceSecurityContext.cs
- Keyboard.cs
- BinarySerializer.cs
- DocumentViewer.cs
- RemoteWebConfigurationHostStream.cs
- ColorMatrix.cs
- ObjectNavigationPropertyMapping.cs
- xamlnodes.cs
- StorageAssociationSetMapping.cs
- IISMapPath.cs
- ConnectionManagementElementCollection.cs
- MediaTimeline.cs
- ListGeneralPage.cs
- DataMemberFieldConverter.cs
- CountdownEvent.cs
- peernodeimplementation.cs
- TextDecoration.cs
- WebPartRestoreVerb.cs
- InteropBitmapSource.cs
- SiteMapNodeItem.cs
- XmlEntityReference.cs
- CancellationToken.cs
- SecurityPermission.cs
- ThreadStateException.cs
- CompositeFontParser.cs
- MetaDataInfo.cs
- ConfigurationManagerInternal.cs
- x509store.cs
- TraceSwitch.cs
- WindowsListViewItemCheckBox.cs
- RegexCaptureCollection.cs
- MsmqIntegrationElement.cs
- BoundingRectTracker.cs
- UInt32Converter.cs
- TabItem.cs
- CategoryEditor.cs
- PasswordRecovery.cs
- ProviderMetadata.cs
- MessagePartDescription.cs
- autovalidator.cs
- CachedRequestParams.cs
- SiteMapDataSourceView.cs
- InputLangChangeEvent.cs
- ModuleElement.cs
- WorkflowServiceHostFactory.cs
- ClientRoleProvider.cs
- PartialCachingControl.cs
- XmlSchemaAll.cs
- BrowserCapabilitiesFactory35.cs
- StreamSecurityUpgradeAcceptor.cs
- CodeTypeDeclaration.cs
- ChangePassword.cs
- ProfileSettings.cs
- XsltArgumentList.cs
- _RequestLifetimeSetter.cs
- CompiledRegexRunner.cs
- OracleTimeSpan.cs
- DesignTimeXamlWriter.cs
- ArgumentValue.cs
- RtfToXamlLexer.cs
- OpenFileDialog.cs
- ConnectionPointCookie.cs
- DataGridViewImageColumn.cs
- assemblycache.cs
- AudienceUriMode.cs
- ASCIIEncoding.cs
- XmlEnumAttribute.cs
- UInt64Converter.cs