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

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SmtpCommands.cs
- Composition.cs
- ColorTransform.cs
- ColumnHeaderCollectionEditor.cs
- DataBoundControl.cs
- InsufficientMemoryException.cs
- MbpInfo.cs
- RawMouseInputReport.cs
- SrgsElementList.cs
- ExitEventArgs.cs
- StdValidatorsAndConverters.cs
- SaveFileDialog.cs
- SafeProcessHandle.cs
- HtmlImage.cs
- StreamDocument.cs
- WebServiceReceive.cs
- MsmqReceiveParameters.cs
- loginstatus.cs
- QueryInterceptorAttribute.cs
- MasterPageCodeDomTreeGenerator.cs
- RequestQueue.cs
- PropertyFilterAttribute.cs
- Activator.cs
- ParallelRangeManager.cs
- MailMessageEventArgs.cs
- CodeMemberMethod.cs
- UserInitiatedRoutedEventPermissionAttribute.cs
- Conditional.cs
- WebBrowserUriTypeConverter.cs
- ScriptDescriptor.cs
- TogglePatternIdentifiers.cs
- EqualityComparer.cs
- ValueUtilsSmi.cs
- RtfControlWordInfo.cs
- XmlWriterTraceListener.cs
- TypeNameConverter.cs
- WindowsAuthenticationModule.cs
- PictureBoxDesigner.cs
- SoapElementAttribute.cs
- EmbeddedObject.cs
- Converter.cs
- ISCIIEncoding.cs
- InputBuffer.cs
- XmlObjectSerializerWriteContext.cs
- Symbol.cs
- InvalidDataException.cs
- VisualTreeHelper.cs
- AuthenticationSection.cs
- GenerateScriptTypeAttribute.cs
- XmlStringTable.cs
- UriScheme.cs
- DockEditor.cs
- BasicExpressionVisitor.cs
- DynamicResourceExtension.cs
- figurelengthconverter.cs
- HttpCookieCollection.cs
- PeerNearMe.cs
- FileReader.cs
- StandardCommands.cs
- InkPresenter.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- ObjectDataSourceSelectingEventArgs.cs
- SignedXml.cs
- DataGridViewButtonCell.cs
- XmlRootAttribute.cs
- MemberRestriction.cs
- OuterGlowBitmapEffect.cs
- BaseDataListComponentEditor.cs
- WebResponse.cs
- SharedPerformanceCounter.cs
- ObfuscateAssemblyAttribute.cs
- XmlSerializableWriter.cs
- DataGridRelationshipRow.cs
- Wizard.cs
- SafeProcessHandle.cs
- InitializerFacet.cs
- Volatile.cs
- XmlObjectSerializerReadContext.cs
- LocalFileSettingsProvider.cs
- SHA1.cs
- Selection.cs
- XmlAttributes.cs
- InheritanceAttribute.cs
- BindingFormattingDialog.cs
- XmlChoiceIdentifierAttribute.cs
- SmiSettersStream.cs
- PerspectiveCamera.cs
- ClientType.cs
- DataGridViewTextBoxCell.cs
- FastPropertyAccessor.cs
- SQLMoney.cs
- CodePrimitiveExpression.cs
- WizardStepBase.cs
- CodeSubDirectory.cs
- VariableAction.cs
- TraceEventCache.cs
- GeneralTransform.cs
- DatagridviewDisplayedBandsData.cs
- LiteralDesigner.cs
- ImportCatalogPart.cs