Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HasRunnableWorkflowEvent.cs
- ColumnHeader.cs
- ErrorHandler.cs
- ToolboxItemFilterAttribute.cs
- HttpWebRequestElement.cs
- IOThreadTimer.cs
- ToolStripDropDownItem.cs
- CompositeActivityTypeDescriptor.cs
- ServiceModelConfigurationSectionGroup.cs
- SmtpDateTime.cs
- _SingleItemRequestCache.cs
- MouseDevice.cs
- StdValidatorsAndConverters.cs
- XmlSubtreeReader.cs
- FileAuthorizationModule.cs
- COM2PictureConverter.cs
- EntityDataSourceWrapper.cs
- CharConverter.cs
- WsatServiceCertificate.cs
- NaturalLanguageHyphenator.cs
- SrgsDocument.cs
- ErrorFormatterPage.cs
- FileFormatException.cs
- ApplicationBuildProvider.cs
- DataSourceDesigner.cs
- SimpleHandlerFactory.cs
- Constants.cs
- ExpressionContext.cs
- DetailsViewUpdateEventArgs.cs
- SemanticTag.cs
- CroppedBitmap.cs
- XmlIncludeAttribute.cs
- XmlChildEnumerator.cs
- TrackingMemoryStreamFactory.cs
- ChangeDirector.cs
- MobileControlBuilder.cs
- RoutedEventConverter.cs
- OrderByLifter.cs
- ElementProxy.cs
- FrameworkPropertyMetadata.cs
- CompositeControl.cs
- CodeDelegateCreateExpression.cs
- XslAst.cs
- Object.cs
- WebConfigManager.cs
- SystemWebCachingSectionGroup.cs
- TimeSpanHelper.cs
- HtmlElement.cs
- FileUtil.cs
- EpmTargetTree.cs
- LZCodec.cs
- QueryCacheKey.cs
- ConfigXmlWhitespace.cs
- TimeoutValidationAttribute.cs
- EndCreateSecurityTokenRequest.cs
- Contracts.cs
- UnsafeNativeMethods.cs
- LogExtent.cs
- PassportIdentity.cs
- TextElement.cs
- Main.cs
- TextServicesManager.cs
- TypeCodeDomSerializer.cs
- EdmRelationshipRoleAttribute.cs
- MonitoringDescriptionAttribute.cs
- XhtmlBasicLiteralTextAdapter.cs
- StringDictionary.cs
- SaveFileDialog.cs
- ComponentCollection.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- FacetEnabledSchemaElement.cs
- RemoteX509Token.cs
- ChineseLunisolarCalendar.cs
- ProjectionCamera.cs
- InteropBitmapSource.cs
- StreamHelper.cs
- GridViewAutoFormat.cs
- WindowsSolidBrush.cs
- PageParser.cs
- ProgressBar.cs
- HotSpotCollection.cs
- SiblingIterators.cs
- DetailsViewInsertedEventArgs.cs
- InputScope.cs
- ObjectStorage.cs
- GZipUtils.cs
- HtmlTextArea.cs
- RawUIStateInputReport.cs
- SqlServer2KCompatibilityCheck.cs
- BindValidator.cs
- RequestTimeoutManager.cs
- DmlSqlGenerator.cs
- WmlLabelAdapter.cs
- BindingCollection.cs
- GridViewCancelEditEventArgs.cs
- QueryCacheManager.cs
- Point3DAnimationBase.cs
- ProxyManager.cs
- SymmetricAlgorithm.cs
- WebHttpBinding.cs