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
- DropTarget.cs
- OleDbParameter.cs
- Enum.cs
- NumericExpr.cs
- RSAPKCS1KeyExchangeFormatter.cs
- IssuanceTokenProviderState.cs
- CellTreeNodeVisitors.cs
- ReceiveSecurityHeader.cs
- ListSortDescription.cs
- TemplateComponentConnector.cs
- HierarchicalDataBoundControlAdapter.cs
- DataListItemEventArgs.cs
- RemoteArgument.cs
- FormViewDeletedEventArgs.cs
- TextBox.cs
- StylusPlugin.cs
- LogArchiveSnapshot.cs
- TextDecorationUnitValidation.cs
- controlskin.cs
- RestHandler.cs
- SourceInterpreter.cs
- CapacityStreamGeometryContext.cs
- CodeAccessPermission.cs
- MediaPlayer.cs
- DataTable.cs
- VariableAction.cs
- OdbcCommand.cs
- ClassHandlersStore.cs
- SqlDataRecord.cs
- WebBaseEventKeyComparer.cs
- columnmapfactory.cs
- LogicalExpr.cs
- BitStream.cs
- BindingExpression.cs
- MimeFormatExtensions.cs
- RegexCompiler.cs
- KnownBoxes.cs
- HtmlHead.cs
- OracleParameterCollection.cs
- FlowchartDesigner.Helpers.cs
- SafeNativeMethods.cs
- ClientTarget.cs
- CommonXSendMessage.cs
- VariableQuery.cs
- HwndMouseInputProvider.cs
- ProcessRequestAsyncResult.cs
- LambdaCompiler.Address.cs
- DbDataSourceEnumerator.cs
- DelegatingTypeDescriptionProvider.cs
- ReturnValue.cs
- CoTaskMemUnicodeSafeHandle.cs
- TagElement.cs
- FullTextBreakpoint.cs
- linebase.cs
- DeferredSelectedIndexReference.cs
- serverconfig.cs
- GenericTextProperties.cs
- SqlRowUpdatingEvent.cs
- MeasureItemEvent.cs
- OdbcConnectionHandle.cs
- ApplicationDirectoryMembershipCondition.cs
- AdRotator.cs
- RefreshPropertiesAttribute.cs
- LinkedResource.cs
- MailWebEventProvider.cs
- TypefaceMetricsCache.cs
- Parallel.cs
- RegistrySecurity.cs
- DiagnosticEventProvider.cs
- DataSourceComponent.cs
- HealthMonitoringSectionHelper.cs
- ExistsInCollection.cs
- SqlDesignerDataSourceView.cs
- HtmlMeta.cs
- Nullable.cs
- Point4DValueSerializer.cs
- SmtpAuthenticationManager.cs
- RelatedEnd.cs
- PolicyValidationException.cs
- PanelStyle.cs
- KeysConverter.cs
- recordstatescratchpad.cs
- CachedTypeface.cs
- WebPartsPersonalizationAuthorization.cs
- ToolStripItemCollection.cs
- QilExpression.cs
- VersionedStream.cs
- ContainerAction.cs
- TabControlCancelEvent.cs
- Condition.cs
- sqlinternaltransaction.cs
- InvalidPropValue.cs
- StyleSheetDesigner.cs
- X509AsymmetricSecurityKey.cs
- UpdateCompiler.cs
- TitleStyle.cs
- ComponentResourceManager.cs
- ContextMenu.cs
- ImageClickEventArgs.cs
- xamlnodes.cs