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
- TreeWalkHelper.cs
- ArrayTypeMismatchException.cs
- TextViewSelectionProcessor.cs
- Vector.cs
- UTF7Encoding.cs
- LineBreakRecord.cs
- OrderPreservingPipeliningSpoolingTask.cs
- HiddenField.cs
- WeakReadOnlyCollection.cs
- DesignBinding.cs
- ComboBoxItem.cs
- AccessedThroughPropertyAttribute.cs
- InputProcessorProfiles.cs
- InkPresenter.cs
- TraceUtils.cs
- CngAlgorithmGroup.cs
- BindingExpressionBase.cs
- TreeNodeClickEventArgs.cs
- InteropAutomationProvider.cs
- StreamSecurityUpgradeInitiatorAsyncResult.cs
- SqlDataSourceFilteringEventArgs.cs
- DesignerActionItem.cs
- ViewStateException.cs
- DesignerHelpers.cs
- BulletChrome.cs
- WindowInteractionStateTracker.cs
- _Win32.cs
- InvalidAsynchronousStateException.cs
- CodeTryCatchFinallyStatement.cs
- cookie.cs
- HtmlWindow.cs
- SqlUserDefinedAggregateAttribute.cs
- Recipient.cs
- ClockGroup.cs
- PerformanceCounterCategory.cs
- StateManagedCollection.cs
- _HeaderInfo.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- DynamicField.cs
- TimeSpanConverter.cs
- HitTestParameters.cs
- StyleTypedPropertyAttribute.cs
- SiteMapNodeCollection.cs
- CustomTypeDescriptor.cs
- TrackingServices.cs
- _LazyAsyncResult.cs
- DoubleCollectionValueSerializer.cs
- XPathNodeInfoAtom.cs
- FactoryId.cs
- AnnotationResourceCollection.cs
- Stacktrace.cs
- SizeAnimationClockResource.cs
- DataRowView.cs
- MSAANativeProvider.cs
- TypeConverterHelper.cs
- ProcessInputEventArgs.cs
- TripleDES.cs
- TabPage.cs
- AsyncOperationLifetimeManager.cs
- LambdaCompiler.Statements.cs
- SimpleRecyclingCache.cs
- EntityAdapter.cs
- TextReader.cs
- Attribute.cs
- DrawingGroupDrawingContext.cs
- CodeDelegateCreateExpression.cs
- AutomationTextAttribute.cs
- StorageComplexPropertyMapping.cs
- SafeProcessHandle.cs
- CodeExpressionStatement.cs
- ItemsPanelTemplate.cs
- StructuredType.cs
- MergeFailedEvent.cs
- OracleTransaction.cs
- ScaleTransform3D.cs
- AddInPipelineAttributes.cs
- VectorValueSerializer.cs
- ObjectDataSourceSelectingEventArgs.cs
- SqlWebEventProvider.cs
- EntityContainerEntitySetDefiningQuery.cs
- SqlDataReader.cs
- MessagePropertyFilter.cs
- Choices.cs
- InstanceKeyView.cs
- UserControlParser.cs
- DataSysAttribute.cs
- EditingMode.cs
- ValidatingReaderNodeData.cs
- DocumentPageTextView.cs
- HtmlInputCheckBox.cs
- Font.cs
- DataServiceResponse.cs
- ToolStripContainer.cs
- RemotingConfigParser.cs
- ParseHttpDate.cs
- WSHttpSecurity.cs
- AdCreatedEventArgs.cs
- MultipleViewPattern.cs
- SettingsPropertyWrongTypeException.cs
- TimeManager.cs