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
- FontDialog.cs
- UnsafeNativeMethods.cs
- SizeConverter.cs
- SessionIDManager.cs
- XmlAtomicValue.cs
- ImpersonateTokenRef.cs
- NavigationWindowAutomationPeer.cs
- InputLangChangeEvent.cs
- WindowsStatusBar.cs
- ProjectedSlot.cs
- Attributes.cs
- DataTemplate.cs
- ObjRef.cs
- FontStyleConverter.cs
- XPathItem.cs
- Main.cs
- PropertyGridDesigner.cs
- DbFunctionCommandTree.cs
- DockProviderWrapper.cs
- BitmapEffectDrawingContextState.cs
- HebrewCalendar.cs
- SmiMetaData.cs
- AsmxEndpointPickerExtension.cs
- MetafileHeader.cs
- UntypedNullExpression.cs
- Mouse.cs
- PopOutPanel.cs
- EnumDataContract.cs
- RootProfilePropertySettingsCollection.cs
- SqlDataSourceEnumerator.cs
- Operator.cs
- TypeSource.cs
- CallbackCorrelationInitializer.cs
- IPEndPointCollection.cs
- EnumValAlphaComparer.cs
- XmlSchemaChoice.cs
- AsyncPostBackErrorEventArgs.cs
- updateconfighost.cs
- DataViewListener.cs
- SupportingTokenSecurityTokenResolver.cs
- EntityStoreSchemaGenerator.cs
- TypeSchema.cs
- Behavior.cs
- CapabilitiesState.cs
- QueryCacheEntry.cs
- MessageQueuePermissionEntry.cs
- ClientSponsor.cs
- OleDbError.cs
- Literal.cs
- SystemWebCachingSectionGroup.cs
- LineSegment.cs
- Line.cs
- XmlLoader.cs
- CheckedPointers.cs
- DockProviderWrapper.cs
- MessagePartSpecification.cs
- NonSerializedAttribute.cs
- SubMenuStyleCollection.cs
- ListBoxAutomationPeer.cs
- TypeConvertions.cs
- NativeMethods.cs
- MediaPlayerState.cs
- WebPartConnection.cs
- SafeNativeMethods.cs
- BasicExpandProvider.cs
- WebServiceClientProxyGenerator.cs
- PlatformCulture.cs
- CryptoConfig.cs
- ScrollChrome.cs
- PrintController.cs
- X509IssuerSerialKeyIdentifierClause.cs
- KnownBoxes.cs
- FormatException.cs
- StaticFileHandler.cs
- SqlUserDefinedAggregateAttribute.cs
- HtmlButton.cs
- TemplateControlParser.cs
- OperatingSystem.cs
- XmlRootAttribute.cs
- TextBoxAutoCompleteSourceConverter.cs
- ProcessThreadDesigner.cs
- CodeBlockBuilder.cs
- TreeChangeInfo.cs
- Component.cs
- Table.cs
- DataGridViewSelectedCellCollection.cs
- UrlMapping.cs
- XmlSchemaAny.cs
- StylusDevice.cs
- X509UI.cs
- DynamicDocumentPaginator.cs
- ToolStripSystemRenderer.cs
- TimelineGroup.cs
- PtsPage.cs
- PeerCredential.cs
- Msec.cs
- SqlDataReaderSmi.cs
- VarRefManager.cs
- JsonWriterDelegator.cs
- CompilerCollection.cs