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
- XmlSchemaCompilationSettings.cs
- FontStyles.cs
- HashJoinQueryOperatorEnumerator.cs
- ListViewUpdatedEventArgs.cs
- RelatedView.cs
- EventLogWatcher.cs
- XmlSchemaObjectTable.cs
- SqlBulkCopyColumnMapping.cs
- AuthStoreRoleProvider.cs
- ConnectionStringsExpressionBuilder.cs
- GCHandleCookieTable.cs
- IncrementalReadDecoders.cs
- ObjectItemAttributeAssemblyLoader.cs
- PasswordRecoveryDesigner.cs
- NativeMethodsCLR.cs
- HyperLinkDataBindingHandler.cs
- ReadWriteSpinLock.cs
- DependencyObject.cs
- ColumnMapVisitor.cs
- DrawListViewSubItemEventArgs.cs
- HttpListenerPrefixCollection.cs
- CacheMemory.cs
- InstallerTypeAttribute.cs
- PublishLicense.cs
- FormCollection.cs
- ChineseLunisolarCalendar.cs
- AccessText.cs
- ObjectAnimationBase.cs
- TimeStampChecker.cs
- DataServiceProcessingPipeline.cs
- RepeaterItemEventArgs.cs
- OptimalTextSource.cs
- WebPartDescription.cs
- GridViewDesigner.cs
- AddressAccessDeniedException.cs
- AutoGeneratedField.cs
- TemplatePropertyEntry.cs
- X509Extension.cs
- MtomMessageEncoder.cs
- OdbcConnectionOpen.cs
- HighlightVisual.cs
- ConfigurationPropertyAttribute.cs
- SqlStream.cs
- DomainConstraint.cs
- InputScopeNameConverter.cs
- RestrictedTransactionalPackage.cs
- ExpandedProjectionNode.cs
- XmlAttributeProperties.cs
- ListViewItem.cs
- FlowDocumentScrollViewer.cs
- EdmComplexPropertyAttribute.cs
- CodeRemoveEventStatement.cs
- GeneralTransform3D.cs
- TimeoutException.cs
- MimePart.cs
- PointValueSerializer.cs
- PageWrapper.cs
- DocumentViewerAutomationPeer.cs
- FixedPosition.cs
- StringComparer.cs
- DbProviderFactoriesConfigurationHandler.cs
- OleDbConnectionInternal.cs
- FixedSOMLineRanges.cs
- BlurEffect.cs
- ItemContainerGenerator.cs
- PeerResolverMode.cs
- TransactionManager.cs
- FrameworkElement.cs
- DbDataSourceEnumerator.cs
- DesignerSerializerAttribute.cs
- ToolboxItemAttribute.cs
- CapabilitiesRule.cs
- AttachedPropertiesService.cs
- JavaScriptSerializer.cs
- HtmlTextViewAdapter.cs
- ConnectionStringsSection.cs
- FaultReason.cs
- DynamicDataRouteHandler.cs
- DataControlCommands.cs
- EdmItemCollection.cs
- RangeValuePatternIdentifiers.cs
- SimplePropertyEntry.cs
- TableDetailsCollection.cs
- AdornerHitTestResult.cs
- GetIsBrowserClientRequest.cs
- SqlStream.cs
- Attributes.cs
- EncoderFallback.cs
- Matrix3D.cs
- StickyNote.cs
- ELinqQueryState.cs
- BindUriHelper.cs
- KnownTypeDataContractResolver.cs
- HtmlHead.cs
- AccessorTable.cs
- ReservationNotFoundException.cs
- DbConnectionOptions.cs
- TrackingProfileCache.cs
- UpdatePanel.cs
- Tuple.cs