Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / ToolStripCustomTypeDescriptor.cs / 1 / ToolStripCustomTypeDescriptor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Windows.Forms.Design { using System.Design; using System.ComponentModel; using System.Diagnostics; using System; using System.Collections; using System.ComponentModel.Design; using System.ComponentModel.Design.Serialization; using System.Windows.Forms; ////// ToolStripCustomTypeDescriptor class. /// internal class ToolStripCustomTypeDescriptor : CustomTypeDescriptor { ToolStrip instance = null; PropertyDescriptor propItems = null; PropertyDescriptorCollection collection = null; public ToolStripCustomTypeDescriptor(ToolStrip instance) : base() { this.instance = instance; } ////// /// The GetPropertyOwner method returns an instance of an object that /// owns the given property for the object this type descriptor is representing. /// An optional attribute array may be provided to filter the collection that is /// returned. Returning null from this method causes the TypeDescriptor object /// to use its default type description services. /// public override object GetPropertyOwner(PropertyDescriptor pd) { return instance; } ////// /// The GetProperties method returns a collection of property descriptors /// for the object this type descriptor is representing. An optional /// attribute array may be provided to filter the collection that is returned. /// If no parent is provided,this will return an empty /// property collection. /// public override PropertyDescriptorCollection GetProperties() { if (instance!= null && collection == null) { PropertyDescriptorCollection retColl = TypeDescriptor.GetProperties(instance); PropertyDescriptor[] propArray = new PropertyDescriptor[retColl.Count]; retColl.CopyTo(propArray, 0); collection = new PropertyDescriptorCollection(propArray, false); } if (collection.Count > 0) { propItems = collection["Items"]; if (propItems != null) { collection.Remove(propItems); } } return collection; } ////// /// The GetProperties method returns a collection of property descriptors /// for the object this type descriptor is representing. An optional /// attribute array may be provided to filter the collection that is returned. /// If no parent is provided,this will return an empty /// property collection. /// Here we will pass the "collection without the "items" property. /// public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) { if (instance!= null && collection == null) { PropertyDescriptorCollection retColl = TypeDescriptor.GetProperties(instance); PropertyDescriptor[] propArray = new PropertyDescriptor[retColl.Count]; retColl.CopyTo(propArray, 0); collection = new PropertyDescriptorCollection(propArray, false); } if (collection.Count > 0) { propItems = collection["Items"]; if (propItems != null) { collection.Remove(propItems); } } return collection; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Image.cs
- EntityTypeEmitter.cs
- OdbcCommandBuilder.cs
- ListViewItemEventArgs.cs
- EdmScalarPropertyAttribute.cs
- DecoderExceptionFallback.cs
- AddInServer.cs
- AspNetPartialTrustHelpers.cs
- Perspective.cs
- XmlMapping.cs
- GridViewUpdatedEventArgs.cs
- Walker.cs
- CommandLibraryHelper.cs
- TextEditorContextMenu.cs
- ShaperBuffers.cs
- Quaternion.cs
- NetworkAddressChange.cs
- OutgoingWebResponseContext.cs
- QueuePathDialog.cs
- ProfilePropertySettingsCollection.cs
- CompoundFileDeflateTransform.cs
- PropertyDescriptors.cs
- CodeTypeReferenceExpression.cs
- RSAPKCS1SignatureDeformatter.cs
- MeshGeometry3D.cs
- ToolStripRendererSwitcher.cs
- ProfilePropertyNameValidator.cs
- SystemBrushes.cs
- WebServiceData.cs
- DES.cs
- CalendarDesigner.cs
- StrongNameKeyPair.cs
- TextServicesCompartmentEventSink.cs
- ObjectTypeMapping.cs
- NullPackagingPolicy.cs
- MetafileHeaderWmf.cs
- PropertyValueUIItem.cs
- Journal.cs
- PasswordDeriveBytes.cs
- StronglyTypedResourceBuilder.cs
- oledbmetadatacolumnnames.cs
- IProducerConsumerCollection.cs
- VirtualizingPanel.cs
- StreamUpdate.cs
- CodeBlockBuilder.cs
- XmlEventCache.cs
- basevalidator.cs
- DescendantOverDescendantQuery.cs
- FamilyTypefaceCollection.cs
- DesignColumnCollection.cs
- CompositeScriptReference.cs
- LocationReferenceEnvironment.cs
- SslStream.cs
- Form.cs
- SqlClientFactory.cs
- Translator.cs
- ListViewContainer.cs
- TransactionChannelFaultConverter.cs
- ChannelSinkStacks.cs
- BasicViewGenerator.cs
- Double.cs
- OpenFileDialog.cs
- DataGridSortCommandEventArgs.cs
- PrintEvent.cs
- MessageSecurityVersion.cs
- DeleteIndexBinder.cs
- ValueUtilsSmi.cs
- LongTypeConverter.cs
- RegexGroupCollection.cs
- CodeArgumentReferenceExpression.cs
- GeneralTransform.cs
- InkCanvasSelection.cs
- ObjectViewFactory.cs
- ComponentConverter.cs
- Popup.cs
- DataPointer.cs
- IResourceProvider.cs
- DetailsViewPagerRow.cs
- MobileUserControlDesigner.cs
- followingquery.cs
- TreeView.cs
- AssociativeAggregationOperator.cs
- ProvidersHelper.cs
- MobileSysDescriptionAttribute.cs
- AnimationStorage.cs
- CallbackWrapper.cs
- InputMethodStateTypeInfo.cs
- GrammarBuilderBase.cs
- MetadataArtifactLoaderFile.cs
- XsltException.cs
- DelegatingMessage.cs
- input.cs
- ClockGroup.cs
- UserControlAutomationPeer.cs
- SizeAnimation.cs
- BitmapPalette.cs
- DataObjectCopyingEventArgs.cs
- DatagridviewDisplayedBandsData.cs
- SharedConnectionInfo.cs
- AppDomainAttributes.cs