Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / tabpagecollectioneditor.cs / 1 / tabpagecollectioneditor.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="System.Windows.Forms.Design.TabPageCollectionEditor..ctor()")]
namespace System.Windows.Forms.Design {
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Windows.Forms;
using System.Data;
using System.Drawing.Design;
using System.Diagnostics;
using System.Design;
using System.Windows.Forms.Layout;
///
/// Main class for collection editor for TabPageCollection. Allows a single level of ToolStripItem children to be designed.
///
internal class TabPageCollectionEditor : CollectionEditor
{
///
/// Default contstructor.
///
public TabPageCollectionEditor() : base(typeof(TabControl.TabPageCollection)) {
}
///
///
///
/// Sets
/// the specified collection to have the specified array of items.
///
///
protected override object SetItems(object editValue, object[] value) {
TabControl tc = this.Context.Instance as TabControl;
if (tc != null) {
tc.SuspendLayout();
}
// Set the UseVisualStyleBackColor for all the tabPages added through the collectionEditor.
foreach (object tab in value)
{
TabPage page = tab as TabPage;
if (page != null)
{
PropertyDescriptor styleProp = TypeDescriptor.GetProperties(page)["UseVisualStyleBackColor"];
if (styleProp != null && styleProp.PropertyType == typeof(bool) && !styleProp.IsReadOnly && styleProp.IsBrowsable)
{
styleProp.SetValue(page, true);
}
}
}
object retValue = base.SetItems(editValue, value);
if (tc != null) {
tc.ResumeLayout();
}
return retValue;
}
}
}
// 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
- TrackingStringDictionary.cs
- CSharpCodeProvider.cs
- ResourceWriter.cs
- ConsumerConnectionPoint.cs
- HttpChannelBindingToken.cs
- XmlSchemaIdentityConstraint.cs
- UpdateManifestForBrowserApplication.cs
- TableNameAttribute.cs
- CultureInfo.cs
- InkCanvasAutomationPeer.cs
- HashCodeCombiner.cs
- XmlSchemaComplexContentRestriction.cs
- ValidatingReaderNodeData.cs
- ConversionContext.cs
- ListChangedEventArgs.cs
- CodeStatement.cs
- GenericUriParser.cs
- ContainerAction.cs
- SizeChangedEventArgs.cs
- String.cs
- CompilerScopeManager.cs
- ProfilePropertyNameValidator.cs
- WebPartRestoreVerb.cs
- DbProviderServices.cs
- Tag.cs
- PropertyInformation.cs
- LicenseContext.cs
- Transform.cs
- TargetConverter.cs
- HttpCapabilitiesEvaluator.cs
- BaseTemplateParser.cs
- PermissionListSet.cs
- PipelineDeploymentState.cs
- FileBasedResourceGroveler.cs
- NegotiateStream.cs
- FixedTextPointer.cs
- Bidi.cs
- rsa.cs
- ServiceDiscoveryBehavior.cs
- PropertyDescriptorCollection.cs
- AsymmetricSignatureFormatter.cs
- TableLayoutSettingsTypeConverter.cs
- ObservableDictionary.cs
- HandlerMappingMemo.cs
- ConnectionInterfaceCollection.cs
- PropertyGridView.cs
- SolidBrush.cs
- DecimalStorage.cs
- BufferedReadStream.cs
- HtmlObjectListAdapter.cs
- XslTransformFileEditor.cs
- columnmapkeybuilder.cs
- WindowsUpDown.cs
- DataGridCommandEventArgs.cs
- System.Data.OracleClient_BID.cs
- FlowLayoutPanel.cs
- DesignerObject.cs
- RangeBaseAutomationPeer.cs
- OleDbConnectionFactory.cs
- NameObjectCollectionBase.cs
- Mouse.cs
- ContextMarshalException.cs
- HuffmanTree.cs
- WebPartConnectionsCloseVerb.cs
- CreateUserWizard.cs
- DataColumnPropertyDescriptor.cs
- BitmapEffect.cs
- CultureInfoConverter.cs
- SweepDirectionValidation.cs
- DataSourceSelectArguments.cs
- ToolStripEditorManager.cs
- TaskHelper.cs
- UnsignedPublishLicense.cs
- SoundPlayer.cs
- CheckBox.cs
- Ops.cs
- TableChangeProcessor.cs
- MimeTextImporter.cs
- DispatcherOperation.cs
- Helpers.cs
- CqlErrorHelper.cs
- ListControl.cs
- FormParameter.cs
- XmlSecureResolver.cs
- XamlToRtfParser.cs
- WebPartManager.cs
- AuthenticationModulesSection.cs
- BindingCompleteEventArgs.cs
- SqlVersion.cs
- _PooledStream.cs
- MetadataPropertyvalue.cs
- CustomSignedXml.cs
- QueryContinueDragEvent.cs
- OracleString.cs
- ValidationManager.cs
- RoamingStoreFile.cs
- _SafeNetHandles.cs
- XmlReflectionImporter.cs
- SmiSettersStream.cs
- StrongNameKeyPair.cs