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
- InkCanvasFeedbackAdorner.cs
- Set.cs
- GlyphingCache.cs
- RectangleGeometry.cs
- TextRangeProviderWrapper.cs
- HeaderCollection.cs
- TableStyle.cs
- PrefixHandle.cs
- IList.cs
- ActiveXHelper.cs
- Thread.cs
- DataColumnPropertyDescriptor.cs
- _NegotiateClient.cs
- CodeBlockBuilder.cs
- XmlEnumAttribute.cs
- TemplateBindingExtensionConverter.cs
- SecurityUtils.cs
- HwndAppCommandInputProvider.cs
- LocalizabilityAttribute.cs
- StorageMappingFragment.cs
- TypeToken.cs
- OutgoingWebResponseContext.cs
- loginstatus.cs
- ListBox.cs
- ControlBuilder.cs
- TypeGeneratedEventArgs.cs
- FileRegion.cs
- DBConcurrencyException.cs
- EpmAttributeNameBuilder.cs
- CachedPathData.cs
- CompilerInfo.cs
- FeatureSupport.cs
- IndexedString.cs
- IntermediatePolicyValidator.cs
- HttpPostedFile.cs
- FontStyle.cs
- KoreanCalendar.cs
- DebugView.cs
- SelectionGlyph.cs
- KeyboardEventArgs.cs
- ReadWriteObjectLock.cs
- ContainerControl.cs
- UserControlParser.cs
- PersistChildrenAttribute.cs
- regiisutil.cs
- Roles.cs
- SrgsOneOf.cs
- Accessible.cs
- TransformerConfigurationWizardBase.cs
- ToolStripRenderer.cs
- KoreanCalendar.cs
- EncodingTable.cs
- Stack.cs
- AspCompat.cs
- DropSource.cs
- Quaternion.cs
- FtpWebResponse.cs
- LoginCancelEventArgs.cs
- MultipleViewProviderWrapper.cs
- Hex.cs
- ApplicationTrust.cs
- StylusShape.cs
- URLString.cs
- SystemPens.cs
- DataAccessor.cs
- FatalException.cs
- EntryIndex.cs
- CalendarDesigner.cs
- RecognizedWordUnit.cs
- ConstantExpression.cs
- DataList.cs
- ConsumerConnectionPoint.cs
- WebReferenceOptions.cs
- TableCellAutomationPeer.cs
- GridErrorDlg.cs
- basemetadatamappingvisitor.cs
- TextMarkerSource.cs
- DataTable.cs
- CfgParser.cs
- RecognizerStateChangedEventArgs.cs
- GorillaCodec.cs
- OAVariantLib.cs
- DynamicILGenerator.cs
- UIElement3D.cs
- DataGridTextBox.cs
- TargetControlTypeCache.cs
- PerformanceCountersBase.cs
- PropertyDescriptorComparer.cs
- FeatureAttribute.cs
- BooleanToVisibilityConverter.cs
- SqlMethodTransformer.cs
- BinaryEditor.cs
- IncrementalReadDecoders.cs
- DeploymentSection.cs
- ToolStripItemRenderEventArgs.cs
- FixedHighlight.cs
- FlowDocumentReader.cs
- DecoderReplacementFallback.cs
- WebException.cs
- ReflectionPermission.cs