Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / ComponentModel / COM2Interop / COM2ExtendedUITypeEditor.cs / 1305376 / 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; ////// /// /// 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; } } ///Provides an editor that provides a way to visually edit the values of a COM2 /// type. ////// /// 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; ////// /// /// 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; } } ///Provides an editor that provides a way to visually edit the values of a COM2 /// type. ////// /// 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
- CellRelation.cs
- BulletedList.cs
- SynchronizingStream.cs
- ZipArchive.cs
- SizeAnimationUsingKeyFrames.cs
- XmlSerializerOperationFormatter.cs
- BookmarkEventArgs.cs
- XappLauncher.cs
- HttpServerProtocol.cs
- TokenizerHelper.cs
- cache.cs
- HttpServerVarsCollection.cs
- _AutoWebProxyScriptEngine.cs
- Config.cs
- FigureParagraph.cs
- RelatedEnd.cs
- SafeFileHandle.cs
- TypeGeneratedEventArgs.cs
- XmlIterators.cs
- DataBindingCollection.cs
- TextEditorTables.cs
- StrongNameKeyPair.cs
- RemotingConfiguration.cs
- DataGridTable.cs
- ObjectItemCollection.cs
- DocumentOrderQuery.cs
- NavigateEvent.cs
- Imaging.cs
- ArrayExtension.cs
- BatchServiceHost.cs
- InvalidProgramException.cs
- ChannelServices.cs
- SoapHeaderAttribute.cs
- UIElementAutomationPeer.cs
- relpropertyhelper.cs
- NameValueCollection.cs
- GlyphRunDrawing.cs
- DescendentsWalkerBase.cs
- ContainerCodeDomSerializer.cs
- safemediahandle.cs
- DispatchWrapper.cs
- SqlProviderUtilities.cs
- basevalidator.cs
- StateBag.cs
- SymbolUsageManager.cs
- ExtensibleClassFactory.cs
- PrimitiveType.cs
- TextFormatter.cs
- SubMenuStyle.cs
- AutomationPeer.cs
- DecodeHelper.cs
- PrintingPermissionAttribute.cs
- Encoder.cs
- OperationCanceledException.cs
- CollectionConverter.cs
- DecoderReplacementFallback.cs
- SharedUtils.cs
- CodeNamespaceImport.cs
- LinqDataView.cs
- ProcessManager.cs
- ValidationHelpers.cs
- HScrollBar.cs
- ObsoleteAttribute.cs
- Point3D.cs
- CharAnimationUsingKeyFrames.cs
- AssemblyAttributesGoHere.cs
- UnhandledExceptionEventArgs.cs
- ExpressionPrefixAttribute.cs
- LocalFileSettingsProvider.cs
- GridViewActionList.cs
- RepeatButton.cs
- ForceCopyBuildProvider.cs
- WindowsGraphics2.cs
- WebPartExportVerb.cs
- AdapterSwitches.cs
- UnicodeEncoding.cs
- DbConnectionClosed.cs
- Fault.cs
- ScriptControl.cs
- SupportingTokenBindingElement.cs
- SaveFileDialog.cs
- ProfilePropertySettingsCollection.cs
- DbDataAdapter.cs
- InstanceDataCollection.cs
- CaseInsensitiveComparer.cs
- FileAuthorizationModule.cs
- HashMembershipCondition.cs
- XPathNodeHelper.cs
- LinqDataSource.cs
- Rijndael.cs
- SimpleRecyclingCache.cs
- GlyphRun.cs
- Switch.cs
- AccessorTable.cs
- RegexCompilationInfo.cs
- SqlRowUpdatedEvent.cs
- _AutoWebProxyScriptWrapper.cs
- DataGridViewRowsAddedEventArgs.cs
- VersionPair.cs
- MailMessage.cs