Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- HttpModulesSection.cs
- MessageBox.cs
- Propagator.ExtentPlaceholderCreator.cs
- DateTimeFormat.cs
- ElementMarkupObject.cs
- Size.cs
- LocalTransaction.cs
- COM2ExtendedBrowsingHandler.cs
- AncestorChangedEventArgs.cs
- TargetFrameworkUtil.cs
- ConversionHelper.cs
- SchemaEntity.cs
- CodeMethodInvokeExpression.cs
- EnumUnknown.cs
- _NetworkingPerfCounters.cs
- TransformedBitmap.cs
- connectionpool.cs
- PromptEventArgs.cs
- FormViewDeleteEventArgs.cs
- ExtensionWindowHeader.cs
- StructuralType.cs
- HwndMouseInputProvider.cs
- ViewBox.cs
- ProcessModuleCollection.cs
- AddInController.cs
- WinFormsUtils.cs
- FormsAuthenticationCredentials.cs
- SrgsToken.cs
- FacetChecker.cs
- HtmlButton.cs
- DBSqlParserTable.cs
- HtmlTableCellCollection.cs
- CommonDialog.cs
- Oci.cs
- AdditionalEntityFunctions.cs
- PrincipalPermission.cs
- CommandConverter.cs
- DataContractSet.cs
- HtmlHead.cs
- CompositeActivityTypeDescriptor.cs
- DictionarySurrogate.cs
- CodeSnippetStatement.cs
- Context.cs
- PartitionResolver.cs
- TiffBitmapEncoder.cs
- ListChangedEventArgs.cs
- AdornedElementPlaceholder.cs
- ProgressBarBrushConverter.cs
- MessageDecoder.cs
- ObjectSecurity.cs
- DynamicValidator.cs
- Label.cs
- XamlReaderHelper.cs
- RequestCacheManager.cs
- TheQuery.cs
- TimelineClockCollection.cs
- Mapping.cs
- ListChunk.cs
- KnownTypesProvider.cs
- TypeListConverter.cs
- RenderData.cs
- XmlIgnoreAttribute.cs
- Stylus.cs
- DBConcurrencyException.cs
- MultiView.cs
- storepermissionattribute.cs
- CodePrimitiveExpression.cs
- Directory.cs
- ProvidersHelper.cs
- ToolStripContentPanel.cs
- OperandQuery.cs
- ContractBase.cs
- Utils.cs
- NameObjectCollectionBase.cs
- NumberSubstitution.cs
- ValidatedMobileControlConverter.cs
- CompositeActivityTypeDescriptorProvider.cs
- DataGridViewTopLeftHeaderCell.cs
- XmlAttributeAttribute.cs
- MimeImporter.cs
- X509ChainPolicy.cs
- ComNativeDescriptor.cs
- TextEditorTables.cs
- CodeNamespaceImport.cs
- BamlLocalizableResource.cs
- StandardTransformFactory.cs
- ToolStripTemplateNode.cs
- ObjectDataSourceDisposingEventArgs.cs
- XPathNodeInfoAtom.cs
- XmlWhitespace.cs
- File.cs
- DataGridViewColumnCollection.cs
- DoubleAnimationUsingPath.cs
- SecurityKeyIdentifier.cs
- WebPartEditorCancelVerb.cs
- ApplyTemplatesAction.cs
- CircleHotSpot.cs
- XPathDocumentIterator.cs
- DataBoundControlHelper.cs
- SqlDataSourceCache.cs