Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / Util / UIHelper.cs / 1 / 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
- XmlSchemaAll.cs
- Transform.cs
- IPAddress.cs
- DefaultDiscoveryService.cs
- EntityDesignerDataSourceView.cs
- xmlfixedPageInfo.cs
- PeerEndPoint.cs
- SdlChannelSink.cs
- ScriptServiceAttribute.cs
- XmlSchemaSimpleTypeList.cs
- XmlSerializerVersionAttribute.cs
- Line.cs
- WebPartExportVerb.cs
- PathFigure.cs
- LOSFormatter.cs
- RtfControls.cs
- InputScopeAttribute.cs
- XmlSerializationGeneratedCode.cs
- SupportsPreviewControlAttribute.cs
- WindowsPen.cs
- DecoderFallback.cs
- DBNull.cs
- QueryCursorEventArgs.cs
- MethodBuilderInstantiation.cs
- PrintController.cs
- FlowLayoutPanel.cs
- JsonWriterDelegator.cs
- EndpointNotFoundException.cs
- HostSecurityManager.cs
- Control.cs
- PerformanceCounterManager.cs
- ListControlConvertEventArgs.cs
- FixedFindEngine.cs
- SymbolType.cs
- SecureEnvironment.cs
- BufferedGraphics.cs
- CalloutQueueItem.cs
- SortExpressionBuilder.cs
- ServicePointManagerElement.cs
- SyndicationCategory.cs
- XmlElementList.cs
- HandleExceptionArgs.cs
- PingOptions.cs
- OleDbPermission.cs
- SqlColumnizer.cs
- ExeConfigurationFileMap.cs
- CommonObjectSecurity.cs
- FacetChecker.cs
- ParserContext.cs
- DataGridHeaderBorder.cs
- BindingManagerDataErrorEventArgs.cs
- DriveNotFoundException.cs
- ThumbAutomationPeer.cs
- DivideByZeroException.cs
- ImageButton.cs
- categoryentry.cs
- EnumType.cs
- FormView.cs
- OdbcException.cs
- ResourcePool.cs
- Expression.cs
- HtmlLink.cs
- XmlUtil.cs
- OutputCacheSettingsSection.cs
- NameValueConfigurationCollection.cs
- LogRecordSequence.cs
- SqlCacheDependencyDatabase.cs
- InterleavedZipPartStream.cs
- HtmlEmptyTagControlBuilder.cs
- Token.cs
- XsdBuildProvider.cs
- RichTextBoxConstants.cs
- HttpHeaderCollection.cs
- NameService.cs
- SliderAutomationPeer.cs
- HttpServerUtilityWrapper.cs
- Socket.cs
- CustomLineCap.cs
- HttpWriter.cs
- CheckBoxField.cs
- HtmlWindow.cs
- ViewLoader.cs
- LineInfo.cs
- EtwTrace.cs
- DataGridViewCellParsingEventArgs.cs
- DataRowView.cs
- StringValidator.cs
- XmlNodeReader.cs
- Roles.cs
- TabRenderer.cs
- WaitHandle.cs
- UriWriter.cs
- DesignTimeTemplateParser.cs
- PrimitiveSchema.cs
- FormsAuthenticationModule.cs
- AssemblyCollection.cs
- ITreeGenerator.cs
- WindowsScrollBarBits.cs
- SessionEndedEventArgs.cs
- StructuralObject.cs