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
- X509SubjectKeyIdentifierClause.cs
- SiblingIterators.cs
- ProviderSettings.cs
- BaseComponentEditor.cs
- AnnotationHighlightLayer.cs
- EventMap.cs
- ControlBuilderAttribute.cs
- Int32CollectionValueSerializer.cs
- CompilerCollection.cs
- XmlEntityReference.cs
- ToolBarPanel.cs
- NoneExcludedImageIndexConverter.cs
- FastEncoderWindow.cs
- __TransparentProxy.cs
- ClientConfigurationSystem.cs
- AllMembershipCondition.cs
- SafeFileMappingHandle.cs
- SimpleHandlerBuildProvider.cs
- XhtmlBasicPhoneCallAdapter.cs
- UnsafePeerToPeerMethods.cs
- ReverseInheritProperty.cs
- BrowsableAttribute.cs
- GuidTagList.cs
- SharedConnectionWorkflowTransactionService.cs
- Expression.DebuggerProxy.cs
- _SpnDictionary.cs
- DesignerForm.cs
- DataSourceControlBuilder.cs
- LicenseContext.cs
- NativeActivityAbortContext.cs
- TypeElement.cs
- EntityTransaction.cs
- UnrecognizedAssertionsBindingElement.cs
- SqlTopReducer.cs
- RedirectionProxy.cs
- ActivitySurrogate.cs
- ButtonAutomationPeer.cs
- SizeFConverter.cs
- DiagnosticTrace.cs
- RemotingConfiguration.cs
- AspCompat.cs
- Comparer.cs
- CharacterMetrics.cs
- XmlIlTypeHelper.cs
- SqlRowUpdatingEvent.cs
- LocalizableAttribute.cs
- DesigntimeLicenseContext.cs
- CollectionViewGroupRoot.cs
- FileSecurity.cs
- SectionXmlInfo.cs
- Int16Converter.cs
- FixedPageProcessor.cs
- CheckedPointers.cs
- _ProxyChain.cs
- WindowsListViewSubItem.cs
- ErrorWebPart.cs
- HyperLinkStyle.cs
- DllNotFoundException.cs
- Part.cs
- ConfigXmlDocument.cs
- TextViewBase.cs
- SystemInfo.cs
- SafeEventHandle.cs
- DiagnosticsConfiguration.cs
- DataControlExtensions.cs
- ParentQuery.cs
- XmlDesignerDataSourceView.cs
- StyleModeStack.cs
- JsonObjectDataContract.cs
- InputDevice.cs
- SupportingTokenAuthenticatorSpecification.cs
- RouteCollection.cs
- XhtmlBasicSelectionListAdapter.cs
- SoapAttributeOverrides.cs
- SecurityUtils.cs
- FormViewDesigner.cs
- CommandBinding.cs
- FigureParagraph.cs
- CheckPair.cs
- FileDialogCustomPlace.cs
- __FastResourceComparer.cs
- BamlRecordWriter.cs
- WindowsGraphicsWrapper.cs
- DataGridRowHeaderAutomationPeer.cs
- FactoryId.cs
- ServiceDurableInstanceContextProvider.cs
- XmlNamespaceManager.cs
- SoapExtensionImporter.cs
- DeferredSelectedIndexReference.cs
- SafeNativeMethods.cs
- UdpTransportSettings.cs
- PriorityRange.cs
- RemoteWebConfigurationHostStream.cs
- ChangesetResponse.cs
- DropTarget.cs
- SetIterators.cs
- FamilyMap.cs
- CodeRegionDirective.cs
- TextEffectCollection.cs
- CancellationHandler.cs