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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DictionaryContent.cs
- IntegerValidator.cs
- NamedPermissionSet.cs
- XmlNavigatorStack.cs
- LabelEditEvent.cs
- PassportAuthenticationModule.cs
- XPathDescendantIterator.cs
- ScrollProviderWrapper.cs
- DependentList.cs
- OperatingSystem.cs
- RawMouseInputReport.cs
- PersonalizationStateQuery.cs
- ComponentCollection.cs
- ArgumentOutOfRangeException.cs
- DecimalAnimationBase.cs
- XmlTextWriter.cs
- ExtenderHelpers.cs
- ButtonBase.cs
- CodeMemberEvent.cs
- BCryptNative.cs
- QuarticEase.cs
- ProgressChangedEventArgs.cs
- Socket.cs
- IndicCharClassifier.cs
- FormsAuthenticationUser.cs
- BigInt.cs
- SubtreeProcessor.cs
- FileDialogCustomPlace.cs
- WebZone.cs
- SelectiveScrollingGrid.cs
- DescendantOverDescendantQuery.cs
- CorePropertiesFilter.cs
- SByteConverter.cs
- CaretElement.cs
- CachedBitmap.cs
- ValueUtilsSmi.cs
- SystemIPAddressInformation.cs
- BindingOperations.cs
- ScriptBehaviorDescriptor.cs
- TreeView.cs
- ListView.cs
- RegexNode.cs
- FontStretchConverter.cs
- TableCellAutomationPeer.cs
- TextReader.cs
- ClockGroup.cs
- WindowProviderWrapper.cs
- EntityDataSourceSelectedEventArgs.cs
- DispatcherProcessingDisabled.cs
- HtmlTableRow.cs
- TreeViewAutomationPeer.cs
- ColorInterpolationModeValidation.cs
- Missing.cs
- SiteMapHierarchicalDataSourceView.cs
- TcpTransportSecurity.cs
- SortExpressionBuilder.cs
- InkCanvasSelectionAdorner.cs
- FileVersionInfo.cs
- SmtpMail.cs
- EntityException.cs
- Int16.cs
- QilNode.cs
- COM2PropertyDescriptor.cs
- DynamicUpdateCommand.cs
- HwndSubclass.cs
- MediaPlayerState.cs
- TickBar.cs
- KnownAssembliesSet.cs
- SystemException.cs
- Region.cs
- HandleRef.cs
- ToolStripItemImageRenderEventArgs.cs
- MobileFormsAuthentication.cs
- ErasingStroke.cs
- ValidationResult.cs
- StructuredProperty.cs
- LayoutEditorPart.cs
- RawStylusSystemGestureInputReport.cs
- TransformCollection.cs
- TextReader.cs
- PageSettings.cs
- DbInsertCommandTree.cs
- CodeAssignStatement.cs
- XmlSchemaAnnotated.cs
- DoubleLink.cs
- ClickablePoint.cs
- HtmlInputPassword.cs
- QueryResults.cs
- ListViewCancelEventArgs.cs
- ModuleBuilderData.cs
- TextBoxLine.cs
- AsnEncodedData.cs
- Int32Rect.cs
- PageAsyncTask.cs
- ClrProviderManifest.cs
- BCLDebug.cs
- CodeRemoveEventStatement.cs
- CodeExporter.cs
- EmptyEnumerator.cs
- StorageAssociationTypeMapping.cs