Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / PropertyGridInternal / PropertiesTab.cs / 1305376 / PropertiesTab.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms.PropertyGridInternal {
using System.Runtime.InteropServices;
using System.Diagnostics;
using System;
using System.ComponentModel.Design;
using System.ComponentModel;
using System.Windows.Forms.ComponentModel;
using System.Windows.Forms.Design;
using System.Collections;
using Microsoft.Win32;
///
///
/// [To be supplied.]
///
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name="FullTrust")]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name="FullTrust")]
public class PropertiesTab : PropertyTab {
///
///
/// [To be supplied.]
///
public override string TabName {
get {
return SR.GetString(SR.PBRSToolTipProperties);
}
}
///
///
/// [To be supplied.]
///
public override string HelpKeyword {
get {
return "vs.properties"; // do not localize.
}
}
///
///
/// [To be supplied.]
///
public override PropertyDescriptor GetDefaultProperty(object obj) {
PropertyDescriptor def = base.GetDefaultProperty(obj);
if (def == null) {
PropertyDescriptorCollection props = GetProperties(obj);
if (props != null) {
for (int i = 0; i < props.Count; i++) {
if ("Name".Equals(props[i].Name)) {
def = props[i];
break;
}
}
}
}
return def;
}
///
///
/// [To be supplied.]
///
public override PropertyDescriptorCollection GetProperties(object component, Attribute[] attributes) {
return GetProperties(null, component, attributes);
}
///
///
/// [To be supplied.]
///
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object component, Attribute[] attributes) {
if (attributes == null) {
attributes = new Attribute[]{BrowsableAttribute.Yes};
}
if (context == null) {
return TypeDescriptor.GetProperties(component, attributes);
}
else {
TypeConverter tc = (context.PropertyDescriptor == null ? TypeDescriptor.GetConverter(component) : context.PropertyDescriptor.Converter);
if (tc == null || !tc.GetPropertiesSupported(context)) {
return TypeDescriptor.GetProperties(component, attributes);
}
else {
return tc.GetProperties(context, component, attributes);
}
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms.PropertyGridInternal {
using System.Runtime.InteropServices;
using System.Diagnostics;
using System;
using System.ComponentModel.Design;
using System.ComponentModel;
using System.Windows.Forms.ComponentModel;
using System.Windows.Forms.Design;
using System.Collections;
using Microsoft.Win32;
///
///
/// [To be supplied.]
///
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name="FullTrust")]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name="FullTrust")]
public class PropertiesTab : PropertyTab {
///
///
/// [To be supplied.]
///
public override string TabName {
get {
return SR.GetString(SR.PBRSToolTipProperties);
}
}
///
///
/// [To be supplied.]
///
public override string HelpKeyword {
get {
return "vs.properties"; // do not localize.
}
}
///
///
/// [To be supplied.]
///
public override PropertyDescriptor GetDefaultProperty(object obj) {
PropertyDescriptor def = base.GetDefaultProperty(obj);
if (def == null) {
PropertyDescriptorCollection props = GetProperties(obj);
if (props != null) {
for (int i = 0; i < props.Count; i++) {
if ("Name".Equals(props[i].Name)) {
def = props[i];
break;
}
}
}
}
return def;
}
///
///
/// [To be supplied.]
///
public override PropertyDescriptorCollection GetProperties(object component, Attribute[] attributes) {
return GetProperties(null, component, attributes);
}
///
///
/// [To be supplied.]
///
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object component, Attribute[] attributes) {
if (attributes == null) {
attributes = new Attribute[]{BrowsableAttribute.Yes};
}
if (context == null) {
return TypeDescriptor.GetProperties(component, attributes);
}
else {
TypeConverter tc = (context.PropertyDescriptor == null ? TypeDescriptor.GetConverter(component) : context.PropertyDescriptor.Converter);
if (tc == null || !tc.GetPropertiesSupported(context)) {
return TypeDescriptor.GetProperties(component, attributes);
}
else {
return tc.GetProperties(context, component, attributes);
}
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Model3DGroup.cs
- WindowsListBox.cs
- RootBuilder.cs
- login.cs
- CompilationSection.cs
- WebPartHelpVerb.cs
- DataGridViewLayoutData.cs
- TableLayoutPanel.cs
- StreamAsIStream.cs
- OdbcPermission.cs
- ServerValidateEventArgs.cs
- AppDomain.cs
- XmlDocumentType.cs
- RowCache.cs
- VScrollProperties.cs
- DataControlField.cs
- KeyNotFoundException.cs
- Number.cs
- PanelStyle.cs
- SynthesizerStateChangedEventArgs.cs
- Root.cs
- IndexExpression.cs
- ToolStripItemImageRenderEventArgs.cs
- NonClientArea.cs
- BaseWebProxyFinder.cs
- SourceChangedEventArgs.cs
- BooleanFunctions.cs
- NestPullup.cs
- CommandBinding.cs
- BuildManagerHost.cs
- BufferedReadStream.cs
- ValueTypePropertyReference.cs
- BitmapScalingModeValidation.cs
- WebPartCancelEventArgs.cs
- Mapping.cs
- WindowsRebar.cs
- ObjectViewListener.cs
- QilTernary.cs
- GridViewRow.cs
- DataTablePropertyDescriptor.cs
- FormViewUpdateEventArgs.cs
- ILGenerator.cs
- StandardBindingElementCollection.cs
- FileChangesMonitor.cs
- Column.cs
- SevenBitStream.cs
- ScrollBarAutomationPeer.cs
- TextFindEngine.cs
- InlineObject.cs
- ServiceNameElementCollection.cs
- BindingObserver.cs
- WebPartCatalogCloseVerb.cs
- SerializationException.cs
- EventSourceCreationData.cs
- Dynamic.cs
- Fx.cs
- BuildProvider.cs
- AsyncOperationManager.cs
- InProcStateClientManager.cs
- DataFormats.cs
- RestHandler.cs
- PersonalizationProviderCollection.cs
- XmlSiteMapProvider.cs
- DynamicPhysicalDiscoSearcher.cs
- TransformGroup.cs
- Point4DValueSerializer.cs
- HelpProvider.cs
- StorageInfo.cs
- PixelFormats.cs
- SecUtil.cs
- TextView.cs
- XmlName.cs
- RemotingClientProxy.cs
- OptimizedTemplateContent.cs
- OpCellTreeNode.cs
- SignerInfo.cs
- XXXInfos.cs
- COAUTHINFO.cs
- SymbolTable.cs
- GeneralTransform3DGroup.cs
- TypographyProperties.cs
- HtmlDocument.cs
- PagesSection.cs
- XmlDataSourceDesigner.cs
- Visitors.cs
- XD.cs
- PropVariant.cs
- XmlSchemaDatatype.cs
- ResponseBodyWriter.cs
- DSGeneratorProblem.cs
- CodeAttributeDeclaration.cs
- TagPrefixCollection.cs
- ImageMap.cs
- DataGridViewColumnConverter.cs
- RelationshipEndMember.cs
- ValidatorCompatibilityHelper.cs
- DesignColumnCollection.cs
- BindToObject.cs
- AttributeUsageAttribute.cs
- AesManaged.cs