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
- DefaultBindingPropertyAttribute.cs
- AttachedPropertiesService.cs
- HtmlString.cs
- ColumnMapCopier.cs
- DesignerLoader.cs
- SoapAttributeOverrides.cs
- DirectoryLocalQuery.cs
- QuotedPairReader.cs
- RegexTree.cs
- CompressionTransform.cs
- HttpClientCredentialType.cs
- UnsafeNativeMethods.cs
- QilGenerator.cs
- DbDataAdapter.cs
- SecurityProtocolFactory.cs
- SystemColorTracker.cs
- RIPEMD160.cs
- OdbcCommand.cs
- mansign.cs
- WebUtil.cs
- EnlistmentTraceIdentifier.cs
- CurrencyWrapper.cs
- Vector3D.cs
- GcHandle.cs
- OLEDB_Util.cs
- InvalidProgramException.cs
- EncoderParameter.cs
- SqlClientPermission.cs
- TogglePatternIdentifiers.cs
- ColumnWidthChangingEvent.cs
- InternalCache.cs
- ApplicationActivator.cs
- HtmlLinkAdapter.cs
- FilteredReadOnlyMetadataCollection.cs
- OdbcConnectionPoolProviderInfo.cs
- BitSet.cs
- FontDriver.cs
- WebDisplayNameAttribute.cs
- AppDomainProtocolHandler.cs
- CodeTypeMemberCollection.cs
- Filter.cs
- X509CertificateStore.cs
- ZoneMembershipCondition.cs
- QueryAsyncResult.cs
- WinFormsComponentEditor.cs
- DataGridHeadersVisibilityToVisibilityConverter.cs
- LoaderAllocator.cs
- FontStretches.cs
- TransformValueSerializer.cs
- PassportAuthenticationModule.cs
- SecurityTokenResolver.cs
- WindowPattern.cs
- DBSchemaRow.cs
- RtType.cs
- initElementDictionary.cs
- SpellerHighlightLayer.cs
- ValidationErrorInfo.cs
- DbExpressionRules.cs
- Evidence.cs
- PeerUnsafeNativeCryptMethods.cs
- SnapLine.cs
- ReflectionUtil.cs
- LineServicesCallbacks.cs
- IISMapPath.cs
- OdbcPermission.cs
- DefaultValueConverter.cs
- TextStore.cs
- ProfilePropertyNameValidator.cs
- HashHelper.cs
- SecurityTokenRequirement.cs
- _BasicClient.cs
- ControlPropertyNameConverter.cs
- StsCommunicationException.cs
- HorizontalAlignConverter.cs
- CheckBox.cs
- DiscoveryDocumentReference.cs
- DataBoundControlDesigner.cs
- TextContainerHelper.cs
- KoreanLunisolarCalendar.cs
- WebZone.cs
- SchemaLookupTable.cs
- HostedTcpTransportManager.cs
- NotImplementedException.cs
- AddressHeader.cs
- FormViewRow.cs
- InputLanguage.cs
- InvalidEnumArgumentException.cs
- RuleSetDialog.Designer.cs
- GeneralTransform3DTo2D.cs
- PageCatalogPartDesigner.cs
- CollectionChangeEventArgs.cs
- DateTimeFormat.cs
- Win32Exception.cs
- RemotingConfiguration.cs
- PhysicalFontFamily.cs
- KnownTypes.cs
- ManipulationPivot.cs
- TextDpi.cs
- WeakReferenceEnumerator.cs
- DataGridViewCellCollection.cs