Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / AdvancedBindingPropertyDescriptor.cs / 1 / AdvancedBindingPropertyDescriptor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms.Design { using System.Design; using System; using System.ComponentModel; ////// /// internal class AdvancedBindingPropertyDescriptor : PropertyDescriptor { internal static AdvancedBindingEditor advancedBindingEditor = new AdvancedBindingEditor(); internal static AdvancedBindingTypeConverter advancedBindingTypeConverter = new AdvancedBindingTypeConverter(); internal AdvancedBindingPropertyDescriptor() : base(SR.GetString(SR.AdvancedBindingPropertyDescName), null) { } ///Provides a property description of an advanced binding object. ////// /// public override Type ComponentType { get { return typeof(ControlBindingsCollection); } } public override AttributeCollection Attributes { get { return new AttributeCollection(new Attribute[]{new SRDescriptionAttribute(SR.AdvancedBindingPropertyDescriptorDesc), NotifyParentPropertyAttribute.Yes, new MergablePropertyAttribute(false)}); } } ///Gets the type of component this property is bound to. ////// /// public override bool IsReadOnly { get { return false; } } ///Indicates whether this property is read-only. ////// /// public override Type PropertyType { get { return typeof(object); } } ///Gets the type of the property. ////// /// public override TypeConverter Converter { get { if (advancedBindingTypeConverter == null) { advancedBindingTypeConverter = new AdvancedBindingTypeConverter(); } return advancedBindingTypeConverter; } } ///Gets the type converter. ////// /// public override object GetEditor(Type type) { if (type == typeof(System.Drawing.Design.UITypeEditor)) { return advancedBindingEditor; } return base.GetEditor(type); } ///Gets an editor of the specified type. ////// /// public override bool CanResetValue(object component) { return false; } ///Indicates whether resetting the component will change the value of the /// component. ////// /// protected override void FillAttributes(System.Collections.IList attributeList) { attributeList.Add(RefreshPropertiesAttribute.All); base.FillAttributes(attributeList); } ///In an derived class, adds the attributes of the inherited class to the /// specified list of attributes in the parent class. ////// /// public override object GetValue(object component) { System.Diagnostics.Debug.Assert(component is ControlBindingsCollection, "we only deal w/ bindings collection"); return component; } ///Gets the current value of the property on the specified /// component. ////// /// public override void ResetValue(object component) { } ///Resets the value of the property on the specified component. ////// /// public override void SetValue(object component, object value) { } ///Sets the value of the property on the specified component to the specified /// value. ////// /// public override bool ShouldSerializeValue(object component) { return false; } internal class AdvancedBindingTypeConverter : TypeConverter { public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { System.Diagnostics.Debug.Assert(value is ControlBindingsCollection, "we only deal w/ bindings collection"); if (destinationType == typeof(String)) { return String.Empty; } else { return base.ConvertTo(context, culture, value, destinationType); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.Indicates whether the value of this property should be persisted. ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BaseParaClient.cs
- LayoutEditorPart.cs
- AssertHelper.cs
- RoutedEventHandlerInfo.cs
- ReflectTypeDescriptionProvider.cs
- EndPoint.cs
- Window.cs
- FilterableAttribute.cs
- ContextProperty.cs
- StylusEventArgs.cs
- DBSchemaTable.cs
- TextDecorationCollection.cs
- TransactionScopeDesigner.cs
- UnsafeNativeMethods.cs
- SelectorItemAutomationPeer.cs
- SelectionEditor.cs
- TranslateTransform.cs
- ModelPropertyImpl.cs
- NativeMethods.cs
- Itemizer.cs
- RequiredFieldValidator.cs
- PrePostDescendentsWalker.cs
- NodeFunctions.cs
- SqlError.cs
- ThaiBuddhistCalendar.cs
- LicenseContext.cs
- TraceSwitch.cs
- SignerInfo.cs
- DataControlCommands.cs
- EntityParameter.cs
- Span.cs
- odbcmetadatafactory.cs
- ProviderCollection.cs
- ClientCredentials.cs
- WebServiceResponse.cs
- XmlWriter.cs
- UpdateCommand.cs
- TableCellCollection.cs
- SqlDataSourceFilteringEventArgs.cs
- ClientSideQueueItem.cs
- SizeChangedInfo.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- CommonObjectSecurity.cs
- CultureTable.cs
- XmlBoundElement.cs
- ObjectDataSourceFilteringEventArgs.cs
- HitTestWithPointDrawingContextWalker.cs
- SecurityManager.cs
- Panel.cs
- OneOfElement.cs
- DataBoundControlParameterTarget.cs
- FileUpload.cs
- GeneralTransform3DTo2DTo3D.cs
- ClosureBinding.cs
- NamedPipeAppDomainProtocolHandler.cs
- PtsHost.cs
- TearOffProxy.cs
- EmbeddedMailObject.cs
- WeakReference.cs
- ReferenceSchema.cs
- ToolStripManager.cs
- RadioButtonPopupAdapter.cs
- SystemWebCachingSectionGroup.cs
- RSAPKCS1SignatureDeformatter.cs
- CSharpCodeProvider.cs
- ThreadStaticAttribute.cs
- DataBoundControlParameterTarget.cs
- CancelRequestedQuery.cs
- IndexingContentUnit.cs
- GB18030Encoding.cs
- WindowInteropHelper.cs
- XsltSettings.cs
- ViewCellRelation.cs
- LowerCaseStringConverter.cs
- _SSPIWrapper.cs
- EnumerationRangeValidationUtil.cs
- AlternateViewCollection.cs
- GridViewColumnCollection.cs
- WebSysDescriptionAttribute.cs
- AnnotationResource.cs
- DesignColumn.cs
- EmptyCollection.cs
- Rule.cs
- IPEndPointCollection.cs
- ResourcesBuildProvider.cs
- WS2007FederationHttpBinding.cs
- LoaderAllocator.cs
- LinearGradientBrush.cs
- _KerberosClient.cs
- HttpRequest.cs
- SqlUdtInfo.cs
- AttributeUsageAttribute.cs
- SizeChangedEventArgs.cs
- MetadataItemSerializer.cs
- TransferRequestHandler.cs
- ReadWriteSpinLock.cs
- DockProviderWrapper.cs
- ByteFacetDescriptionElement.cs
- TreeViewImageKeyConverter.cs
- Sorting.cs