Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / PropertyGridInternal / ArrayElementGridEntry.cs / 1 / ArrayElementGridEntry.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Windows.Forms.PropertyGridInternal { using System.Diagnostics; using System; using System.Collections; using System.Reflection; using System.ComponentModel; using System.ComponentModel.Design; using System.Windows.Forms; using System.Drawing; using Microsoft.Win32; using System.Globalization; internal class ArrayElementGridEntry : GridEntry { protected int index; public ArrayElementGridEntry(PropertyGrid ownerGrid, GridEntry peParent, int index) : base(ownerGrid, peParent) { this.index = index; this.SetFlag(FLAG_RENDER_READONLY, (peParent.Flags & FLAG_RENDER_READONLY) != 0 || peParent.ForceReadOnly); } public override GridItemType GridItemType { get { return GridItemType.ArrayValue; } } public override bool IsValueEditable { get{ return ParentGridEntry.IsValueEditable; } } public override string PropertyLabel { get { return "[" + index.ToString(CultureInfo.CurrentCulture) + "]"; } } public override Type PropertyType { get { return parentPE.PropertyType.GetElementType(); } } public override object PropertyValue { get { object owner = GetValueOwner(); Debug.Assert(owner is Array, "Owner is not array type!"); return((Array)owner).GetValue(index); } set { object owner = GetValueOwner(); Debug.Assert(owner is Array, "Owner is not array type!"); ((Array)owner).SetValue(value,index); } } public override bool ShouldRenderReadOnly { get { return ParentGridEntry.ShouldRenderReadOnly; } } /* ////// Checks if the value of the current item can be modified by the user. /// ////// True if the value can be modified /// public override bool CanSetPropertyValue() { return this.ParentGridEntry.CanSetPropertyValue(); } */ /* ////// Returns if it's an editable item. An example of a readonly /// editable item is a collection property -- the property itself /// can not be modified, but it's value (e.g. it's children) can, so /// we don't want to draw it as readonly. /// ////// True if the value associated with this property (e.g. it's children) can be modified even if it's readonly. /// public override bool CanSetReadOnlyPropertyValue() { return this.ParentGridEntry.CanSetReadOnlyPropertyValue(); }*/ } } // 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
- SplayTreeNode.cs
- _LocalDataStore.cs
- DbDataReader.cs
- InterleavedZipPartStream.cs
- ClientCultureInfo.cs
- DataGridCommandEventArgs.cs
- RegexRunnerFactory.cs
- NativeMethods.cs
- XmlSchemaDatatype.cs
- DocumentSequenceHighlightLayer.cs
- RuleValidation.cs
- WriteStateInfoBase.cs
- HttpResponse.cs
- MimeBasePart.cs
- HWStack.cs
- ListSourceHelper.cs
- HttpSysSettings.cs
- RuleValidation.cs
- ScriptingJsonSerializationSection.cs
- Page.cs
- WindowsPen.cs
- DispatcherExceptionFilterEventArgs.cs
- Set.cs
- RoutedEvent.cs
- XmlWrappingWriter.cs
- RuleAction.cs
- DashStyles.cs
- SymmetricCryptoHandle.cs
- MenuStrip.cs
- ClickablePoint.cs
- Model3D.cs
- PageVisual.cs
- ProcessHost.cs
- RC2CryptoServiceProvider.cs
- SupportingTokenListenerFactory.cs
- XmlDataSourceDesigner.cs
- RSAPKCS1SignatureFormatter.cs
- XDeferredAxisSource.cs
- Semaphore.cs
- Viewport3DAutomationPeer.cs
- ByteAnimation.cs
- Message.cs
- WindowsFormsSynchronizationContext.cs
- ColumnHeaderCollectionEditor.cs
- FontCacheUtil.cs
- cookiecollection.cs
- SystemWebSectionGroup.cs
- ClientApiGenerator.cs
- Column.cs
- CompilerLocalReference.cs
- ChildTable.cs
- WebPartsPersonalizationAuthorization.cs
- BorderSidesEditor.cs
- BroadcastEventHelper.cs
- GACMembershipCondition.cs
- ClientSponsor.cs
- ToolStripRenderEventArgs.cs
- Matrix.cs
- XmlSerializerVersionAttribute.cs
- CaseStatement.cs
- TemplateNameScope.cs
- CfgSemanticTag.cs
- InheritanceContextHelper.cs
- HealthMonitoringSectionHelper.cs
- ContentOnlyMessage.cs
- DynamicILGenerator.cs
- SourceFileBuildProvider.cs
- ItemDragEvent.cs
- TokenizerHelper.cs
- TextPenaltyModule.cs
- SolidBrush.cs
- WebPartCancelEventArgs.cs
- wgx_render.cs
- Selection.cs
- ConfigurationValue.cs
- ContainerControl.cs
- TypeCollectionDesigner.xaml.cs
- MarkerProperties.cs
- MenuEventArgs.cs
- PeerUnsafeNativeMethods.cs
- ApplicationCommands.cs
- FilteredDataSetHelper.cs
- ActivatableWorkflowsQueryResult.cs
- DateTimeSerializationSection.cs
- SQLString.cs
- OptionUsage.cs
- Encoder.cs
- XmlUtf8RawTextWriter.cs
- ToolBar.cs
- AnnotationAuthorChangedEventArgs.cs
- CachedPathData.cs
- EntityParameterCollection.cs
- ClonableStack.cs
- CompensationParticipant.cs
- DataSourceCache.cs
- RegexGroupCollection.cs
- XPathBinder.cs
- CopyNamespacesAction.cs
- TimeSpanStorage.cs
- HttpCachePolicyElement.cs