Code:
/ FX-1434 / FX-1434 / 1.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
- DesignerDataView.cs
- MemberAccessException.cs
- DesignTimeTemplateParser.cs
- Function.cs
- ThreadStaticAttribute.cs
- OutputCacheProfileCollection.cs
- OracleInfoMessageEventArgs.cs
- MouseActionValueSerializer.cs
- TransactedBatchingBehavior.cs
- InkCollectionBehavior.cs
- NativeMethods.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ColorContextHelper.cs
- OrthographicCamera.cs
- ShapingWorkspace.cs
- FusionWrap.cs
- DataSourceControl.cs
- URI.cs
- VirtualPath.cs
- DataContractAttribute.cs
- XPathMultyIterator.cs
- InternalResources.cs
- ValueQuery.cs
- DataGridViewLinkCell.cs
- OrthographicCamera.cs
- NonDualMessageSecurityOverHttpElement.cs
- HtmlInputSubmit.cs
- TemplatePartAttribute.cs
- BasicDesignerLoader.cs
- ObjectDataSourceFilteringEventArgs.cs
- SafeThreadHandle.cs
- FontSourceCollection.cs
- EntitySqlException.cs
- SoapEnvelopeProcessingElement.cs
- CodeGenerator.cs
- UshortList2.cs
- CellTreeSimplifier.cs
- SerializerDescriptor.cs
- DocumentGridContextMenu.cs
- PartManifestEntry.cs
- GeneralTransform3DCollection.cs
- RecordManager.cs
- QilUnary.cs
- XmlElement.cs
- CollectionType.cs
- XmlTextWriter.cs
- TransformCollection.cs
- GeometryDrawing.cs
- isolationinterop.cs
- DataServiceQueryProvider.cs
- DataControlFieldCell.cs
- NativeWindow.cs
- DataGridViewCellConverter.cs
- DataGridComboBoxColumn.cs
- DataGridCellsPanel.cs
- FontFamilyValueSerializer.cs
- ForwardPositionQuery.cs
- localization.cs
- BamlLocalizer.cs
- StateDesigner.CommentLayoutGlyph.cs
- VersionConverter.cs
- CryptoStream.cs
- EventArgs.cs
- XpsFilter.cs
- TimeSpanParse.cs
- SimpleBitVector32.cs
- TrackingProfile.cs
- ImageDrawing.cs
- DetailsViewRowCollection.cs
- HTTPNotFoundHandler.cs
- ComponentCache.cs
- ExpressionEditorAttribute.cs
- TextStore.cs
- CssTextWriter.cs
- XPathNodeList.cs
- QueryOperator.cs
- DataRowExtensions.cs
- ConfigPathUtility.cs
- RemotingConfigParser.cs
- CompositeControl.cs
- UnknownBitmapEncoder.cs
- Main.cs
- SqlProviderManifest.cs
- SchemaTableColumn.cs
- LinqDataSourceUpdateEventArgs.cs
- KerberosRequestorSecurityToken.cs
- StyleModeStack.cs
- RectAnimationClockResource.cs
- GridViewUpdatedEventArgs.cs
- WindowsListViewItemCheckBox.cs
- DetailsViewPagerRow.cs
- DataComponentGenerator.cs
- MenuItemStyle.cs
- CompositeDataBoundControl.cs
- XXXOnTypeBuilderInstantiation.cs
- HttpCacheParams.cs
- DataContractFormatAttribute.cs
- SmtpReplyReader.cs
- FileDataSourceCache.cs
- NameValueCollection.cs