Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / MaskedTextBoxDesignerActionList.cs / 1 / MaskedTextBoxDesignerActionList.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms.Design { using System; using System.Design; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Windows.Forms; using System.Diagnostics; ////// Describes the list of actions that can be performed in the MaskedTextBox control from the /// Chrome pannel. /// internal class MaskedTextBoxDesignerActionList : System.ComponentModel.Design.DesignerActionList { MaskedTextBox maskedTextBox; ITypeDiscoveryService discoverySvc; IUIService uiSvc; IHelpService helpService = null; ////// Constructor receiving a MaskedTextBox control the action list applies to. The ITypeDiscoveryService /// service provider is used to populate the canned mask list control in the MaskDesignerDialog dialog and /// the IUIService provider is used to display the MaskDesignerDialog within VS. /// public MaskedTextBoxDesignerActionList(MaskedTextBoxDesigner designer) : base(designer.Component) { this.maskedTextBox = (MaskedTextBox)designer.Component; this.discoverySvc = GetService(typeof(ITypeDiscoveryService)) as ITypeDiscoveryService; this.uiSvc = GetService(typeof(IUIService)) as IUIService; this.helpService = GetService(typeof(IHelpService)) as IHelpService; if (discoverySvc == null || uiSvc == null) { Debug.Fail("could not get either ITypeDiscoveryService or IUIService"); } } ////// Pops up the Mask design dialog for the user to set the control's mask. /// public void SetMask() { string mask = MaskPropertyEditor.EditMask(this.discoverySvc, this.uiSvc, this.maskedTextBox, helpService); if( mask != null ) { PropertyDescriptor maskProperty = TypeDescriptor.GetProperties(this.maskedTextBox)["Mask"]; Debug.Assert( maskProperty != null, "Could not find 'Mask' property in control." ); if( maskProperty != null ) { maskProperty.SetValue(this.maskedTextBox, mask); } } } ////// Returns the control's action list items. /// public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection(); items.Add(new DesignerActionMethodItem(this, "SetMask", SR.GetString(SR.MaskedTextBoxDesignerVerbsSetMaskDesc))); return items; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BroadcastEventHelper.cs
- MenuItem.cs
- StackBuilderSink.cs
- GeneratedContractType.cs
- ProvidersHelper.cs
- PeerApplicationLaunchInfo.cs
- ReferenceService.cs
- DecoderBestFitFallback.cs
- Listen.cs
- ExpandableObjectConverter.cs
- GridViewSelectEventArgs.cs
- RemotingException.cs
- GC.cs
- HttpCacheVaryByContentEncodings.cs
- XmlElement.cs
- WindowsRichEditRange.cs
- ValidationErrorEventArgs.cs
- ItemCollection.cs
- DelayedRegex.cs
- ScalarOps.cs
- TrackingParameters.cs
- PresentationSource.cs
- FileNameEditor.cs
- RelationshipConverter.cs
- PageContentAsyncResult.cs
- ReflectEventDescriptor.cs
- Normalization.cs
- _ShellExpression.cs
- CuspData.cs
- ReadOnlyNameValueCollection.cs
- PageHandlerFactory.cs
- Size.cs
- CompilerWrapper.cs
- TextAutomationPeer.cs
- SmtpReplyReader.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- IsolatedStoragePermission.cs
- RegexCompilationInfo.cs
- MultiAsyncResult.cs
- BuildTopDownAttribute.cs
- FunctionImportMapping.cs
- RowToFieldTransformer.cs
- TypeElementCollection.cs
- XmlSerializerVersionAttribute.cs
- SqlDataSourceSelectingEventArgs.cs
- ResourceReferenceExpression.cs
- XPathCompileException.cs
- ProgressBarAutomationPeer.cs
- CalendarDesigner.cs
- SatelliteContractVersionAttribute.cs
- DataGridViewCellCollection.cs
- FunctionQuery.cs
- BamlBinaryReader.cs
- CodeDOMProvider.cs
- HttpServerUtilityBase.cs
- InfoCardPolicy.cs
- ProtocolInformationWriter.cs
- XmlSchemaSimpleTypeRestriction.cs
- ClientSettingsSection.cs
- CharacterHit.cs
- MILUtilities.cs
- HostingPreferredMapPath.cs
- CatalogZoneAutoFormat.cs
- EdmEntityTypeAttribute.cs
- DetailsViewUpdatedEventArgs.cs
- Table.cs
- CorrelationTokenTypeConvertor.cs
- CodeMemberEvent.cs
- InstanceStore.cs
- NativeMethods.cs
- StyleSheetRefUrlEditor.cs
- SpellerStatusTable.cs
- WebPartHeaderCloseVerb.cs
- ComponentDispatcher.cs
- X509AsymmetricSecurityKey.cs
- PackagePartCollection.cs
- PrtTicket_Public_Simple.cs
- MemoryStream.cs
- UInt64.cs
- ProfileParameter.cs
- FacetDescription.cs
- relpropertyhelper.cs
- Queue.cs
- Thread.cs
- IODescriptionAttribute.cs
- CodeExporter.cs
- CreateParams.cs
- CustomLineCap.cs
- SqlXmlStorage.cs
- DesignerWebPartChrome.cs
- Condition.cs
- DataRelation.cs
- VersionValidator.cs
- ResourceContainer.cs
- pingexception.cs
- DesignerTextViewAdapter.cs
- SimpleWorkerRequest.cs
- OdbcReferenceCollection.cs
- MessageBodyDescription.cs
- TypefaceCollection.cs