Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / MaskedTextBoxTextEditor.cs / 1 / MaskedTextBoxTextEditor.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Windows.Forms; using System.Windows.Forms.Design; using System.Drawing.Design; using System.Diagnostics; [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="System.Windows.Forms.Design.MaskedTextBoxTextEditor..ctor()")] namespace System.Windows.Forms.Design { class MaskedTextBoxTextEditor : UITypeEditor { public MaskedTextBoxTextEditor() { } public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService editorSvc = null; if (context != null && context.Instance != null && provider != null) { editorSvc = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService; if (editorSvc != null && context.Instance != null) { MaskedTextBox mtb = context.Instance as MaskedTextBox; // If multiple instances selected, mtb will be null. if( mtb == null ) { mtb = new MaskedTextBox(); mtb.Text = value as string; } MaskedTextBoxTextEditorDropDown dropDown = new MaskedTextBoxTextEditorDropDown(mtb); editorSvc.DropDownControl(dropDown); if (dropDown.Value != null) { value = dropDown.Value; } } } return value; } public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) { if (context != null && context.Instance != null) { return UITypeEditorEditStyle.DropDown; } return base.GetEditStyle(context); } public override bool GetPaintValueSupported(ITypeDescriptorContext context) { if (context != null && context.Instance != null) { return false; } return base.GetPaintValueSupported(context); } public override bool IsDropDownResizable { get { return false; } } } } // 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
- HtmlInputReset.cs
- InternalBufferOverflowException.cs
- SamlAttribute.cs
- _BufferOffsetSize.cs
- Stroke.cs
- GradientBrush.cs
- Matrix.cs
- DataGridViewColumnHeaderCell.cs
- ConnectionStringSettings.cs
- SoapIgnoreAttribute.cs
- PathHelper.cs
- WebHostedComPlusServiceHost.cs
- TypeHelpers.cs
- filewebrequest.cs
- AuthenticatedStream.cs
- SkinBuilder.cs
- SerializationEventsCache.cs
- MetafileHeader.cs
- SelectiveScrollingGrid.cs
- DbProviderFactoriesConfigurationHandler.cs
- QilBinary.cs
- ObjectQueryExecutionPlan.cs
- FixedElement.cs
- CngProvider.cs
- FormView.cs
- CodeDomConfigurationHandler.cs
- SimpleHandlerBuildProvider.cs
- BaseAppDomainProtocolHandler.cs
- ObjectStorage.cs
- DispatcherOperation.cs
- TextFormatter.cs
- StylusCaptureWithinProperty.cs
- SmtpDigestAuthenticationModule.cs
- ProfileGroupSettings.cs
- SpellerStatusTable.cs
- MarginCollapsingState.cs
- ResolveNameEventArgs.cs
- ServiceNotStartedException.cs
- ResourceReferenceKeyNotFoundException.cs
- ResourceManager.cs
- RegistryPermission.cs
- MessageSecurityVersion.cs
- ScrollProviderWrapper.cs
- SerializeAbsoluteContext.cs
- DesignerDataTableBase.cs
- FacetDescription.cs
- TraceHandler.cs
- ISFTagAndGuidCache.cs
- ProviderUtil.cs
- MouseGestureConverter.cs
- DoWorkEventArgs.cs
- DynamicObjectAccessor.cs
- Symbol.cs
- ISSmlParser.cs
- SchemaNamespaceManager.cs
- CodeThrowExceptionStatement.cs
- XmlDeclaration.cs
- RelationshipConverter.cs
- DataGridViewHeaderCell.cs
- ObjectSpanRewriter.cs
- FixedTextView.cs
- MatchAttribute.cs
- PropertyToken.cs
- X509Utils.cs
- OrderPreservingPipeliningMergeHelper.cs
- shaperfactory.cs
- MyContact.cs
- Executor.cs
- OutputScope.cs
- EntitySetBaseCollection.cs
- TTSVoice.cs
- StringInfo.cs
- CompositeScriptReference.cs
- SAPICategories.cs
- KeyValueSerializer.cs
- IPAddress.cs
- HttpInputStream.cs
- ExtenderProviderService.cs
- Timer.cs
- webproxy.cs
- FacetChecker.cs
- WindowsListViewGroup.cs
- PanelDesigner.cs
- InvalidCastException.cs
- DiscriminatorMap.cs
- PngBitmapDecoder.cs
- Point3DCollection.cs
- HttpListener.cs
- XPathParser.cs
- XmlArrayAttribute.cs
- NamespaceList.cs
- HtmlTableCellCollection.cs
- CategoryEditor.cs
- ISAPIWorkerRequest.cs
- messageonlyhwndwrapper.cs
- LayoutSettings.cs
- PartManifestEntry.cs
- SmuggledIUnknown.cs
- CookieProtection.cs
- BitmapImage.cs