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
- TableLayoutPanelResizeGlyph.cs
- CommandValueSerializer.cs
- ExpressionValueEditor.cs
- JoinTreeSlot.cs
- X509CertificateStore.cs
- ConfigurationProperty.cs
- DataIdProcessor.cs
- TdsParserSafeHandles.cs
- ProgressiveCrcCalculatingStream.cs
- ContextMarshalException.cs
- WpfGeneratedKnownProperties.cs
- entitydatasourceentitysetnameconverter.cs
- _AcceptOverlappedAsyncResult.cs
- LinqDataSourceEditData.cs
- ImmutableObjectAttribute.cs
- AutoGeneratedFieldProperties.cs
- Random.cs
- BindToObject.cs
- UpdateException.cs
- Polyline.cs
- ExpressionConverter.cs
- RequestTimeoutManager.cs
- DataGridViewUtilities.cs
- ReachDocumentSequenceSerializer.cs
- SystemTcpConnection.cs
- ScaleTransform.cs
- ClientProxyGenerator.cs
- backend.cs
- BulletChrome.cs
- HtmlUtf8RawTextWriter.cs
- PerspectiveCamera.cs
- ScriptingRoleServiceSection.cs
- NotifyInputEventArgs.cs
- Icon.cs
- StorageInfo.cs
- TraceContextEventArgs.cs
- FocusChangedEventArgs.cs
- EncodedStreamFactory.cs
- MenuStrip.cs
- SignatureDescription.cs
- SchemaInfo.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- Font.cs
- CodeTypeReference.cs
- AbsoluteQuery.cs
- ForwardPositionQuery.cs
- NetworkCredential.cs
- SelectionItemPattern.cs
- TimeoutValidationAttribute.cs
- ListMarkerLine.cs
- ClusterRegistryConfigurationProvider.cs
- RuleSettingsCollection.cs
- PrtCap_Base.cs
- TreeNodeConverter.cs
- X509CertificateRecipientServiceCredential.cs
- OracleLob.cs
- JsonDataContract.cs
- Material.cs
- FlowDocumentPage.cs
- SqlCacheDependencySection.cs
- SeparatorAutomationPeer.cs
- CommandSet.cs
- OracleInfoMessageEventArgs.cs
- ProfileProvider.cs
- RowTypeElement.cs
- DBNull.cs
- DebuggerAttributes.cs
- WebPartDescription.cs
- LogManagementAsyncResult.cs
- XmlDataLoader.cs
- PrintPreviewControl.cs
- XMLSyntaxException.cs
- ImageMap.cs
- HandleCollector.cs
- EntityDataSourceWrapper.cs
- Panel.cs
- HostProtectionPermission.cs
- Publisher.cs
- EncoderReplacementFallback.cs
- SafeThreadHandle.cs
- ScriptServiceAttribute.cs
- TagPrefixAttribute.cs
- Logging.cs
- WriterOutput.cs
- RelationshipDetailsCollection.cs
- DependencyObjectCodeDomSerializer.cs
- WebPartTracker.cs
- GridViewColumnCollection.cs
- KerberosSecurityTokenProvider.cs
- DateTimeParse.cs
- CodeAttributeDeclaration.cs
- Vector3D.cs
- Baml2006ReaderSettings.cs
- WebConfigurationFileMap.cs
- DefaultValueAttribute.cs
- ColorMap.cs
- Int64.cs
- WindowAutomationPeer.cs
- FrameworkObject.cs
- CommandConverter.cs