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
- CommandLineParser.cs
- SqlClientFactory.cs
- ConfigurationLocation.cs
- TabPanel.cs
- DataRelationPropertyDescriptor.cs
- HwndProxyElementProvider.cs
- DesignTimeVisibleAttribute.cs
- Button.cs
- StreamUpdate.cs
- XsltContext.cs
- GridViewRowCollection.cs
- DataGridLinkButton.cs
- XmlWellformedWriter.cs
- CorrelationManager.cs
- ReferenceSchema.cs
- ThousandthOfEmRealDoubles.cs
- RC2CryptoServiceProvider.cs
- DataGridViewCellLinkedList.cs
- TargetParameterCountException.cs
- StorageMappingItemLoader.cs
- CqlWriter.cs
- DES.cs
- StorageBasedPackageProperties.cs
- BitConverter.cs
- EnumDataContract.cs
- SqlCaseSimplifier.cs
- UpdatePanelControlTrigger.cs
- AuthenticateEventArgs.cs
- OperatorExpressions.cs
- NotFiniteNumberException.cs
- BridgeDataRecord.cs
- SizeValueSerializer.cs
- Cursors.cs
- DBConnection.cs
- CodeAccessSecurityEngine.cs
- IgnoreFileBuildProvider.cs
- XamlReaderHelper.cs
- LayoutEditorPart.cs
- ResourcesChangeInfo.cs
- SlipBehavior.cs
- CopyNamespacesAction.cs
- sortedlist.cs
- _Events.cs
- StopStoryboard.cs
- DeadCharTextComposition.cs
- ReachObjectContext.cs
- ContextMenu.cs
- SpecularMaterial.cs
- WebPartZoneBase.cs
- DesignerView.cs
- listitem.cs
- ButtonBaseAutomationPeer.cs
- PinnedBufferMemoryStream.cs
- ConsoleTraceListener.cs
- QueryHandler.cs
- NativeMethods.cs
- ObjectSecurityT.cs
- NetNamedPipeBindingElement.cs
- EntityAdapter.cs
- URLMembershipCondition.cs
- BuildManagerHost.cs
- odbcmetadatacolumnnames.cs
- StringResourceManager.cs
- CallbackDebugElement.cs
- EventSinkHelperWriter.cs
- CrossSiteScriptingValidation.cs
- externdll.cs
- TdsParserSafeHandles.cs
- SystemNetHelpers.cs
- TextPointerBase.cs
- DefaultProxySection.cs
- SystemPens.cs
- CategoryValueConverter.cs
- MetafileHeaderWmf.cs
- RunClient.cs
- ExtenderControl.cs
- WebPartConnectionsConnectVerb.cs
- EventMappingSettings.cs
- DetailsViewInsertedEventArgs.cs
- InkCanvasAutomationPeer.cs
- oledbmetadatacolumnnames.cs
- InvokeProviderWrapper.cs
- ScrollBarAutomationPeer.cs
- ObjectDataSourceDisposingEventArgs.cs
- HttpValueCollection.cs
- Vector3D.cs
- MatchingStyle.cs
- RSAPKCS1SignatureFormatter.cs
- LingerOption.cs
- DataViewManager.cs
- DataColumnMappingCollection.cs
- StreamGeometry.cs
- Soap.cs
- ListSurrogate.cs
- DbgCompiler.cs
- RegisterResponseInfo.cs
- XmlElementList.cs
- MimeFormatExtensions.cs
- UnsafeNativeMethods.cs
- PngBitmapDecoder.cs