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
- StructuredType.cs
- EraserBehavior.cs
- KeyPressEvent.cs
- HiddenField.cs
- ValueChangedEventManager.cs
- VirtualizingPanel.cs
- AvtEvent.cs
- MessageFilterTable.cs
- MSAAWinEventWrap.cs
- DataGridViewTextBoxEditingControl.cs
- NameValueConfigurationElement.cs
- EnumerableRowCollectionExtensions.cs
- MetaModel.cs
- Vertex.cs
- HttpBindingExtension.cs
- MailWebEventProvider.cs
- RemotingService.cs
- StickyNoteContentControl.cs
- SecurityProtocolFactory.cs
- ByteAnimationBase.cs
- DTCTransactionManager.cs
- BoundField.cs
- fixedPageContentExtractor.cs
- Group.cs
- EventToken.cs
- WebPartVerbCollection.cs
- ServiceModelEnumValidator.cs
- Utils.cs
- SqlCommandBuilder.cs
- XmlMapping.cs
- NamedPipeAppDomainProtocolHandler.cs
- CategoryGridEntry.cs
- PauseStoryboard.cs
- Stack.cs
- DataGridViewCellMouseEventArgs.cs
- Int64Converter.cs
- Drawing.cs
- TreeNodeEventArgs.cs
- VirtualizedContainerService.cs
- SafeReversePInvokeHandle.cs
- CompiledQueryCacheEntry.cs
- PlatformCulture.cs
- EventLogTraceListener.cs
- NullReferenceException.cs
- RoutingEndpointTrait.cs
- BinaryObjectInfo.cs
- WindowShowOrOpenTracker.cs
- Compilation.cs
- FlowDocumentPage.cs
- IChannel.cs
- SqlNodeAnnotations.cs
- FrameworkContentElementAutomationPeer.cs
- GcHandle.cs
- SystemEvents.cs
- PrivacyNoticeBindingElementImporter.cs
- HWStack.cs
- CodeExpressionCollection.cs
- WebColorConverter.cs
- DataGridViewDataConnection.cs
- _StreamFramer.cs
- BooleanKeyFrameCollection.cs
- TextBoxView.cs
- NotSupportedException.cs
- ExpressionBuilder.cs
- UTF8Encoding.cs
- CodeAttributeArgument.cs
- XmlCustomFormatter.cs
- ImageClickEventArgs.cs
- StringUtil.cs
- TabControlAutomationPeer.cs
- AssemblyUtil.cs
- WebException.cs
- BuildProvider.cs
- LassoHelper.cs
- InputElement.cs
- MimeTypeAttribute.cs
- SByte.cs
- tooltip.cs
- BaseCAMarshaler.cs
- FixedDocumentSequencePaginator.cs
- Group.cs
- Command.cs
- CollectionsUtil.cs
- PolicyManager.cs
- EntityClientCacheEntry.cs
- DispatchChannelSink.cs
- InkPresenter.cs
- NumericUpDownAcceleration.cs
- BitmapEffectGroup.cs
- ParsedAttributeCollection.cs
- PropertyChangedEventArgs.cs
- XmlSerializationReader.cs
- CriticalFinalizerObject.cs
- HashAlgorithm.cs
- RemoteCryptoDecryptRequest.cs
- SqlCommandSet.cs
- MemoryRecordBuffer.cs
- OdbcParameter.cs
- COM2ColorConverter.cs
- ISAPIApplicationHost.cs