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
- NetworkInformationException.cs
- Substitution.cs
- TextLineResult.cs
- RepeatBehavior.cs
- TextDecoration.cs
- SiteMapDataSource.cs
- SystemResources.cs
- ViewSimplifier.cs
- FrameAutomationPeer.cs
- RepeatBehavior.cs
- ReferenceEqualityComparer.cs
- SqlNotificationEventArgs.cs
- HtmlInputText.cs
- EntityDataSourceWrapper.cs
- UnsafeNativeMethods.cs
- UnitControl.cs
- FrameworkContentElementAutomationPeer.cs
- PaintValueEventArgs.cs
- FontUnit.cs
- CaseStatementProjectedSlot.cs
- KeySpline.cs
- SiteMapDataSourceView.cs
- CodeAccessSecurityEngine.cs
- KeyConverter.cs
- DataListItemCollection.cs
- CharConverter.cs
- XmlProcessingInstruction.cs
- PageClientProxyGenerator.cs
- PieceNameHelper.cs
- BackgroundFormatInfo.cs
- UDPClient.cs
- UnknownWrapper.cs
- XamlTreeBuilderBamlRecordWriter.cs
- WindowAutomationPeer.cs
- EventItfInfo.cs
- cookiecollection.cs
- StatusBarItemAutomationPeer.cs
- Metafile.cs
- PageRanges.cs
- IntegerValidatorAttribute.cs
- CheckBoxBaseAdapter.cs
- ProxyWebPartConnectionCollection.cs
- GrabHandleGlyph.cs
- IntAverageAggregationOperator.cs
- OrderablePartitioner.cs
- sqlstateclientmanager.cs
- SQLDouble.cs
- XPathSelfQuery.cs
- GlyphShapingProperties.cs
- FieldMetadata.cs
- WebPartActionVerb.cs
- SequenceDesigner.cs
- EdmToObjectNamespaceMap.cs
- InvalidComObjectException.cs
- UidManager.cs
- ListViewHitTestInfo.cs
- __ConsoleStream.cs
- OutputCache.cs
- SQLCharsStorage.cs
- BitmapEffectDrawing.cs
- PeerTransportSecurityElement.cs
- UIElementCollection.cs
- XmlQueryContext.cs
- WebChannelFactory.cs
- RangeValidator.cs
- dbenumerator.cs
- SafeHandles.cs
- PropertyTabAttribute.cs
- InheritanceContextChangedEventManager.cs
- SqlServices.cs
- DatagridviewDisplayedBandsData.cs
- LifetimeServices.cs
- PeerNodeAddress.cs
- FixedStringLookup.cs
- GridItemCollection.cs
- DataControlField.cs
- GridSplitter.cs
- FrameworkContextData.cs
- AuthenticationManager.cs
- ViewBox.cs
- MediaTimeline.cs
- WmlFormAdapter.cs
- ParameterCollection.cs
- SecurityCookieModeValidator.cs
- WebChannelFactory.cs
- LinkTarget.cs
- DataGridViewCellStateChangedEventArgs.cs
- HtmlCommandAdapter.cs
- DefaultPrintController.cs
- TdsValueSetter.cs
- QilPatternFactory.cs
- SqlCacheDependencyDatabase.cs
- HealthMonitoringSectionHelper.cs
- EventLevel.cs
- Collection.cs
- ViewGenResults.cs
- SystemBrushes.cs
- ParameterEditorUserControl.cs
- ProcessRequestArgs.cs
- SizeIndependentAnimationStorage.cs