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
- __ComObject.cs
- HttpListenerContext.cs
- XmlSchemaSimpleContent.cs
- WmlValidatorAdapter.cs
- ListViewItemSelectionChangedEvent.cs
- KernelTypeValidation.cs
- WebBrowserProgressChangedEventHandler.cs
- AccessDataSourceView.cs
- ChannelDispatcherCollection.cs
- XhtmlBasicObjectListAdapter.cs
- PolyBezierSegment.cs
- DateTimeConstantAttribute.cs
- SqlMethodTransformer.cs
- securitycriticaldata.cs
- DragDrop.cs
- Context.cs
- MemberMemberBinding.cs
- PointLightBase.cs
- DataGridRelationshipRow.cs
- AsyncContentLoadedEventArgs.cs
- SettingsAttributeDictionary.cs
- TypeInfo.cs
- TextElementAutomationPeer.cs
- TextElementEnumerator.cs
- InputMethodStateChangeEventArgs.cs
- Compiler.cs
- AddressingVersion.cs
- StylusDownEventArgs.cs
- DataGridViewCellEventArgs.cs
- EventsTab.cs
- WebAdminConfigurationHelper.cs
- XmlNodeChangedEventManager.cs
- ParagraphVisual.cs
- BindingObserver.cs
- WebWorkflowRole.cs
- FilterElement.cs
- ItemType.cs
- AxImporter.cs
- RayHitTestParameters.cs
- SessionStateModule.cs
- AnimationException.cs
- metadatamappinghashervisitor.cs
- Image.cs
- WebServiceEnumData.cs
- SafeNativeMethods.cs
- ButtonFieldBase.cs
- ProxyElement.cs
- SetStoryboardSpeedRatio.cs
- Clipboard.cs
- XmlSchemaNotation.cs
- ConfigurationSectionGroupCollection.cs
- CompositeDispatchFormatter.cs
- ListViewDeleteEventArgs.cs
- QuaternionAnimationBase.cs
- TextDecorationCollection.cs
- exports.cs
- XmlSchemaSimpleContentRestriction.cs
- CdpEqualityComparer.cs
- WebServiceHandlerFactory.cs
- DBConnectionString.cs
- TextBlockAutomationPeer.cs
- ISAPIRuntime.cs
- DataGridViewRowsAddedEventArgs.cs
- WebHeaderCollection.cs
- ILGenerator.cs
- GridViewDeletedEventArgs.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- InfoCardCryptoHelper.cs
- FullTrustAssembliesSection.cs
- MultiPropertyDescriptorGridEntry.cs
- ParameterSubsegment.cs
- ConnectionPoolManager.cs
- HostProtectionPermission.cs
- Adorner.cs
- TraceListener.cs
- WebPartHelpVerb.cs
- _ConnectStream.cs
- AncestorChangedEventArgs.cs
- AvTrace.cs
- MailAddress.cs
- SchemaImporterExtensionElement.cs
- VirtualPathProvider.cs
- OdbcDataAdapter.cs
- LinkedResource.cs
- SingleAnimation.cs
- Missing.cs
- SignedXml.cs
- SmiSettersStream.cs
- X509CertificateCollection.cs
- Stack.cs
- HTMLTagNameToTypeMapper.cs
- OracleFactory.cs
- DocumentApplication.cs
- BoolLiteral.cs
- CounterSetInstance.cs
- OuterGlowBitmapEffect.cs
- UrlAuthorizationModule.cs
- WebPartsPersonalization.cs
- _WebProxyDataBuilder.cs
- InheritanceService.cs