Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeTypeMemberCollection.cs
- _UriSyntax.cs
- ComboBoxRenderer.cs
- ButtonBaseAutomationPeer.cs
- TransactionInterop.cs
- SendingRequestEventArgs.cs
- Vector3D.cs
- DeviceFiltersSection.cs
- TextSelectionHelper.cs
- Quad.cs
- ViewStateModeByIdAttribute.cs
- SerializationInfo.cs
- PieceNameHelper.cs
- MetadataPropertyCollection.cs
- InputLanguageSource.cs
- CacheSection.cs
- sitestring.cs
- SoapFaultCodes.cs
- JapaneseLunisolarCalendar.cs
- XPathSingletonIterator.cs
- DocumentApplicationJournalEntry.cs
- PopupRootAutomationPeer.cs
- DataContract.cs
- CodeTypeParameter.cs
- DrawingAttributeSerializer.cs
- WeakReferenceList.cs
- ForeignKeyConstraint.cs
- IISMapPath.cs
- ListViewTableCell.cs
- PropertyGridEditorPart.cs
- JsonWriterDelegator.cs
- DataGridViewRowPostPaintEventArgs.cs
- XsdCachingReader.cs
- DisplayNameAttribute.cs
- TextViewBase.cs
- DisplayMemberTemplateSelector.cs
- MobileTextWriter.cs
- UITypeEditor.cs
- BStrWrapper.cs
- activationcontext.cs
- SqlRowUpdatedEvent.cs
- ExpressionBuilderContext.cs
- DeferredElementTreeState.cs
- MethodBody.cs
- XmlTextWriter.cs
- DeclaredTypeValidatorAttribute.cs
- TrackingCondition.cs
- PropertyDescriptorGridEntry.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- ConfigurationManagerHelperFactory.cs
- HttpRawResponse.cs
- EasingKeyFrames.cs
- WebServiceErrorEvent.cs
- BufferedStream.cs
- SqlDataSourceQueryEditorForm.cs
- OptionalColumn.cs
- NamedElement.cs
- Invariant.cs
- StringOutput.cs
- FixedSOMPageConstructor.cs
- PrinterResolution.cs
- ButtonField.cs
- exports.cs
- HttpConfigurationContext.cs
- ExtendedProperty.cs
- ColumnResult.cs
- DivideByZeroException.cs
- GeometryCollection.cs
- MsmqIntegrationSecurityMode.cs
- HealthMonitoringSection.cs
- StorageMappingFragment.cs
- XslAst.cs
- SafeArrayRankMismatchException.cs
- CodeGeneratorOptions.cs
- Rule.cs
- BoundingRectTracker.cs
- ConfigWriter.cs
- CharacterShapingProperties.cs
- CodePageUtils.cs
- WindowsIdentity.cs
- EntityConnectionStringBuilder.cs
- CodeMethodReturnStatement.cs
- FamilyTypefaceCollection.cs
- DecoderNLS.cs
- SystemIPInterfaceProperties.cs
- ToolStripGripRenderEventArgs.cs
- SystemWebCachingSectionGroup.cs
- ComboBox.cs
- PagedDataSource.cs
- AuthenticationServiceManager.cs
- HttpApplication.cs
- TransformCollection.cs
- AutomationEvent.cs
- PropertyMapper.cs
- UnsafeNetInfoNativeMethods.cs
- ReadOnlyDictionary.cs
- RangeValueProviderWrapper.cs
- SpecularMaterial.cs
- BamlLocalizer.cs
- Executor.cs