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
- VSWCFServiceContractGenerator.cs
- PriorityRange.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- HMACSHA256.cs
- TraceData.cs
- ProtectedProviderSettings.cs
- HttpApplicationFactory.cs
- UrlMappingsSection.cs
- SqlTypesSchemaImporter.cs
- ScrollBar.cs
- XPathDocumentIterator.cs
- NumericPagerField.cs
- ResourceDescriptionAttribute.cs
- HttpsHostedTransportConfiguration.cs
- ActiveXSerializer.cs
- DataServiceRequestException.cs
- TryCatch.cs
- ResourceProperty.cs
- CategoryGridEntry.cs
- RepeatBehaviorConverter.cs
- MgmtConfigurationRecord.cs
- Geometry.cs
- XmlSortKeyAccumulator.cs
- SerializationFieldInfo.cs
- BooleanFacetDescriptionElement.cs
- RegexMatchCollection.cs
- XmlUtil.cs
- InputGestureCollection.cs
- TimersDescriptionAttribute.cs
- InstalledFontCollection.cs
- WmlImageAdapter.cs
- TreeNodeBinding.cs
- SelectionProviderWrapper.cs
- AssemblyResourceLoader.cs
- Knowncolors.cs
- AmbientValueAttribute.cs
- SwitchLevelAttribute.cs
- HtmlInputCheckBox.cs
- DbException.cs
- TextDecorations.cs
- EdgeProfileValidation.cs
- ConstantExpression.cs
- WorkflowEnvironment.cs
- ImageListUtils.cs
- ForeignKeyConstraint.cs
- GeometryHitTestParameters.cs
- messageonlyhwndwrapper.cs
- Win32PrintDialog.cs
- bidPrivateBase.cs
- StylusPointProperty.cs
- TypeUtils.cs
- ModelUIElement3D.cs
- SapiRecoInterop.cs
- DebuggerService.cs
- TraceEventCache.cs
- SymbolType.cs
- UserUseLicenseDictionaryLoader.cs
- ItemCollection.cs
- AmbiguousMatchException.cs
- ConfigXmlWhitespace.cs
- ModelPropertyDescriptor.cs
- XmlComplianceUtil.cs
- LayoutEditorPart.cs
- PeerServiceMessageContracts.cs
- MetaModel.cs
- SuppressMessageAttribute.cs
- NavigatorOutput.cs
- ToolStripItem.cs
- HtmlInputImage.cs
- ConsumerConnectionPointCollection.cs
- MailWebEventProvider.cs
- AssemblyName.cs
- MenuItemBindingCollection.cs
- PropertyDescriptorGridEntry.cs
- ApplicationSecurityManager.cs
- HttpInputStream.cs
- HttpListener.cs
- DbProviderFactoriesConfigurationHandler.cs
- SqlBooleanMismatchVisitor.cs
- InheritedPropertyChangedEventArgs.cs
- CrossAppDomainChannel.cs
- FixedSchema.cs
- ClientOptions.cs
- PowerModeChangedEventArgs.cs
- PropertyMappingExceptionEventArgs.cs
- AdRotatorDesigner.cs
- ToolBarOverflowPanel.cs
- SimpleMailWebEventProvider.cs
- OneOfScalarConst.cs
- RouteParser.cs
- InvalidComObjectException.cs
- CodeTypeDeclaration.cs
- MemberHolder.cs
- XmlDocumentType.cs
- _TransmitFileOverlappedAsyncResult.cs
- CollectionsUtil.cs
- ObjectViewEntityCollectionData.cs
- InstancePersistenceCommandException.cs
- WebConfigurationHost.cs
- TraceUtility.cs