Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / WinForms / Managed / System / WinForms / GridItem.cs / 1 / GridItem.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms {
using System.Diagnostics;
using System;
using System.IO;
using System.Collections;
using System.Globalization;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms.Design;
using System.Windows.Forms.ComponentModel.Com2Interop;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Windows.Forms.PropertyGridInternal;
using System.Reflection;
using System.Runtime.InteropServices;
using Microsoft.Win32;
///
///
/// Representaion of one row item in the PropertyGrid. These items represent the
/// hierarchy of the grid's "tree-like" view and can be used to get information about
/// the grid's state and contents.
/// These objects should not be cached because they represent a snapshot of the PropertyGrid's state
/// and may be disposed by grid activity. The PropertyGrid often recretates these objects internally even if
/// it doesn't appear to change to the user.
///
public abstract class GridItem {
private object userData;
///
[
SRCategory(SR.CatData),
Localizable(false),
Bindable(true),
SRDescription(SR.ControlTagDescr),
DefaultValue(null),
TypeConverter(typeof(StringConverter)),
]
public object Tag {
get {
return userData;
}
set {
userData = value;
}
}
///
///
/// Retrieves the child GridItems, if any, of this GridItem
///
public abstract GridItemCollection GridItems {
get;
}
///
///
/// Retrieves type of this GridItem, as a value from System.Windows.Forms.GridItemType
///
public abstract GridItemType GridItemType {
get;
}
///
///
/// Retrieves the text label of this GridItem. This may be different from the actual PropertyName.
/// For GridItemType.Property GridItems, retrieve the PropertyDescriptor and check its Name property.
///
public abstract string Label {
get;
}
///
///
/// Retrieves parent GridItem of this GridItem, if any
///
public abstract GridItem Parent {
get;
}
///
///
/// If this item is a GridItemType.Property GridItem, this retreives the System.ComponentModel.PropertyDescriptor that is
/// associated with this GridItem. This can be used to retrieve infomration such as property Type, Name, or TypeConverter.
///
public abstract PropertyDescriptor PropertyDescriptor {
get;
}
///
///
/// Retrieves the current Value of this grid Item. This may be null.
///
public abstract object Value {
get;
// note: we don't do set because of the value class semantics, etc.
}
///
///
/// Retreives whether the given property is expandable.
///
public virtual bool Expandable {
get {
return false;
}
}
///
///
/// Retreives or sets whether the GridItem is in an expanded state.
///
public virtual bool Expanded {
get {
return false;
}
set {
throw new NotSupportedException(SR.GetString(SR.GridItemNotExpandable));
}
}
///
///
/// Attempts to select this GridItem in the PropertyGrid.
///
public abstract bool Select();
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms {
using System.Diagnostics;
using System;
using System.IO;
using System.Collections;
using System.Globalization;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms.Design;
using System.Windows.Forms.ComponentModel.Com2Interop;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Windows.Forms.PropertyGridInternal;
using System.Reflection;
using System.Runtime.InteropServices;
using Microsoft.Win32;
///
///
/// Representaion of one row item in the PropertyGrid. These items represent the
/// hierarchy of the grid's "tree-like" view and can be used to get information about
/// the grid's state and contents.
/// These objects should not be cached because they represent a snapshot of the PropertyGrid's state
/// and may be disposed by grid activity. The PropertyGrid often recretates these objects internally even if
/// it doesn't appear to change to the user.
///
public abstract class GridItem {
private object userData;
///
[
SRCategory(SR.CatData),
Localizable(false),
Bindable(true),
SRDescription(SR.ControlTagDescr),
DefaultValue(null),
TypeConverter(typeof(StringConverter)),
]
public object Tag {
get {
return userData;
}
set {
userData = value;
}
}
///
///
/// Retrieves the child GridItems, if any, of this GridItem
///
public abstract GridItemCollection GridItems {
get;
}
///
///
/// Retrieves type of this GridItem, as a value from System.Windows.Forms.GridItemType
///
public abstract GridItemType GridItemType {
get;
}
///
///
/// Retrieves the text label of this GridItem. This may be different from the actual PropertyName.
/// For GridItemType.Property GridItems, retrieve the PropertyDescriptor and check its Name property.
///
public abstract string Label {
get;
}
///
///
/// Retrieves parent GridItem of this GridItem, if any
///
public abstract GridItem Parent {
get;
}
///
///
/// If this item is a GridItemType.Property GridItem, this retreives the System.ComponentModel.PropertyDescriptor that is
/// associated with this GridItem. This can be used to retrieve infomration such as property Type, Name, or TypeConverter.
///
public abstract PropertyDescriptor PropertyDescriptor {
get;
}
///
///
/// Retrieves the current Value of this grid Item. This may be null.
///
public abstract object Value {
get;
// note: we don't do set because of the value class semantics, etc.
}
///
///
/// Retreives whether the given property is expandable.
///
public virtual bool Expandable {
get {
return false;
}
}
///
///
/// Retreives or sets whether the GridItem is in an expanded state.
///
public virtual bool Expanded {
get {
return false;
}
set {
throw new NotSupportedException(SR.GetString(SR.GridItemNotExpandable));
}
}
///
///
/// Attempts to select this GridItem in the PropertyGrid.
///
public abstract bool Select();
}
}
// 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
- InvokeMethodActivity.cs
- ProviderSettingsCollection.cs
- GridViewUpdatedEventArgs.cs
- SaveFileDialog.cs
- SchemaNamespaceManager.cs
- RemoteWebConfigurationHost.cs
- ParallelTimeline.cs
- SystemPens.cs
- SecurityTokenTypes.cs
- JsonXmlDataContract.cs
- InternalControlCollection.cs
- ActionMismatchAddressingException.cs
- XPathDocumentIterator.cs
- AnimatedTypeHelpers.cs
- SqlVersion.cs
- PackagingUtilities.cs
- DataViewManager.cs
- RbTree.cs
- ThrowHelper.cs
- TimeSpanParse.cs
- _ConnectStream.cs
- XmlAttributes.cs
- DLinqTableProvider.cs
- ParagraphResult.cs
- PageBorderless.cs
- SymbolPair.cs
- RangeValuePattern.cs
- TransformGroup.cs
- ObjectReaderCompiler.cs
- DataTemplateSelector.cs
- CompiledQueryCacheEntry.cs
- CodePageEncoding.cs
- FilteredReadOnlyMetadataCollection.cs
- AutomationProperties.cs
- EntityStoreSchemaGenerator.cs
- LineServicesRun.cs
- TextDataBindingHandler.cs
- GridViewRowPresenterBase.cs
- FontDifferentiator.cs
- ConnectionString.cs
- RawStylusActions.cs
- HeaderCollection.cs
- SecurityTokenException.cs
- NativeActivityAbortContext.cs
- XmlTextEncoder.cs
- SQLBytes.cs
- ValueUnavailableException.cs
- IgnoreFileBuildProvider.cs
- WebControlParameterProxy.cs
- MetadataSerializer.cs
- CanonicalXml.cs
- SymLanguageVendor.cs
- StylusDevice.cs
- WsatConfiguration.cs
- SizeAnimationClockResource.cs
- Nullable.cs
- UrlParameterWriter.cs
- SQLInt64.cs
- UpdateTracker.cs
- ListControl.cs
- HttpModuleActionCollection.cs
- DbProviderServices.cs
- HashCodeCombiner.cs
- ClrProviderManifest.cs
- DataGridRowHeader.cs
- NetCodeGroup.cs
- Baml2006ReaderContext.cs
- KernelTypeValidation.cs
- OutputScopeManager.cs
- SocketException.cs
- SmtpNtlmAuthenticationModule.cs
- MostlySingletonList.cs
- ActivationServices.cs
- IResourceProvider.cs
- AddInProcess.cs
- Converter.cs
- VScrollProperties.cs
- WindowsSlider.cs
- InteropEnvironment.cs
- UniqueEventHelper.cs
- Delay.cs
- mda.cs
- Socket.cs
- FormViewRow.cs
- PasswordBox.cs
- WebPartMinimizeVerb.cs
- TextView.cs
- WinCategoryAttribute.cs
- CssClassPropertyAttribute.cs
- Schema.cs
- StateMachineWorkflowInstance.cs
- ChangeInterceptorAttribute.cs
- PostBackTrigger.cs
- MarkupWriter.cs
- DomainUpDown.cs
- _ListenerRequestStream.cs
- LocalizableAttribute.cs
- DataGridTextColumn.cs
- GridViewCommandEventArgs.cs
- FileNotFoundException.cs