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
- TemplateBaseAction.cs
- KeySplineConverter.cs
- IISMapPath.cs
- DataGridViewHeaderCell.cs
- XsltLoader.cs
- DescendantOverDescendantQuery.cs
- BitmapVisualManager.cs
- ResourceDisplayNameAttribute.cs
- xml.cs
- HostedHttpTransportManager.cs
- NumberAction.cs
- FlowDocumentPage.cs
- DesignerTransactionCloseEvent.cs
- CLSCompliantAttribute.cs
- StylusCaptureWithinProperty.cs
- ServiceContractListItemList.cs
- CorrelationValidator.cs
- ClientSponsor.cs
- WindowsStatusBar.cs
- MenuCommandService.cs
- DataGridViewTextBoxCell.cs
- BinaryNode.cs
- Camera.cs
- OdbcDataAdapter.cs
- ButtonPopupAdapter.cs
- QuaternionRotation3D.cs
- ConstructorExpr.cs
- Rect.cs
- DesignerActionPanel.cs
- UTF7Encoding.cs
- WebPartZoneBase.cs
- BCryptNative.cs
- ECDiffieHellmanCng.cs
- AccessViolationException.cs
- TitleStyle.cs
- FrameworkReadOnlyPropertyMetadata.cs
- BamlMapTable.cs
- StatusBarItem.cs
- TableLayoutPanelCellPosition.cs
- PartialCachingControl.cs
- CompilerTypeWithParams.cs
- PartialList.cs
- PlainXmlDeserializer.cs
- DefaultMemberAttribute.cs
- XmlRawWriter.cs
- CompoundFileReference.cs
- MSAAEventDispatcher.cs
- DataGridViewCellEventArgs.cs
- FocusWithinProperty.cs
- InkCanvasInnerCanvas.cs
- ValidatingReaderNodeData.cs
- XmlEnumAttribute.cs
- SoapException.cs
- DocumentPageView.cs
- ExpressionBuilder.cs
- SecurityHeaderElementInferenceEngine.cs
- IndexOutOfRangeException.cs
- RectIndependentAnimationStorage.cs
- UnsignedPublishLicense.cs
- TextBoxBase.cs
- TypeForwardedToAttribute.cs
- DbConnectionStringBuilder.cs
- CommonDialog.cs
- TabControlCancelEvent.cs
- CodePropertyReferenceExpression.cs
- Vector3DKeyFrameCollection.cs
- SymbolTable.cs
- ScriptingAuthenticationServiceSection.cs
- keycontainerpermission.cs
- Array.cs
- FormatSettings.cs
- ImportContext.cs
- _NestedMultipleAsyncResult.cs
- XmlDictionaryReader.cs
- BindingBase.cs
- IgnoreDataMemberAttribute.cs
- AttributeQuery.cs
- ToolStripContentPanel.cs
- MobileListItem.cs
- UrlPath.cs
- TemplateBindingExtensionConverter.cs
- EllipseGeometry.cs
- ToolStripItemCollection.cs
- AuthenticatedStream.cs
- _TimerThread.cs
- ExtenderControl.cs
- AssemblyCollection.cs
- ReflectTypeDescriptionProvider.cs
- CodeExpressionCollection.cs
- FileDetails.cs
- QueueAccessMode.cs
- EnumerableWrapperWeakToStrong.cs
- ColorConvertedBitmap.cs
- HwndSourceParameters.cs
- ChangesetResponse.cs
- MenuEventArgs.cs
- QilLiteral.cs
- SigningProgress.cs
- UIElementHelper.cs
- columnmapkeybuilder.cs