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
- SqlInternalConnectionTds.cs
- Point3DIndependentAnimationStorage.cs
- FormsAuthenticationUser.cs
- Operand.cs
- InsufficientMemoryException.cs
- _WebProxyDataBuilder.cs
- BrowsableAttribute.cs
- ProcessRequestArgs.cs
- UserControlParser.cs
- ClientEventManager.cs
- PrimaryKeyTypeConverter.cs
- SubpageParaClient.cs
- Menu.cs
- OutOfProcStateClientManager.cs
- PenLineCapValidation.cs
- MissingSatelliteAssemblyException.cs
- EnumerableCollectionView.cs
- VectorCollectionConverter.cs
- FixedHyperLink.cs
- ParserExtension.cs
- WSHttpBindingElement.cs
- PersonalizableTypeEntry.cs
- DictionaryBase.cs
- Debug.cs
- ParsedAttributeCollection.cs
- ApplicationHost.cs
- SpecialFolderEnumConverter.cs
- SQLSingle.cs
- QuadraticBezierSegment.cs
- TemplateContainer.cs
- PriorityBinding.cs
- SemanticKeyElement.cs
- Merger.cs
- CollectionChangeEventArgs.cs
- CodeAttributeArgumentCollection.cs
- IdentityHolder.cs
- LambdaCompiler.Statements.cs
- FrameworkElementFactory.cs
- Assert.cs
- SmtpDigestAuthenticationModule.cs
- WebPartMenuStyle.cs
- AffineTransform3D.cs
- UnsafeNativeMethods.cs
- BlurBitmapEffect.cs
- IdentityHolder.cs
- SystemEvents.cs
- SafeCoTaskMem.cs
- _NegoStream.cs
- LocationFactory.cs
- ArrayListCollectionBase.cs
- DesignBindingValueUIHandler.cs
- InvokeMethodActivity.cs
- ContainerSelectorGlyph.cs
- CalendarAutoFormat.cs
- FixedBufferAttribute.cs
- ModuleElement.cs
- HttpGetClientProtocol.cs
- PathFigureCollection.cs
- ObjectConverter.cs
- ToolTipService.cs
- CmsUtils.cs
- PerfCounters.cs
- AppearanceEditorPart.cs
- WebConfigurationFileMap.cs
- TerminatorSinks.cs
- FileAuthorizationModule.cs
- PartitionResolver.cs
- ContextMenuStripActionList.cs
- DataControlField.cs
- SqlProfileProvider.cs
- TextServicesDisplayAttribute.cs
- WindowPattern.cs
- TextBlockAutomationPeer.cs
- Identifier.cs
- DataGridViewTextBoxCell.cs
- Pen.cs
- Cursors.cs
- AssociationEndMember.cs
- ListViewUpdateEventArgs.cs
- InternalResources.cs
- Zone.cs
- SortedList.cs
- EntityDataReader.cs
- ViewBox.cs
- XmlExpressionDumper.cs
- DbDeleteCommandTree.cs
- BookmarkScopeManager.cs
- PeerNameResolver.cs
- HostedTransportConfigurationManager.cs
- Form.cs
- DetailsViewUpdateEventArgs.cs
- KeyFrames.cs
- FileBasedResourceGroveler.cs
- FormViewRow.cs
- DashStyle.cs
- StagingAreaInputItem.cs
- BuildProvider.cs
- VisualTarget.cs
- Binding.cs
- SecureStringHasher.cs