Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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; ////// /// /// 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
- DictionaryGlobals.cs
- SmtpFailedRecipientsException.cs
- AspCompat.cs
- DataTableReader.cs
- ListViewDataItem.cs
- XmlConvert.cs
- DownloadProgressEventArgs.cs
- pingexception.cs
- ColorMap.cs
- Selection.cs
- LinkedDataMemberFieldEditor.cs
- DataKeyCollection.cs
- TraversalRequest.cs
- DTCTransactionManager.cs
- UrlUtility.cs
- FontUnitConverter.cs
- SerializationStore.cs
- ThumbAutomationPeer.cs
- MethodAccessException.cs
- RightsManagementPermission.cs
- MultiTrigger.cs
- SharedMemory.cs
- QueryContinueDragEvent.cs
- TemplatedMailWebEventProvider.cs
- ArrayListCollectionBase.cs
- CloseCryptoHandleRequest.cs
- PropertyIDSet.cs
- PageCanvasSize.cs
- CachedCompositeFamily.cs
- AspCompat.cs
- ImageCodecInfo.cs
- HelpEvent.cs
- ProfilePropertySettings.cs
- ReleaseInstanceMode.cs
- QilVisitor.cs
- XsdDateTime.cs
- InstanceDataCollection.cs
- StateElementCollection.cs
- KnownTypeDataContractResolver.cs
- FileLevelControlBuilderAttribute.cs
- LinearQuaternionKeyFrame.cs
- XComponentModel.cs
- ErrorItem.cs
- XamlReaderHelper.cs
- HandlerBase.cs
- IconConverter.cs
- SchemaCollectionCompiler.cs
- MetadataFile.cs
- RemotingServices.cs
- Style.cs
- UIPermission.cs
- DataObject.cs
- ByteKeyFrameCollection.cs
- HGlobalSafeHandle.cs
- BindingExpression.cs
- WebPartAddingEventArgs.cs
- BaseResourcesBuildProvider.cs
- ExplicitDiscriminatorMap.cs
- RTLAwareMessageBox.cs
- ResourceDisplayNameAttribute.cs
- RtfControls.cs
- TimeSpanOrInfiniteValidator.cs
- TextMetrics.cs
- ToolboxItemCollection.cs
- SqlUDTStorage.cs
- SiteMapHierarchicalDataSourceView.cs
- InfoCardTrace.cs
- MatcherBuilder.cs
- Splitter.cs
- PropertyStore.cs
- DomainConstraint.cs
- Highlights.cs
- DecimalMinMaxAggregationOperator.cs
- IteratorFilter.cs
- httpstaticobjectscollection.cs
- SystemFonts.cs
- VisualStyleRenderer.cs
- AttributeUsageAttribute.cs
- MenuItemBinding.cs
- TrackingStringDictionary.cs
- IdentityHolder.cs
- Misc.cs
- ScrollItemPatternIdentifiers.cs
- UnsafeNativeMethods.cs
- MD5CryptoServiceProvider.cs
- DynamicDocumentPaginator.cs
- NTAccount.cs
- OverflowException.cs
- KeyGestureConverter.cs
- OutKeywords.cs
- WizardStepBase.cs
- TranslateTransform3D.cs
- HttpWebResponse.cs
- SiteMapPath.cs
- ToolTip.cs
- EventEntry.cs
- SafeNativeMethods.cs
- PackageRelationshipCollection.cs
- MissingFieldException.cs
- Columns.cs