Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebControls / RegexTypeEditor.cs / 1 / RegexTypeEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.WebControls { using System.Runtime.InteropServices; using System.Diagnostics; using System; using System.IO; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Drawing; using System.Drawing.Design; using System.Windows.Forms.Design; using System.Windows.Forms.ComponentModel; using System.Web.UI.Design.Util; ////// /// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] public class RegexTypeEditor : UITypeEditor { ///[To be supplied.] ////// /// public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (provider != null) { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc != null) { // Get the site // ISite site = null; if (context.Instance is IComponent) { site = ((IComponent)context.Instance).Site; } else if (context.Instance is object[]) { object [] components = (object []) context.Instance; if (components[0] is IComponent) { site = ((IComponent)components[0]).Site; } } RegexEditorDialog editorDialog = new RegexEditorDialog(site); editorDialog.RegularExpression = value.ToString(); if (editorDialog.ShowDialog() == DialogResult.OK) { value = editorDialog.RegularExpression; } } } return value; } ///[To be supplied.] ////// /// public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) { return UITypeEditorEditStyle.Modal; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.[To be supplied.] ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ClaimTypes.cs
- UrlPath.cs
- Conditional.cs
- ResourceProviderFactory.cs
- GridSplitterAutomationPeer.cs
- DataGridCellsPanel.cs
- RegexInterpreter.cs
- ListComponentEditor.cs
- ValidationSummary.cs
- ResourcePermissionBase.cs
- CustomBindingCollectionElement.cs
- Int64Storage.cs
- OutputScopeManager.cs
- GroupLabel.cs
- FontUnitConverter.cs
- UnsafeNativeMethods.cs
- OdbcRowUpdatingEvent.cs
- SolidColorBrush.cs
- DocumentAutomationPeer.cs
- PropertyGrid.cs
- TextEmbeddedObject.cs
- SortKey.cs
- ClientSettingsSection.cs
- EmptyQuery.cs
- EdmScalarPropertyAttribute.cs
- ConditionBrowserDialog.cs
- PasswordPropertyTextAttribute.cs
- HelpKeywordAttribute.cs
- ComEventsMethod.cs
- MenuScrollingVisibilityConverter.cs
- InfoCardSchemas.cs
- RadioButtonList.cs
- PrintController.cs
- SamlAssertionKeyIdentifierClause.cs
- SmtpNtlmAuthenticationModule.cs
- FileDialog_Vista_Interop.cs
- _IPv6Address.cs
- XmlReturnWriter.cs
- Events.cs
- DataRecordObjectView.cs
- RegisteredScript.cs
- ScrollContentPresenter.cs
- RightsManagementPermission.cs
- Gdiplus.cs
- UdpDiscoveryEndpointProvider.cs
- Stroke.cs
- DataObject.cs
- TypeDelegator.cs
- SecurityCriticalDataForSet.cs
- GridViewRow.cs
- UserUseLicenseDictionaryLoader.cs
- XmlRootAttribute.cs
- SafeMemoryMappedFileHandle.cs
- x509utils.cs
- HttpServerVarsCollection.cs
- InvalidPipelineStoreException.cs
- ControlDesignerState.cs
- SetStoryboardSpeedRatio.cs
- OletxVolatileEnlistment.cs
- NamespaceList.cs
- CompilerTypeWithParams.cs
- ProcessDesigner.cs
- CodeGeneratorAttribute.cs
- HtmlEncodedRawTextWriter.cs
- BufferedGraphicsContext.cs
- TagMapInfo.cs
- Size.cs
- WebControlParameterProxy.cs
- SqlServices.cs
- ThrowHelper.cs
- State.cs
- XmlDataSourceDesigner.cs
- cookiecontainer.cs
- WriteableBitmap.cs
- ValidationPropertyAttribute.cs
- GZipDecoder.cs
- ConnectionStringsExpressionEditor.cs
- SchemaImporterExtension.cs
- DynamicQueryableWrapper.cs
- InvokeGenerator.cs
- InputProcessorProfilesLoader.cs
- MessageEncodingBindingElementImporter.cs
- ColumnTypeConverter.cs
- HashCryptoHandle.cs
- InitiatorSessionSymmetricMessageSecurityProtocol.cs
- ErrorWebPart.cs
- HttpVersion.cs
- InkPresenter.cs
- SR.cs
- EncodingFallbackAwareXmlTextWriter.cs
- TextParagraphView.cs
- StylusPointCollection.cs
- RowToFieldTransformer.cs
- _LazyAsyncResult.cs
- InkCanvasInnerCanvas.cs
- VisualBrush.cs
- RestClientProxyHandler.cs
- SQLBinaryStorage.cs
- WebBrowserDocumentCompletedEventHandler.cs
- IpcServerChannel.cs