Code:
/ DotNET / DotNET / 8.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
- PasswordPropertyTextAttribute.cs
- MainMenu.cs
- SrgsDocumentParser.cs
- Speller.cs
- sqlstateclientmanager.cs
- HttpResponseWrapper.cs
- HttpApplicationFactory.cs
- GACIdentityPermission.cs
- WebHttpBinding.cs
- WebResponse.cs
- StorageBasedPackageProperties.cs
- SQLInt64Storage.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- Lookup.cs
- TempFiles.cs
- MouseWheelEventArgs.cs
- Pen.cs
- GridViewColumn.cs
- Deflater.cs
- GridViewCellAutomationPeer.cs
- WebPartVerbsEventArgs.cs
- ObjectHelper.cs
- TemplateField.cs
- SoapServerProtocol.cs
- PeerNodeTraceRecord.cs
- NamedObject.cs
- TextBlockAutomationPeer.cs
- Function.cs
- HelpKeywordAttribute.cs
- ProxyFragment.cs
- SecurityResources.cs
- WizardStepBase.cs
- CodePrimitiveExpression.cs
- InitializationEventAttribute.cs
- TemplateBindingExpression.cs
- sitestring.cs
- DocumentReferenceCollection.cs
- Number.cs
- URLBuilder.cs
- FixUp.cs
- StickyNoteHelper.cs
- _ListenerResponseStream.cs
- ExceptionHandler.cs
- DynamicResourceExtensionConverter.cs
- DynamicDataRouteHandler.cs
- ReflectionHelper.cs
- SamlDelegatingWriter.cs
- BindingGraph.cs
- AssemblyAttributesGoHere.cs
- FixedSOMSemanticBox.cs
- Types.cs
- WebPartUtil.cs
- TransformedBitmap.cs
- XmlSchemaImport.cs
- Point3DCollectionValueSerializer.cs
- EmptyEnumerator.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- GlobalItem.cs
- KeyGestureValueSerializer.cs
- CollectionChangedEventManager.cs
- EncodingStreamWrapper.cs
- IntPtr.cs
- ResourceReferenceKeyNotFoundException.cs
- HtmlInputHidden.cs
- ButtonBaseAutomationPeer.cs
- SoapCommonClasses.cs
- TypeSemantics.cs
- ElasticEase.cs
- ExtenderProvidedPropertyAttribute.cs
- ElementNotAvailableException.cs
- SetStoryboardSpeedRatio.cs
- UnknownWrapper.cs
- SQLGuidStorage.cs
- TreeViewImageGenerator.cs
- PrintDialogException.cs
- PopupControlService.cs
- FileDataSourceCache.cs
- Executor.cs
- XmlSchemaImporter.cs
- TextServicesProperty.cs
- URIFormatException.cs
- MetadataItemCollectionFactory.cs
- shaperfactory.cs
- Type.cs
- ExpressionPrefixAttribute.cs
- PersonalizationProviderHelper.cs
- MobileTextWriter.cs
- SchemaElementLookUpTableEnumerator.cs
- CounterSampleCalculator.cs
- CompositeFontInfo.cs
- FixedSOMElement.cs
- QilInvokeEarlyBound.cs
- AvTraceFormat.cs
- CodeThrowExceptionStatement.cs
- Drawing.cs
- WebPermission.cs
- ServiceDescriptionReflector.cs
- ImageAutomationPeer.cs
- XmlSchemaObject.cs
- SortQuery.cs