Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / Design / PropertyTab.cs / 1305376 / PropertyTab.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms.Design { using System.Runtime.InteropServices; using System.ComponentModel; using System.Diagnostics; using System; using System.Drawing; using System.Windows.Forms; using Microsoft.Win32; using System.Runtime.Versioning; ////// /// [System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name="FullTrust")] public abstract class PropertyTab : IExtenderProvider { private Object[] components; private Bitmap bitmap; private bool checkedBmp; ///Provides a base class for property tabs. ///~PropertyTab() { Dispose(false); } // don't override this. Just put a 16x16 bitmap in a file with the same name as your class in your resources. /// /// /// public virtual Bitmap Bitmap { [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] get { if (!checkedBmp && bitmap == null) { string bmpName = GetType().Name + ".bmp"; try { bitmap = new Bitmap(GetType(), bmpName); } catch (Exception ex) { Debug.Fail("Failed to find bitmap '" + bmpName + "' for class " + GetType().FullName, ex.ToString()); } checkedBmp = true; } return bitmap; } } // don't override this either. ///Gets or sets a bitmap to display in the property tab. ////// /// public virtual Object[] Components { get { return components; } set { this.components = value; } } // okay. Override this to give a good TabName. ///Gets or sets the array of components the property tab is associated with. ////// /// public abstract string TabName { get; } ///Gets or sets the name for the property tab. ////// /// public virtual string HelpKeyword { get { return TabName; } } // override this to reject components you don't want to support. ///Gets or sets the help keyword that is to be associated with this tab. This defaults /// to the tab name. ////// /// public virtual bool CanExtend(Object extendee) { return true; } ///Gets a value indicating whether the specified object be can extended. ////// /// public virtual void Dispose() { Dispose(true); GC.SuppressFinalize(this); } ///[To be supplied.] ///protected virtual void Dispose(bool disposing) { if (disposing) { if (bitmap != null) { bitmap.Dispose(); bitmap = null; } } } // return the default property item /// /// /// public virtual PropertyDescriptor GetDefaultProperty(Object component) { return TypeDescriptor.GetDefaultProperty(component); } // okay, override this to return whatever you want to return... All properties must apply to component. ///Gets the default property of the specified component. ////// /// public virtual PropertyDescriptorCollection GetProperties(Object component) { return GetProperties(component, null); } ///Gets the properties of the specified component. ////// /// public abstract PropertyDescriptorCollection GetProperties(object component, Attribute[] attributes); ///Gets the properties of the specified component which match the specified /// attributes. ////// /// public virtual PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object component, Attribute[] attributes) { return GetProperties(component, attributes); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //Gets the properties of the specified component... ///// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms.Design { using System.Runtime.InteropServices; using System.ComponentModel; using System.Diagnostics; using System; using System.Drawing; using System.Windows.Forms; using Microsoft.Win32; using System.Runtime.Versioning; ////// /// [System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name="FullTrust")] public abstract class PropertyTab : IExtenderProvider { private Object[] components; private Bitmap bitmap; private bool checkedBmp; ///Provides a base class for property tabs. ///~PropertyTab() { Dispose(false); } // don't override this. Just put a 16x16 bitmap in a file with the same name as your class in your resources. /// /// /// public virtual Bitmap Bitmap { [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] get { if (!checkedBmp && bitmap == null) { string bmpName = GetType().Name + ".bmp"; try { bitmap = new Bitmap(GetType(), bmpName); } catch (Exception ex) { Debug.Fail("Failed to find bitmap '" + bmpName + "' for class " + GetType().FullName, ex.ToString()); } checkedBmp = true; } return bitmap; } } // don't override this either. ///Gets or sets a bitmap to display in the property tab. ////// /// public virtual Object[] Components { get { return components; } set { this.components = value; } } // okay. Override this to give a good TabName. ///Gets or sets the array of components the property tab is associated with. ////// /// public abstract string TabName { get; } ///Gets or sets the name for the property tab. ////// /// public virtual string HelpKeyword { get { return TabName; } } // override this to reject components you don't want to support. ///Gets or sets the help keyword that is to be associated with this tab. This defaults /// to the tab name. ////// /// public virtual bool CanExtend(Object extendee) { return true; } ///Gets a value indicating whether the specified object be can extended. ////// /// public virtual void Dispose() { Dispose(true); GC.SuppressFinalize(this); } ///[To be supplied.] ///protected virtual void Dispose(bool disposing) { if (disposing) { if (bitmap != null) { bitmap.Dispose(); bitmap = null; } } } // return the default property item /// /// /// public virtual PropertyDescriptor GetDefaultProperty(Object component) { return TypeDescriptor.GetDefaultProperty(component); } // okay, override this to return whatever you want to return... All properties must apply to component. ///Gets the default property of the specified component. ////// /// public virtual PropertyDescriptorCollection GetProperties(Object component) { return GetProperties(component, null); } ///Gets the properties of the specified component. ////// /// public abstract PropertyDescriptorCollection GetProperties(object component, Attribute[] attributes); ///Gets the properties of the specified component which match the specified /// attributes. ////// /// public virtual PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object component, Attribute[] attributes) { return GetProperties(component, attributes); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.Gets the properties of the specified component... ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Repeater.cs
- TcpProcessProtocolHandler.cs
- filewebresponse.cs
- MatrixCamera.cs
- CodeArrayCreateExpression.cs
- ToolStripPanel.cs
- EnumerationRangeValidationUtil.cs
- WindowsFont.cs
- ForwardPositionQuery.cs
- TraceSection.cs
- DataBindingHandlerAttribute.cs
- SID.cs
- RuntimeCompatibilityAttribute.cs
- xmlsaver.cs
- DragStartedEventArgs.cs
- HitTestParameters.cs
- TextDecorationUnitValidation.cs
- FormatSettings.cs
- DefaultDiscoveryService.cs
- SystemWebExtensionsSectionGroup.cs
- DefaultClaimSet.cs
- DupHandleConnectionReader.cs
- ExpandedWrapper.cs
- BamlResourceSerializer.cs
- VirtualizedItemProviderWrapper.cs
- OdbcCommandBuilder.cs
- EngineSiteSapi.cs
- WebBrowserHelper.cs
- XmlNavigatorFilter.cs
- ClosableStream.cs
- Permission.cs
- DeviceContexts.cs
- MetadataCacheItem.cs
- ControlValuePropertyAttribute.cs
- CTreeGenerator.cs
- SimpleTextLine.cs
- ProfileEventArgs.cs
- WebServiceErrorEvent.cs
- SmiEventStream.cs
- ClusterRegistryConfigurationProvider.cs
- LogicalExpr.cs
- InkPresenter.cs
- ContainerControl.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- DocumentSequence.cs
- CanonicalXml.cs
- CookieParameter.cs
- DecimalAnimationBase.cs
- ToolboxItemSnapLineBehavior.cs
- TemplateParser.cs
- CommittableTransaction.cs
- WebPartDisplayModeCancelEventArgs.cs
- HTMLTextWriter.cs
- DataSvcMapFileSerializer.cs
- ClientOptions.cs
- _PooledStream.cs
- PkcsUtils.cs
- Padding.cs
- XmlSequenceWriter.cs
- Point3D.cs
- Fault.cs
- NoPersistScope.cs
- XmlSchemaObject.cs
- EncodingNLS.cs
- Parameter.cs
- While.cs
- HtmlElementCollection.cs
- TreeView.cs
- ControlCachePolicy.cs
- ObjectKeyFrameCollection.cs
- DocumentGridPage.cs
- UIElementParaClient.cs
- KeyPressEvent.cs
- CultureInfoConverter.cs
- DoubleCollectionConverter.cs
- LineMetrics.cs
- ToolStripContainer.cs
- WeakReadOnlyCollection.cs
- SoapAttributes.cs
- DefaultValueTypeConverter.cs
- DownloadProgressEventArgs.cs
- ProxyDataContractResolver.cs
- SqlUserDefinedTypeAttribute.cs
- ADConnectionHelper.cs
- ApplicationGesture.cs
- DataSourceSelectArguments.cs
- EmulateRecognizeCompletedEventArgs.cs
- XsltContext.cs
- PropertyMap.cs
- GregorianCalendarHelper.cs
- SchemaTableOptionalColumn.cs
- ClrPerspective.cs
- RequestQueue.cs
- ServiceControllerDesigner.cs
- GridViewUpdatedEventArgs.cs
- ZipIOExtraField.cs
- BoundPropertyEntry.cs
- GridViewDeletedEventArgs.cs
- SystemTcpConnection.cs
- SessionStateSection.cs