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
- HitTestWithPointDrawingContextWalker.cs
- BooleanAnimationUsingKeyFrames.cs
- StringWriter.cs
- Point3DAnimationBase.cs
- XmlSerializerNamespaces.cs
- GeneralTransformGroup.cs
- ItemsControlAutomationPeer.cs
- EntityType.cs
- NullableBoolConverter.cs
- EventHandlingScope.cs
- TabControlEvent.cs
- TransformerTypeCollection.cs
- DelegatingConfigHost.cs
- SelfIssuedAuthRSAPKCS1SignatureDeformatter.cs
- StoryFragments.cs
- XMLUtil.cs
- System.Data_BID.cs
- Expression.cs
- NotFiniteNumberException.cs
- WindowsTokenRoleProvider.cs
- BamlResourceDeserializer.cs
- SectionVisual.cs
- InstalledVoice.cs
- CryptoStream.cs
- CompilerResults.cs
- FontDriver.cs
- TailCallAnalyzer.cs
- SamlAdvice.cs
- TraceHwndHost.cs
- XPathDocumentNavigator.cs
- ActionFrame.cs
- RequestContext.cs
- TracingConnectionListener.cs
- ElementFactory.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- dbdatarecord.cs
- LambdaCompiler.Generated.cs
- MessageFormatterConverter.cs
- CodeObject.cs
- WorkflowTransactionService.cs
- WorkflowTransactionOptions.cs
- DesignerUtility.cs
- ISAPIApplicationHost.cs
- x509store.cs
- HashJoinQueryOperatorEnumerator.cs
- HuffCodec.cs
- PropertyTabChangedEvent.cs
- DurationConverter.cs
- DirectoryNotFoundException.cs
- EnumConverter.cs
- AttachmentService.cs
- XmlLinkedNode.cs
- BasePattern.cs
- ButtonDesigner.cs
- FormsAuthenticationEventArgs.cs
- SingleAnimationUsingKeyFrames.cs
- DetailsViewPagerRow.cs
- MenuItemBinding.cs
- QueueProcessor.cs
- WorkflowInstanceExtensionManager.cs
- CallId.cs
- IgnoreDeviceFilterElement.cs
- _DigestClient.cs
- TypedElement.cs
- NTAccount.cs
- SQLInt64.cs
- LinqDataSourceInsertEventArgs.cs
- FlowDocumentReader.cs
- Evaluator.cs
- ExpressionsCollectionEditor.cs
- BadImageFormatException.cs
- DesignerVerbToolStripMenuItem.cs
- ApplicationDirectory.cs
- ConsumerConnectionPoint.cs
- AuthStoreRoleProvider.cs
- FastPropertyAccessor.cs
- ScriptIgnoreAttribute.cs
- SafeFileHandle.cs
- SchemaAttDef.cs
- DeferredSelectedIndexReference.cs
- Memoizer.cs
- bidPrivateBase.cs
- SortAction.cs
- ProbeMatchesMessageCD1.cs
- WorkflowInstanceExtensionManager.cs
- InfoCardSchemas.cs
- KnownIds.cs
- ToolBar.cs
- FacetValues.cs
- TypeConverterAttribute.cs
- StaticExtension.cs
- BaseCollection.cs
- HyperLinkColumn.cs
- JapaneseLunisolarCalendar.cs
- EventArgs.cs
- TextServicesManager.cs
- Pens.cs
- Rect3D.cs
- DelegateTypeInfo.cs
- ResXResourceReader.cs