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
- FileVersion.cs
- SystemIPv6InterfaceProperties.cs
- PathBox.cs
- ConfigXmlComment.cs
- CircleHotSpot.cs
- CharKeyFrameCollection.cs
- SelectionRange.cs
- OleDbErrorCollection.cs
- ResourceManager.cs
- WindowsFormsLinkLabel.cs
- MarkupCompiler.cs
- StrokeFIndices.cs
- SemanticBasicElement.cs
- TimelineClockCollection.cs
- UncommonField.cs
- PageCodeDomTreeGenerator.cs
- ToolStripSystemRenderer.cs
- TextTreeTextElementNode.cs
- FormsAuthenticationTicket.cs
- SqlReorderer.cs
- ClientSection.cs
- PrintControllerWithStatusDialog.cs
- SafePipeHandle.cs
- ConfigurationValue.cs
- RootNamespaceAttribute.cs
- JapaneseLunisolarCalendar.cs
- Pair.cs
- TemplatePagerField.cs
- InputBinding.cs
- DesignSurfaceCollection.cs
- LZCodec.cs
- IProducerConsumerCollection.cs
- TogglePatternIdentifiers.cs
- FormatterConverter.cs
- ListManagerBindingsCollection.cs
- StringUtil.cs
- OnOperation.cs
- CharacterMetricsDictionary.cs
- RSACryptoServiceProvider.cs
- DataBindingCollectionEditor.cs
- SQLString.cs
- CharConverter.cs
- CompleteWizardStep.cs
- PackUriHelper.cs
- UnrecognizedAssertionsBindingElement.cs
- DataGridLinkButton.cs
- OverflowException.cs
- PixelShader.cs
- Formatter.cs
- DataGridViewControlCollection.cs
- SchemaImporterExtension.cs
- XmlCharType.cs
- HiddenField.cs
- SrgsSubset.cs
- Color.cs
- CacheChildrenQuery.cs
- CoordinationService.cs
- ArraySortHelper.cs
- XmlKeywords.cs
- PropertyBuilder.cs
- ConfigurationManagerHelper.cs
- RootBuilder.cs
- DefaultValueConverter.cs
- SoapSchemaMember.cs
- InternalReceiveMessage.cs
- DNS.cs
- SemanticBasicElement.cs
- ProtocolsConfiguration.cs
- XmlSchemaObject.cs
- TemplatedAdorner.cs
- DataSvcMapFileSerializer.cs
- FileDocument.cs
- WarningException.cs
- ComponentCollection.cs
- ComPlusThreadInitializer.cs
- Brushes.cs
- AccessDataSource.cs
- PassportAuthentication.cs
- VariantWrapper.cs
- CompiledIdentityConstraint.cs
- EventLogEntry.cs
- HttpHeaderCollection.cs
- MasterPageCodeDomTreeGenerator.cs
- DataGridColumnHeaderCollection.cs
- XmlSchemaCompilationSettings.cs
- httpserverutility.cs
- CellParaClient.cs
- ConfigXmlCDataSection.cs
- x509store.cs
- RegionData.cs
- PEFileReader.cs
- QuadraticBezierSegment.cs
- FileCodeGroup.cs
- SkipStoryboardToFill.cs
- WebEventTraceProvider.cs
- ComponentEvent.cs
- ZeroOpNode.cs
- FactoryMaker.cs
- UICuesEvent.cs
- InputLanguage.cs