Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / Util / UIHelper.cs / 1305376 / UIHelper.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] // // Helper methods for UI functionality like displaying dialogs //----------------------------------------------------------------------------- using System.Collections; using System.Drawing; using System.Windows.Forms; using System.Windows.Forms.Design; namespace System.Web.UI.Design.WebControls.Util { internal static class UIHelper { internal static Font GetDialogFont(IServiceProvider serviceProvider) { if (serviceProvider != null) { IUIService uiService = (IUIService)serviceProvider.GetService(typeof(IUIService)); if (uiService != null) { IDictionary uiStyles = uiService.Styles; if (uiStyles != null) { return (Font)uiStyles["DialogFont"]; } } } return null; } internal static DialogResult ShowDialog(IServiceProvider serviceProvider, Form form) { if (serviceProvider != null) { IUIService uiService = (IUIService)serviceProvider.GetService(typeof(IUIService)); if (uiService != null) { return uiService.ShowDialog(form); } } return form.ShowDialog(); } public static void ShowError(IServiceProvider serviceProvider, string message) { if (serviceProvider != null) { IUIService uiService = (IUIService)serviceProvider.GetService(typeof(IUIService)); if (uiService != null) { uiService.ShowError(message); return; } } RTLAwareMessageBox.Show(null, message, Strings.UIHelper_ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, 0); } public static void ShowWarning(IServiceProvider serviceProvider, string message) { if (serviceProvider != null) { IUIService uiService = (IUIService)serviceProvider.GetService(typeof(IUIService)); if (uiService != null) { uiService.ShowError(message); return; } } RTLAwareMessageBox.Show(null, message, Strings.UIHelper_WarningCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, 0); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] // // Helper methods for UI functionality like displaying dialogs //----------------------------------------------------------------------------- using System.Collections; using System.Drawing; using System.Windows.Forms; using System.Windows.Forms.Design; namespace System.Web.UI.Design.WebControls.Util { internal static class UIHelper { internal static Font GetDialogFont(IServiceProvider serviceProvider) { if (serviceProvider != null) { IUIService uiService = (IUIService)serviceProvider.GetService(typeof(IUIService)); if (uiService != null) { IDictionary uiStyles = uiService.Styles; if (uiStyles != null) { return (Font)uiStyles["DialogFont"]; } } } return null; } internal static DialogResult ShowDialog(IServiceProvider serviceProvider, Form form) { if (serviceProvider != null) { IUIService uiService = (IUIService)serviceProvider.GetService(typeof(IUIService)); if (uiService != null) { return uiService.ShowDialog(form); } } return form.ShowDialog(); } public static void ShowError(IServiceProvider serviceProvider, string message) { if (serviceProvider != null) { IUIService uiService = (IUIService)serviceProvider.GetService(typeof(IUIService)); if (uiService != null) { uiService.ShowError(message); return; } } RTLAwareMessageBox.Show(null, message, Strings.UIHelper_ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, 0); } public static void ShowWarning(IServiceProvider serviceProvider, string message) { if (serviceProvider != null) { IUIService uiService = (IUIService)serviceProvider.GetService(typeof(IUIService)); if (uiService != null) { uiService.ShowError(message); return; } } RTLAwareMessageBox.Show(null, message, Strings.UIHelper_WarningCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, 0); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridAddNewRow.cs
- GridEntry.cs
- XXXOnTypeBuilderInstantiation.cs
- BrowserCapabilitiesFactoryBase.cs
- Comparer.cs
- FileDialog_Vista_Interop.cs
- ADRoleFactory.cs
- COAUTHIDENTITY.cs
- SerializerDescriptor.cs
- DatasetMethodGenerator.cs
- ProcessHostMapPath.cs
- IOThreadTimer.cs
- ValidationRule.cs
- MsmqAppDomainProtocolHandler.cs
- HttpResponseWrapper.cs
- ThrowHelper.cs
- AutomationPatternInfo.cs
- SecurityContext.cs
- LinkLabelLinkClickedEvent.cs
- StylusPointProperty.cs
- ListViewDesigner.cs
- SessionPageStatePersister.cs
- LongAverageAggregationOperator.cs
- jithelpers.cs
- DispatcherExceptionEventArgs.cs
- TransformProviderWrapper.cs
- MenuItemBinding.cs
- OutputCacheProfile.cs
- D3DImage.cs
- ImageAutomationPeer.cs
- TableItemProviderWrapper.cs
- SupportingTokenSecurityTokenResolver.cs
- ConfigurationValues.cs
- ScriptReferenceBase.cs
- securitymgrsite.cs
- WindowAutomationPeer.cs
- CodeThrowExceptionStatement.cs
- KnowledgeBase.cs
- VisualSerializer.cs
- DbExpressionRules.cs
- ItemCheckedEvent.cs
- ResourceExpressionEditor.cs
- HtmlTableRowCollection.cs
- LinkGrep.cs
- XDRSchema.cs
- DataBoundControlDesigner.cs
- SqlConnectionPoolGroupProviderInfo.cs
- Transform3D.cs
- XPathDocumentBuilder.cs
- AuthenticationService.cs
- ForceCopyBuildProvider.cs
- XPathSelectionIterator.cs
- ResXResourceReader.cs
- StructuralType.cs
- AsmxEndpointPickerExtension.cs
- DesignerLabelAdapter.cs
- Walker.cs
- HTMLTagNameToTypeMapper.cs
- Literal.cs
- DesignerView.Commands.cs
- SoapAttributeAttribute.cs
- SafeFileMappingHandle.cs
- SignatureToken.cs
- ExportException.cs
- CodeMemberProperty.cs
- MenuCommandService.cs
- Error.cs
- SoapDocumentServiceAttribute.cs
- PartitionResolver.cs
- arabicshape.cs
- DetailsViewPagerRow.cs
- AuthenticatedStream.cs
- Lease.cs
- RepeaterItemEventArgs.cs
- SpeakInfo.cs
- GetIsBrowserClientRequest.cs
- CaseInsensitiveHashCodeProvider.cs
- NetworkInformationPermission.cs
- CommandManager.cs
- Vector3D.cs
- UxThemeWrapper.cs
- BamlVersionHeader.cs
- CriticalHandle.cs
- UnsafeNativeMethodsPenimc.cs
- EventHandlingScope.cs
- CellParagraph.cs
- Viewport2DVisual3D.cs
- ResXFileRef.cs
- ViewGenerator.cs
- PriorityQueue.cs
- XmlSerializerFactory.cs
- ScrollableControl.cs
- SelectionProcessor.cs
- ZipIOCentralDirectoryBlock.cs
- XmlCollation.cs
- TriggerBase.cs
- MaskedTextBox.cs
- HandlerBase.cs
- TouchesOverProperty.cs
- FacetChecker.cs