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
- HttpModuleAction.cs
- DataBoundControl.cs
- XPathAncestorIterator.cs
- CurrentChangedEventManager.cs
- SingleResultAttribute.cs
- SAPIEngineTypes.cs
- ErrorTableItemStyle.cs
- relpropertyhelper.cs
- GridViewRowPresenter.cs
- Vector.cs
- PopupRoot.cs
- DataSetFieldSchema.cs
- DelegatedStream.cs
- ClientUtils.cs
- IntegerValidator.cs
- PaperSource.cs
- NumericUpDownAcceleration.cs
- AuthenticationModulesSection.cs
- SrgsElement.cs
- AutomationProperties.cs
- DetailsViewDeletedEventArgs.cs
- Timeline.cs
- PropertyNames.cs
- LabelLiteral.cs
- HeaderPanel.cs
- Point3D.cs
- DataPointer.cs
- versioninfo.cs
- Stack.cs
- TextTreeTextNode.cs
- ColumnPropertiesGroup.cs
- TrustManagerMoreInformation.cs
- AstTree.cs
- uribuilder.cs
- BitmapCache.cs
- CodeTypeDeclarationCollection.cs
- UnSafeCharBuffer.cs
- EntityViewGenerationAttribute.cs
- StringDictionary.cs
- ExpressionBinding.cs
- BinarySerializer.cs
- _SecureChannel.cs
- FormParameter.cs
- DataGridItemCollection.cs
- CollectionChangedEventManager.cs
- DbMetaDataFactory.cs
- Debugger.cs
- InvokerUtil.cs
- SignatureConfirmationElement.cs
- HtmlContainerControl.cs
- CodeAttributeArgument.cs
- FixedElement.cs
- SelectionEditingBehavior.cs
- GridViewSortEventArgs.cs
- WindowsIdentity.cs
- CellIdBoolean.cs
- SecurityHelper.cs
- DoubleLink.cs
- Scene3D.cs
- StaticTextPointer.cs
- XomlDesignerLoader.cs
- SafeLibraryHandle.cs
- ACL.cs
- SelectedDatesCollection.cs
- KerberosSecurityTokenProvider.cs
- MarshalDirectiveException.cs
- WebBrowserNavigatingEventHandler.cs
- ContainerParagraph.cs
- StaticSiteMapProvider.cs
- TypeSystem.cs
- RewritingProcessor.cs
- CheckBoxField.cs
- PeerObject.cs
- FileNotFoundException.cs
- ITextView.cs
- MetadataException.cs
- BezierSegment.cs
- Single.cs
- AutoGeneratedFieldProperties.cs
- ParserExtension.cs
- FeatureSupport.cs
- TimeSpan.cs
- TypeBuilderInstantiation.cs
- DefaultAuthorizationContext.cs
- XmlJsonWriter.cs
- DataGridCommandEventArgs.cs
- TextParaLineResult.cs
- URL.cs
- SynchronizedCollection.cs
- AccessorTable.cs
- SqlServer2KCompatibilityAnnotation.cs
- SecurityProtocol.cs
- COM2PictureConverter.cs
- HttpCacheVaryByContentEncodings.cs
- StructuredTypeEmitter.cs
- PanelStyle.cs
- TemplateBindingExtension.cs
- GeometryCombineModeValidation.cs
- MetadataUtilsSmi.cs
- CollectionChangeEventArgs.cs