Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / TextDataBindingHandler.cs / 1 / TextDataBindingHandler.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design { using System; using System.Design; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Reflection; using System.Web.UI; ////// /// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] public class TextDataBindingHandler : DataBindingHandler { ///[To be supplied.] ////// /// public override void DataBindControl(IDesignerHost designerHost, Control control) { DataBinding textBinding = ((IDataBindingsAccessor)control).DataBindings["Text"]; if (textBinding != null) { PropertyInfo textProperty = control.GetType().GetProperty("Text"); Debug.Assert(textProperty != null, "Did not find Text property on control"); if (textProperty != null) { Debug.Assert(textProperty.PropertyType == typeof(string), "Can only handle Text properties of type string."); if (textProperty.PropertyType == typeof(string)) { DesignTimeDataBinding dt = new DesignTimeDataBinding(textBinding); string stringValue = String.Empty; if (!dt.IsCustom) { try { stringValue = DataBinder.Eval(((IDataItemContainer)control.NamingContainer).DataItem, dt.Field, dt.Format); } catch { // If the databinding failed, just use the default 'Databound' text } } if ((stringValue == null) || (stringValue.Length == 0)) { stringValue = SR.GetString(SR.Sample_Databound_Text); } textProperty.SetValue(control, stringValue, null); } } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.[To be supplied.] ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WebPartDeleteVerb.cs
- SelectedDatesCollection.cs
- OpCellTreeNode.cs
- FormViewDeletedEventArgs.cs
- HierarchicalDataTemplate.cs
- BlockCollection.cs
- SoapMessage.cs
- SrgsNameValueTag.cs
- NameValuePermission.cs
- DispatcherProcessingDisabled.cs
- BlockCollection.cs
- StrokeDescriptor.cs
- UiaCoreApi.cs
- _NtlmClient.cs
- PermissionSetEnumerator.cs
- AssemblyAttributesGoHere.cs
- SerTrace.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- EmptyReadOnlyDictionaryInternal.cs
- Configuration.cs
- WCFModelStrings.Designer.cs
- CatalogPart.cs
- ImmutableAssemblyCacheEntry.cs
- Trace.cs
- ToolboxItemFilterAttribute.cs
- TransformerInfo.cs
- WinEventWrap.cs
- DetailsViewCommandEventArgs.cs
- ParameterCollectionEditorForm.cs
- FormatPage.cs
- BlockExpression.cs
- Subtree.cs
- ToolBarOverflowPanel.cs
- XmlUrlResolver.cs
- ChildTable.cs
- WebBrowser.cs
- AuthorizationRuleCollection.cs
- oledbmetadatacollectionnames.cs
- MarginsConverter.cs
- SocketAddress.cs
- MethodCallTranslator.cs
- EmptyControlCollection.cs
- CheckedPointers.cs
- RequestQueryParser.cs
- ZipIOFileItemStream.cs
- MatcherBuilder.cs
- ValidatorUtils.cs
- ProviderSettings.cs
- TranslateTransform.cs
- SqlDataSourceFilteringEventArgs.cs
- NonVisualControlAttribute.cs
- ElementProxy.cs
- KnownBoxes.cs
- ObjRef.cs
- CqlGenerator.cs
- CLRBindingWorker.cs
- MouseBinding.cs
- FormClosedEvent.cs
- WpfWebRequestHelper.cs
- GenericQueueSurrogate.cs
- ThousandthOfEmRealPoints.cs
- Rectangle.cs
- DataColumnCollection.cs
- GenericAuthenticationEventArgs.cs
- Page.cs
- BackgroundWorker.cs
- SqlClientWrapperSmiStream.cs
- SetterBase.cs
- FormClosedEvent.cs
- WSDualHttpBindingCollectionElement.cs
- ObfuscateAssemblyAttribute.cs
- InplaceBitmapMetadataWriter.cs
- HebrewNumber.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- MasterPageParser.cs
- WindowsRichEditRange.cs
- ObjectTypeMapping.cs
- ChildTable.cs
- RemoteWebConfigurationHost.cs
- RightsManagementEncryptionTransform.cs
- TextElement.cs
- glyphs.cs
- AdapterUtil.cs
- DebugInfoGenerator.cs
- ReflectTypeDescriptionProvider.cs
- AnnotationObservableCollection.cs
- ExpressionBuilder.cs
- SerialPinChanges.cs
- ClientSideProviderDescription.cs
- CompilerTypeWithParams.cs
- SmiSettersStream.cs
- ApplicationDirectoryMembershipCondition.cs
- WindowsRichEditRange.cs
- HitTestFilterBehavior.cs
- Figure.cs
- DriveNotFoundException.cs
- RadioButton.cs
- RotateTransform.cs
- QueryInterceptorAttribute.cs
- LifetimeServices.cs