Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / WinForms / Managed / System / WinForms / ComponentModel / COM2Interop / COM2ExtendedUITypeEditor.cs / 1 / COM2ExtendedUITypeEditor.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="System.Drawing.Design.Com2ExtendedUITypeEditor..ctor(System.Type)")]
/*
*/
namespace System.Drawing.Design {
using System.Diagnostics;
using System.Collections;
using Microsoft.Win32;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Drawing.Design;
///
///
///
/// Provides an editor that provides a way to visually edit the values of a COM2
/// type.
///
internal class Com2ExtendedUITypeEditor : UITypeEditor {
private UITypeEditor innerEditor;
public Com2ExtendedUITypeEditor(UITypeEditor baseTypeEditor) {
this.innerEditor = baseTypeEditor;
}
public Com2ExtendedUITypeEditor(Type baseType) {
this.innerEditor = (UITypeEditor)TypeDescriptor.GetEditor(baseType, typeof(UITypeEditor));
}
public UITypeEditor InnerEditor {
get {
return innerEditor;
}
}
///
///
/// Edits the given object value using the editor style provided by
/// GetEditorStyle. A service provider is provided so that any
/// required editing services can be obtained.
///
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) {
if (innerEditor != null) {
return innerEditor.EditValue(context, provider, value);
}
else {
return base.EditValue(context, provider, value);
}
}
///
///
/// Determines if this editor supports the painting of a representation
/// of an object's value.
///
public override bool GetPaintValueSupported(ITypeDescriptorContext context) {
if (innerEditor != null) {
return innerEditor.GetPaintValueSupported(context);
}
return base.GetPaintValueSupported(context);
}
///
///
/// Retrieves the editing style of the Edit method. If the method
/// is not supported, this will return None.
///
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) {
if (innerEditor != null) {
return innerEditor.GetEditStyle(context);
}
return base.GetEditStyle(context);
}
///
///
/// Paints a representative value of the given object to the provided
/// canvas. Painting should be done within the boundaries of the
/// provided rectangle.
///
public override void PaintValue(PaintValueEventArgs e) {
if (innerEditor != null) {
innerEditor.PaintValue(e);
}
base.PaintValue(e);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="System.Drawing.Design.Com2ExtendedUITypeEditor..ctor(System.Type)")]
/*
*/
namespace System.Drawing.Design {
using System.Diagnostics;
using System.Collections;
using Microsoft.Win32;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Drawing.Design;
///
///
///
/// Provides an editor that provides a way to visually edit the values of a COM2
/// type.
///
internal class Com2ExtendedUITypeEditor : UITypeEditor {
private UITypeEditor innerEditor;
public Com2ExtendedUITypeEditor(UITypeEditor baseTypeEditor) {
this.innerEditor = baseTypeEditor;
}
public Com2ExtendedUITypeEditor(Type baseType) {
this.innerEditor = (UITypeEditor)TypeDescriptor.GetEditor(baseType, typeof(UITypeEditor));
}
public UITypeEditor InnerEditor {
get {
return innerEditor;
}
}
///
///
/// Edits the given object value using the editor style provided by
/// GetEditorStyle. A service provider is provided so that any
/// required editing services can be obtained.
///
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) {
if (innerEditor != null) {
return innerEditor.EditValue(context, provider, value);
}
else {
return base.EditValue(context, provider, value);
}
}
///
///
/// Determines if this editor supports the painting of a representation
/// of an object's value.
///
public override bool GetPaintValueSupported(ITypeDescriptorContext context) {
if (innerEditor != null) {
return innerEditor.GetPaintValueSupported(context);
}
return base.GetPaintValueSupported(context);
}
///
///
/// Retrieves the editing style of the Edit method. If the method
/// is not supported, this will return None.
///
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) {
if (innerEditor != null) {
return innerEditor.GetEditStyle(context);
}
return base.GetEditStyle(context);
}
///
///
/// Paints a representative value of the given object to the provided
/// canvas. Painting should be done within the boundaries of the
/// provided rectangle.
///
public override void PaintValue(PaintValueEventArgs e) {
if (innerEditor != null) {
innerEditor.PaintValue(e);
}
base.PaintValue(e);
}
}
}
// 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
- XmlILConstructAnalyzer.cs
- prefixendpointaddressmessagefiltertable.cs
- HttpHandlerAction.cs
- CustomDictionarySources.cs
- MetadataItem_Static.cs
- GeneralTransform3DGroup.cs
- RecognizerInfo.cs
- ListViewSelectEventArgs.cs
- GacUtil.cs
- SqlCharStream.cs
- TdsParserStaticMethods.cs
- Timer.cs
- LogAppendAsyncResult.cs
- ContentPosition.cs
- SignatureResourcePool.cs
- PerfCounterSection.cs
- IList.cs
- AnnotationAuthorChangedEventArgs.cs
- Point.cs
- DocumentApplicationJournalEntry.cs
- DBCommandBuilder.cs
- JumpTask.cs
- ContainerParaClient.cs
- OdbcConnectionOpen.cs
- XPathScanner.cs
- CompilationUtil.cs
- WithStatement.cs
- ConnectionManagementElementCollection.cs
- LoginViewDesigner.cs
- RandomNumberGenerator.cs
- COM2IPerPropertyBrowsingHandler.cs
- DrawingAttributesDefaultValueFactory.cs
- XmlSchemaSimpleTypeUnion.cs
- SeparatorAutomationPeer.cs
- FormParameter.cs
- DataGridGeneralPage.cs
- DeflateEmulationStream.cs
- EdmError.cs
- TPLETWProvider.cs
- NavigationEventArgs.cs
- ColumnResizeUndoUnit.cs
- SafeLibraryHandle.cs
- RegexCaptureCollection.cs
- ArgumentException.cs
- ToolStripComboBox.cs
- GlobalProxySelection.cs
- ByteStorage.cs
- GroupItemAutomationPeer.cs
- basevalidator.cs
- HostSecurityManager.cs
- GeometryCollection.cs
- EventManager.cs
- SQLDateTime.cs
- SmiSettersStream.cs
- SequentialActivityDesigner.cs
- MediaTimeline.cs
- ScaleTransform3D.cs
- MachineKeySection.cs
- Predicate.cs
- SoapObjectInfo.cs
- XmlAutoDetectWriter.cs
- GetParentChain.cs
- UnknownBitmapEncoder.cs
- TokenBasedSetEnumerator.cs
- EntityTypeEmitter.cs
- ComAdminInterfaces.cs
- OletxCommittableTransaction.cs
- DataGridViewColumnConverter.cs
- EventItfInfo.cs
- ProxyWebPart.cs
- X509Utils.cs
- SqlStream.cs
- ListViewDesigner.cs
- WebControlAdapter.cs
- ProviderMetadataCachedInformation.cs
- TextRangeBase.cs
- ExpandableObjectConverter.cs
- PropertyTabChangedEvent.cs
- UndirectedGraph.cs
- AddInDeploymentState.cs
- DbDataAdapter.cs
- ClosableStream.cs
- TableParaClient.cs
- Memoizer.cs
- Merger.cs
- ListCollectionView.cs
- DbException.cs
- TextModifier.cs
- CompositeControl.cs
- SQLBytesStorage.cs
- NotSupportedException.cs
- StringSorter.cs
- DbConnectionPoolOptions.cs
- ItemAutomationPeer.cs
- SqlBooleanMismatchVisitor.cs
- SqlTypesSchemaImporter.cs
- FormsIdentity.cs
- XmlSerializableReader.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- SqlRecordBuffer.cs