Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / Util / UIHelper.cs / 3 / 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
- ListViewItemEventArgs.cs
- WebPartEditorApplyVerb.cs
- WorkflowViewService.cs
- Domain.cs
- DefaultValueConverter.cs
- ToolStripDropTargetManager.cs
- DoubleAnimationClockResource.cs
- EventSourceCreationData.cs
- RemotingSurrogateSelector.cs
- OleDbPermission.cs
- ObjectStorage.cs
- DbConnectionHelper.cs
- CodeIterationStatement.cs
- ComAwareEventInfo.cs
- ProviderUtil.cs
- CreateUserErrorEventArgs.cs
- DataGridViewElement.cs
- GroupBoxRenderer.cs
- OrderedDictionary.cs
- NativeRightsManagementAPIsStructures.cs
- LocatorManager.cs
- ZipIOBlockManager.cs
- SqlProfileProvider.cs
- XmlElementAttribute.cs
- PartialArray.cs
- PageBuildProvider.cs
- WebPartChrome.cs
- GreenMethods.cs
- SourceFileBuildProvider.cs
- CodeConditionStatement.cs
- BindingEntityInfo.cs
- Geometry.cs
- MemberMaps.cs
- JsonDeserializer.cs
- LambdaValue.cs
- TabletDevice.cs
- EndpointAddressAugust2004.cs
- GeneralTransform3DGroup.cs
- DataBindingCollection.cs
- SimpleType.cs
- ToolStripStatusLabel.cs
- DataGridLinkButton.cs
- XmlArrayItemAttributes.cs
- ForceCopyBuildProvider.cs
- FileInfo.cs
- RegexWriter.cs
- MimeFormReflector.cs
- MediaPlayerState.cs
- ValueUtilsSmi.cs
- BitmapScalingModeValidation.cs
- FixedPageProcessor.cs
- InheritanceContextHelper.cs
- DesignDataSource.cs
- IconConverter.cs
- HwndSource.cs
- ServerValidateEventArgs.cs
- ObjectQueryProvider.cs
- TableAutomationPeer.cs
- CommandValueSerializer.cs
- RadioButton.cs
- DataGrid.cs
- WaitHandle.cs
- DataServiceBuildProvider.cs
- TabletCollection.cs
- DataFormats.cs
- ProxyFragment.cs
- SiteMapDataSource.cs
- EntityDataSourceQueryBuilder.cs
- UnmanagedMemoryStreamWrapper.cs
- PackUriHelper.cs
- COM2PictureConverter.cs
- TdsParserHelperClasses.cs
- ExtensionQuery.cs
- StringResourceManager.cs
- Attachment.cs
- TableLayoutPanelCellPosition.cs
- ActivityWithResultWrapper.cs
- QueryCacheEntry.cs
- XamlSerializer.cs
- Vector3DCollection.cs
- SecurityProtocolFactory.cs
- TypefaceCollection.cs
- AddInController.cs
- ListViewInsertEventArgs.cs
- Int64Storage.cs
- ExpandSegmentCollection.cs
- Rijndael.cs
- InternalCache.cs
- NativeRightsManagementAPIsStructures.cs
- DbParameterCollectionHelper.cs
- FileDetails.cs
- DirectionalLight.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- DbDataSourceEnumerator.cs
- KeyBinding.cs
- DurableErrorHandler.cs
- AvTrace.cs
- ResXBuildProvider.cs
- FamilyMap.cs
- GridItem.cs