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
- GridViewRowPresenter.cs
- Accessible.cs
- UrlAuthFailedErrorFormatter.cs
- VerificationAttribute.cs
- ReadOnlyTernaryTree.cs
- BindingMemberInfo.cs
- HostUtils.cs
- WebPartDeleteVerb.cs
- ImageDrawing.cs
- SqlServices.cs
- TrimSurroundingWhitespaceAttribute.cs
- ProxyManager.cs
- NameValueCollection.cs
- DbParameterCollectionHelper.cs
- oledbconnectionstring.cs
- BaseDataList.cs
- HashStream.cs
- WindowsSlider.cs
- IItemProperties.cs
- X509CertificateTrustedIssuerElement.cs
- FormViewRow.cs
- SelectionProcessor.cs
- XmlCharCheckingReader.cs
- LinqDataSourceHelper.cs
- NonParentingControl.cs
- Timeline.cs
- Pair.cs
- BinaryConverter.cs
- MsmqBindingMonitor.cs
- TreeNodeStyleCollection.cs
- ReceiveCompletedEventArgs.cs
- PersistenceMetadataNamespace.cs
- ExclusiveHandle.cs
- DataGridViewTopLeftHeaderCell.cs
- TypeListConverter.cs
- GeometryCombineModeValidation.cs
- ChannelSinkStacks.cs
- CreateUserErrorEventArgs.cs
- TraceEventCache.cs
- MailAddressCollection.cs
- XmlSchemaInfo.cs
- QilReference.cs
- CodeTypeConstructor.cs
- PropertyGridCommands.cs
- CheckedListBox.cs
- CdpEqualityComparer.cs
- MergeEnumerator.cs
- HttpModuleActionCollection.cs
- LinkDescriptor.cs
- ThicknessAnimation.cs
- PageContent.cs
- UriTemplateClientFormatter.cs
- FragmentQueryKB.cs
- PasswordBoxAutomationPeer.cs
- ping.cs
- ToolStripDropDownItem.cs
- FormClosedEvent.cs
- AnimationClockResource.cs
- Stroke2.cs
- XamlPathDataSerializer.cs
- TogglePattern.cs
- ConsumerConnectionPoint.cs
- PageThemeCodeDomTreeGenerator.cs
- WebPartAuthorizationEventArgs.cs
- SessionEndingEventArgs.cs
- FixedSOMTable.cs
- GradientStop.cs
- ValidationSummary.cs
- SafePointer.cs
- ServiceOperationInvoker.cs
- VerificationException.cs
- WindowsListViewGroup.cs
- ForwardPositionQuery.cs
- SQLChars.cs
- LogReservationCollection.cs
- IsolatedStorageFile.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- Rotation3DAnimationBase.cs
- MatrixConverter.cs
- DependencyPropertyValueSerializer.cs
- LicenseContext.cs
- ComponentEvent.cs
- OciHandle.cs
- TargetControlTypeCache.cs
- XPathSelfQuery.cs
- ChannelBinding.cs
- QueryAccessibilityHelpEvent.cs
- Calendar.cs
- DataServiceHostFactory.cs
- PackagePartCollection.cs
- DelegatingConfigHost.cs
- NumberSubstitution.cs
- EventLogEntry.cs
- ArgumentException.cs
- TextDecoration.cs
- WmlPanelAdapter.cs
- EventMap.cs
- FontCacheUtil.cs
- EventManager.cs
- Clipboard.cs