Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / DynamicData / DynamicData / DataBoundControlParameterTarget.cs / 1305376 / DataBoundControlParameterTarget.cs
namespace System.Web.DynamicData { using System; using System.Collections.Generic; using System.Linq; using System.Web.UI; using System.Web.UI.WebControls; using System.Globalization; internal class DataBoundControlParameterTarget : IControlParameterTarget { private Control _control; public DataBoundControlParameterTarget(Control control) { if (control == null) { throw new ArgumentNullException("control"); } _control = control; } public MetaTable Table { get { return _control.FindMetaTable(); } } public MetaColumn FilteredColumn { get { return null; } } public string GetPropertyNameExpression(string columnName) { // Get the DataKeyPropertyAttribute and use that as the to get the correct property name expression DataKeyPropertyAttribute attribute = _control.GetType().GetCustomAttributes(true).OfType().FirstOrDefault(); if ((attribute != null) && !String.IsNullOrEmpty(attribute.Name)) { return attribute.Name + String.Format(CultureInfo.InvariantCulture, "['{0}']", columnName); } // return String.Empty; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace System.Web.DynamicData { using System; using System.Collections.Generic; using System.Linq; using System.Web.UI; using System.Web.UI.WebControls; using System.Globalization; internal class DataBoundControlParameterTarget : IControlParameterTarget { private Control _control; public DataBoundControlParameterTarget(Control control) { if (control == null) { throw new ArgumentNullException("control"); } _control = control; } public MetaTable Table { get { return _control.FindMetaTable(); } } public MetaColumn FilteredColumn { get { return null; } } public string GetPropertyNameExpression(string columnName) { // Get the DataKeyPropertyAttribute and use that as the to get the correct property name expression DataKeyPropertyAttribute attribute = _control.GetType().GetCustomAttributes(true).OfType ().FirstOrDefault(); if ((attribute != null) && !String.IsNullOrEmpty(attribute.Name)) { return attribute.Name + String.Format(CultureInfo.InvariantCulture, "['{0}']", columnName); } // return String.Empty; } } } // 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
- DataGridViewColumnHeaderCell.cs
- LinqDataSourceEditData.cs
- XmlDesignerDataSourceView.cs
- TextRunProperties.cs
- ErasingStroke.cs
- TcpClientSocketManager.cs
- ListViewGroupItemCollection.cs
- HotCommands.cs
- SqlConnection.cs
- validationstate.cs
- ScrollBarAutomationPeer.cs
- LinqDataSourceValidationException.cs
- OdbcReferenceCollection.cs
- Stream.cs
- ConfigurationValues.cs
- Serializer.cs
- DispatcherEventArgs.cs
- ConfigViewGenerator.cs
- TraceHandler.cs
- BooleanAnimationBase.cs
- TailPinnedEventArgs.cs
- ParseChildrenAsPropertiesAttribute.cs
- ResourceDescriptionAttribute.cs
- IriParsingElement.cs
- Filter.cs
- ColumnBinding.cs
- ReferenceEqualityComparer.cs
- EventProxy.cs
- CodeIdentifier.cs
- TreeBuilderXamlTranslator.cs
- XmlSecureResolver.cs
- LinkLabelLinkClickedEvent.cs
- XmlIterators.cs
- Separator.cs
- FamilyMap.cs
- SqlGenericUtil.cs
- SymDocumentType.cs
- ServiceOperation.cs
- Emitter.cs
- XmlNodeChangedEventManager.cs
- DllHostInitializer.cs
- X509UI.cs
- ExpressionParser.cs
- SerializerDescriptor.cs
- AttributeTableBuilder.cs
- TraceListeners.cs
- TokenBasedSet.cs
- VersionUtil.cs
- FileInfo.cs
- TextOutput.cs
- Schema.cs
- SQLGuidStorage.cs
- OdbcException.cs
- PointF.cs
- FeatureSupport.cs
- Form.cs
- BidOverLoads.cs
- TransformerTypeCollection.cs
- COM2PictureConverter.cs
- UIPermission.cs
- PropertyNames.cs
- UnsafeNativeMethods.cs
- OletxVolatileEnlistment.cs
- BridgeDataReader.cs
- DataGridSortCommandEventArgs.cs
- CodeGotoStatement.cs
- ValuePattern.cs
- SqlMethodAttribute.cs
- ResourceProperty.cs
- Cloud.cs
- ResourceBinder.cs
- DeferredElementTreeState.cs
- TaiwanCalendar.cs
- RegexCharClass.cs
- PlainXmlSerializer.cs
- NameScope.cs
- ResumeStoryboard.cs
- WebPartMenu.cs
- HideDisabledControlAdapter.cs
- SspiNegotiationTokenProvider.cs
- Crc32.cs
- DeploymentExceptionMapper.cs
- base64Transforms.cs
- FormViewDeleteEventArgs.cs
- RectangleHotSpot.cs
- NotificationContext.cs
- RectangleHotSpot.cs
- TypeForwardedToAttribute.cs
- Soap.cs
- WebHttpSecurityModeHelper.cs
- OdbcDataReader.cs
- PrivacyNoticeElement.cs
- DetailsViewInsertedEventArgs.cs
- ValueQuery.cs
- ClientSettings.cs
- SoundPlayer.cs
- DefaultPropertyAttribute.cs
- SplitterEvent.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- SqlDelegatedTransaction.cs