Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / DynamicData / DynamicData / DynamicRouteExpression.cs / 1305376 / DynamicRouteExpression.cs
using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Web.DynamicData.Util; using System.Web.UI; using System.Web.UI.WebControls; using System.Diagnostics; #if ORYX_VNEXT using Microsoft.Web.Data.UI.WebControls.Expressions; using Microsoft.Web.Data.UI.WebControls; #else using System.Web.UI.WebControls.Expressions; #endif namespace System.Web.DynamicData { ////// This class is an QueryExtender-based equivalent of DynamicQueryStringParameters. /// When applied to a data source it will filter the data by the value of a primary key encoded /// in the requests query string (or potentially routing if complex routes are used). If ColumnName /// is specified it will retrieve the values /// public class DynamicRouteExpression : DataSourceExpression { private PropertyExpression _expression = new PropertyExpression(); ////// An optional column name that can be used to change the filtering mode (i.e. filter by foreign key instead /// of primary key). /// [DefaultValue("")] public string ColumnName { get; set; } ////// See base class. /// public override void SetContext(Control owner, HttpContext context, IQueryableDataSource dataSource) { base.SetContext(owner, context, dataSource); owner.Page.InitComplete += new EventHandler(Page_InitComplete); } void Page_InitComplete(object sender, EventArgs e) { Debug.Assert(DataSource != null); var table = DataSource.GetMetaTable(); IEnumerableparameters = RouteParametersHelper.GetColumnParameters(table, ColumnName); parameters.ToList().ForEach(p => _expression.Parameters.Add(p)); } /// /// See base class. /// public override IQueryable GetQueryable(IQueryable source) { return _expression.GetQueryable(source); } } } // 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
- CharKeyFrameCollection.cs
- HtmlControl.cs
- WindowsSecurityToken.cs
- ScaleTransform3D.cs
- BookmarkInfo.cs
- DocumentXmlWriter.cs
- ISO2022Encoding.cs
- CompiledRegexRunner.cs
- VectorConverter.cs
- Maps.cs
- PageAsyncTaskManager.cs
- ListViewUpdateEventArgs.cs
- XmlUtilWriter.cs
- StylusCollection.cs
- CaseExpr.cs
- MetadataArtifactLoader.cs
- OracleRowUpdatedEventArgs.cs
- EntityDataSourceColumn.cs
- ObjectItemCollection.cs
- LineSegment.cs
- HttpRuntimeSection.cs
- ReplyChannel.cs
- RoleServiceManager.cs
- VectorValueSerializer.cs
- AudioLevelUpdatedEventArgs.cs
- ContentDisposition.cs
- CodeAssignStatement.cs
- EventLogger.cs
- RbTree.cs
- ObfuscateAssemblyAttribute.cs
- ProtectedProviderSettings.cs
- BufferedGraphicsManager.cs
- localization.cs
- ConstantProjectedSlot.cs
- XmlNodeList.cs
- CodeCompiler.cs
- XmlSchemaGroupRef.cs
- FormViewUpdateEventArgs.cs
- GridViewHeaderRowPresenter.cs
- EpmContentDeSerializerBase.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- AutoResizedEvent.cs
- SqlDependency.cs
- PeerTransportListenAddressValidator.cs
- AttachedPropertiesService.cs
- Column.cs
- SiteMapDataSourceView.cs
- SiteMembershipCondition.cs
- AvTrace.cs
- FileSecurity.cs
- Bidi.cs
- TreeIterator.cs
- Soap.cs
- StateDesigner.TransitionInfo.cs
- GACIdentityPermission.cs
- SqlMultiplexer.cs
- GPRECT.cs
- CodeAttributeArgumentCollection.cs
- entitydatasourceentitysetnameconverter.cs
- PageAsyncTask.cs
- ContainerParaClient.cs
- Connector.xaml.cs
- MetadataPropertyvalue.cs
- SmiContext.cs
- SoapSchemaMember.cs
- RequiredFieldValidator.cs
- SqlDependency.cs
- GroupBox.cs
- QuaternionKeyFrameCollection.cs
- BitmapEffect.cs
- PointIndependentAnimationStorage.cs
- SafePipeHandle.cs
- InkCollectionBehavior.cs
- DesignerDataParameter.cs
- ImageBrush.cs
- Mappings.cs
- ComponentManagerBroker.cs
- PtsCache.cs
- AccessText.cs
- GlobalItem.cs
- NativeMethods.cs
- TextElementEnumerator.cs
- DmlSqlGenerator.cs
- IdentityElement.cs
- HttpCapabilitiesBase.cs
- FixedPageStructure.cs
- WebPartPersonalization.cs
- SimpleWorkerRequest.cs
- MarginsConverter.cs
- TdsRecordBufferSetter.cs
- EntityCollection.cs
- App.cs
- FontStretch.cs
- SystemSounds.cs
- CopyCodeAction.cs
- StateChangeEvent.cs
- DnsPermission.cs
- DriveNotFoundException.cs
- ControlSerializer.cs
- DbConnectionStringBuilder.cs