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
- MappingSource.cs
- ParameterModifier.cs
- FilterQuery.cs
- BuildProvider.cs
- InsufficientMemoryException.cs
- _ListenerAsyncResult.cs
- HtmlFormWrapper.cs
- entityreference_tresulttype.cs
- CodeAttributeDeclaration.cs
- XmlElementAttribute.cs
- StrokeNodeData.cs
- AnimationStorage.cs
- ContainerUtilities.cs
- XmlDataCollection.cs
- DeviceContext.cs
- NullableConverter.cs
- ColorMap.cs
- BamlStream.cs
- GlobalProxySelection.cs
- ZoneButton.cs
- _SpnDictionary.cs
- ProgressBarAutomationPeer.cs
- LineBreak.cs
- AssemblyResourceLoader.cs
- ImageMap.cs
- RoutedPropertyChangedEventArgs.cs
- TabControlAutomationPeer.cs
- CryptoApi.cs
- cookiecontainer.cs
- dsa.cs
- Style.cs
- MeasureItemEvent.cs
- ControlAdapter.cs
- SettingsPropertyValue.cs
- DataViewManagerListItemTypeDescriptor.cs
- ContentPlaceHolder.cs
- BaseHashHelper.cs
- Pkcs7Recipient.cs
- DataServiceContext.cs
- ProviderMetadataCachedInformation.cs
- TableCell.cs
- ReadOnlyHierarchicalDataSourceView.cs
- Int64AnimationUsingKeyFrames.cs
- StorageRoot.cs
- GlobalItem.cs
- AutomationAttributeInfo.cs
- ProxySimple.cs
- IList.cs
- SamlAdvice.cs
- XmlDataProvider.cs
- UnsafeNativeMethods.cs
- XamlClipboardData.cs
- TextAutomationPeer.cs
- ConfigurationLoaderException.cs
- ScriptManager.cs
- CheckBoxAutomationPeer.cs
- EnumType.cs
- OperationCanceledException.cs
- Decorator.cs
- WeakReadOnlyCollection.cs
- AccessDataSourceView.cs
- LoginName.cs
- input.cs
- unitconverter.cs
- COAUTHIDENTITY.cs
- ICspAsymmetricAlgorithm.cs
- TriggerActionCollection.cs
- Activation.cs
- DataStorage.cs
- SafeReversePInvokeHandle.cs
- WindowsScrollBar.cs
- TempFiles.cs
- CodeObjectCreateExpression.cs
- KnownBoxes.cs
- PackageRelationship.cs
- DataFormats.cs
- GcHandle.cs
- KeyValuePair.cs
- Attributes.cs
- Font.cs
- SymbolType.cs
- XmlSchemaObjectTable.cs
- RijndaelManagedTransform.cs
- LZCodec.cs
- QueryCacheEntry.cs
- SchemaTypeEmitter.cs
- MethodSet.cs
- WebServiceHandlerFactory.cs
- QuadraticBezierSegment.cs
- WorkItem.cs
- PathHelper.cs
- OdbcDataReader.cs
- InstanceContextMode.cs
- ThemeableAttribute.cs
- ValidationPropertyAttribute.cs
- DrawingGroup.cs
- HttpCacheVaryByContentEncodings.cs
- ReliableChannelBinder.cs
- ColorConvertedBitmap.cs
- BitmapEffect.cs