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
- CorrelationTokenTypeConvertor.cs
- WmlCalendarAdapter.cs
- AnnotationAuthorChangedEventArgs.cs
- PlatformNotSupportedException.cs
- HttpResponse.cs
- AspNetCompatibilityRequirementsAttribute.cs
- SqlDataRecord.cs
- TypedTableBase.cs
- WindowVisualStateTracker.cs
- KeyTimeConverter.cs
- Expression.DebuggerProxy.cs
- ShapeTypeface.cs
- EntitySqlQueryCacheEntry.cs
- cookiecontainer.cs
- GradientStop.cs
- XmlMembersMapping.cs
- ReadWriteSpinLock.cs
- PriorityItem.cs
- _ListenerAsyncResult.cs
- FileInfo.cs
- EnumerableRowCollection.cs
- HwndHost.cs
- MouseWheelEventArgs.cs
- CompressionTransform.cs
- LoginView.cs
- XmlSchemaSimpleContent.cs
- ApplicationDirectory.cs
- UriTemplateCompoundPathSegment.cs
- HtmlAnchor.cs
- DataQuery.cs
- DropShadowBitmapEffect.cs
- TemplatingOptionsDialog.cs
- Encoder.cs
- HuffCodec.cs
- RenderDataDrawingContext.cs
- MouseGestureValueSerializer.cs
- UInt64Converter.cs
- PropertyDescriptorGridEntry.cs
- PageRanges.cs
- DictionaryBase.cs
- BuildProvider.cs
- DataGridViewLinkColumn.cs
- SessionIDManager.cs
- CaseStatement.cs
- TrustSection.cs
- TypeDescriptionProviderAttribute.cs
- PointAnimationBase.cs
- Point4DValueSerializer.cs
- DefaultEventAttribute.cs
- MouseDevice.cs
- TreeNodeCollectionEditor.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- controlskin.cs
- Errors.cs
- SqlCaseSimplifier.cs
- ColumnHeader.cs
- SymbolMethod.cs
- State.cs
- RSAPKCS1SignatureDeformatter.cs
- ObjectConverter.cs
- XPathChildIterator.cs
- ListQueryResults.cs
- DataGridTemplateColumn.cs
- ThicknessAnimationBase.cs
- LocalizationComments.cs
- DataGridViewCellStyleConverter.cs
- ErrorRuntimeConfig.cs
- WinEventHandler.cs
- CodeMemberProperty.cs
- LinkConverter.cs
- TypeLibConverter.cs
- CellCreator.cs
- SessionStateModule.cs
- ListSortDescriptionCollection.cs
- SiteIdentityPermission.cs
- RC2CryptoServiceProvider.cs
- IdnMapping.cs
- ConstructorArgumentAttribute.cs
- SessionIDManager.cs
- SecurityPolicySection.cs
- CodeGenerator.cs
- IsolatedStorage.cs
- DragSelectionMessageFilter.cs
- XmlChoiceIdentifierAttribute.cs
- PenContext.cs
- CommonDialog.cs
- GridViewColumn.cs
- TemplateContainer.cs
- FunctionParameter.cs
- PointAnimationClockResource.cs
- PropertyMetadata.cs
- DataList.cs
- IIS7ConfigurationLoader.cs
- WebBrowserUriTypeConverter.cs
- ColorConverter.cs
- CodePageEncoding.cs
- ObjectSecurity.cs
- TreeChangeInfo.cs
- DNS.cs
- RotateTransform.cs