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
- TransformPattern.cs
- DataBindingHandlerAttribute.cs
- SchemaImporterExtensionElementCollection.cs
- ExceptionHandler.cs
- DragEventArgs.cs
- RtType.cs
- SiteMapSection.cs
- ReferenceEqualityComparer.cs
- ContextMenuAutomationPeer.cs
- FloaterParaClient.cs
- UniformGrid.cs
- SystemParameters.cs
- Triplet.cs
- StorageBasedPackageProperties.cs
- SiteMapNodeCollection.cs
- PeerNeighborManager.cs
- BaseTemplateBuildProvider.cs
- TileBrush.cs
- AutomationElementCollection.cs
- StringWriter.cs
- ContainerParagraph.cs
- CustomTrackingRecord.cs
- LinearKeyFrames.cs
- LayoutSettings.cs
- XamlInt32CollectionSerializer.cs
- HandleCollector.cs
- HttpResponseHeader.cs
- DetailsViewRow.cs
- SeekStoryboard.cs
- DataTable.cs
- ClientApiGenerator.cs
- PrinterResolution.cs
- Scanner.cs
- LinqMaximalSubtreeNominator.cs
- ByteStorage.cs
- ProxyGenerator.cs
- BitSet.cs
- StringHandle.cs
- DocumentViewerBaseAutomationPeer.cs
- DataQuery.cs
- DataGridViewAdvancedBorderStyle.cs
- ClientSettingsSection.cs
- DataSpaceManager.cs
- UIAgentInitializationException.cs
- TemplatePagerField.cs
- MsmqIntegrationSecurityMode.cs
- Inflater.cs
- LayoutUtils.cs
- ToolStripSplitButton.cs
- WaitingCursor.cs
- RegexGroupCollection.cs
- PropertyInfoSet.cs
- TimeSpanValidator.cs
- SqlReferenceCollection.cs
- ContentPropertyAttribute.cs
- TextMarkerSource.cs
- StoreContentChangedEventArgs.cs
- TransformBlockRequest.cs
- InputReport.cs
- Popup.cs
- ContractSearchPattern.cs
- ParserHooks.cs
- RulePatternOps.cs
- InstanceHandleReference.cs
- Help.cs
- RtfToXamlLexer.cs
- AuthStoreRoleProvider.cs
- ActivityCodeDomReferenceService.cs
- Win32.cs
- UIElementCollection.cs
- DateTimeOffsetConverter.cs
- SizeFConverter.cs
- TemplateParser.cs
- EntityWrapper.cs
- RightNameExpirationInfoPair.cs
- SerialReceived.cs
- DataSourceCacheDurationConverter.cs
- AlternationConverter.cs
- DateTimeValueSerializerContext.cs
- ApplicationCommands.cs
- ThumbAutomationPeer.cs
- ObjectCloneHelper.cs
- Publisher.cs
- FastPropertyAccessor.cs
- validation.cs
- SafeNativeMethods.cs
- XmlIgnoreAttribute.cs
- ReflectionUtil.cs
- HttpModuleAction.cs
- _LazyAsyncResult.cs
- SQLCharsStorage.cs
- DataGridViewComboBoxCell.cs
- Attributes.cs
- VectorCollectionValueSerializer.cs
- DocumentPaginator.cs
- DesignTimeXamlWriter.cs
- KoreanLunisolarCalendar.cs
- DataGridViewTopLeftHeaderCell.cs
- DesignerView.Commands.cs
- Substitution.cs