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
- Permission.cs
- SafeLibraryHandle.cs
- PropertyEntry.cs
- DataGridViewCellPaintingEventArgs.cs
- ScrollItemPattern.cs
- DataServiceHostFactory.cs
- ConfigXmlWhitespace.cs
- WebPartTracker.cs
- GenericAuthenticationEventArgs.cs
- CharacterMetricsDictionary.cs
- CSharpCodeProvider.cs
- DesignerOptions.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- TabletDeviceInfo.cs
- InvalidComObjectException.cs
- AccessDataSourceWizardForm.cs
- HTMLTagNameToTypeMapper.cs
- HtmlInputPassword.cs
- Transform.cs
- QueryOutputWriter.cs
- GenericTextProperties.cs
- GridViewEditEventArgs.cs
- EmptyCollection.cs
- SerialPort.cs
- TransportationConfigurationTypeInstallComponent.cs
- ConfigurationSchemaErrors.cs
- BitmapMetadataEnumerator.cs
- WaitForChangedResult.cs
- CfgArc.cs
- MemberNameValidator.cs
- InitializationEventAttribute.cs
- shaper.cs
- SyndicationDeserializer.cs
- WebPartDeleteVerb.cs
- PermissionSet.cs
- EdmConstants.cs
- SystemIcmpV4Statistics.cs
- BCLDebug.cs
- XmlSchemaDatatype.cs
- LiteralControl.cs
- WinInetCache.cs
- _DisconnectOverlappedAsyncResult.cs
- SafeTimerHandle.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- DescendantOverDescendantQuery.cs
- IListConverters.cs
- SchemaElementLookUpTable.cs
- GuidTagList.cs
- FormsIdentity.cs
- PrintDocument.cs
- HostedHttpTransportManager.cs
- DataGridColumnFloatingHeader.cs
- DataObjectAttribute.cs
- DataGridPagingPage.cs
- GeneralTransform3DGroup.cs
- UIInitializationException.cs
- TypeExtensionSerializer.cs
- SqlUserDefinedAggregateAttribute.cs
- GPStream.cs
- AddIn.cs
- XmlSchemaSimpleType.cs
- UIPropertyMetadata.cs
- DbgUtil.cs
- ExecutionTracker.cs
- CodeIdentifiers.cs
- GraphicsPath.cs
- ReversePositionQuery.cs
- OutOfMemoryException.cs
- OdbcInfoMessageEvent.cs
- TargetInvocationException.cs
- BindingsCollection.cs
- PipelineModuleStepContainer.cs
- NotFiniteNumberException.cs
- NavigationProperty.cs
- JsonServiceDocumentSerializer.cs
- AppSettingsExpressionEditor.cs
- ObjectNavigationPropertyMapping.cs
- SimpleMailWebEventProvider.cs
- activationcontext.cs
- MenuTracker.cs
- CapabilitiesUse.cs
- HostedHttpTransportManager.cs
- SchemaImporterExtensionsSection.cs
- AuthorizationRuleCollection.cs
- FillRuleValidation.cs
- OdbcDataReader.cs
- PanelStyle.cs
- SAPICategories.cs
- NavigationService.cs
- StrongNameKeyPair.cs
- CurrentChangingEventManager.cs
- SqlProvider.cs
- HandlerBase.cs
- BevelBitmapEffect.cs
- EntityDataSourceState.cs
- WebPartMovingEventArgs.cs
- StrokeNodeOperations.cs
- EraserBehavior.cs
- WpfMemberInvoker.cs
- ModelToObjectValueConverter.cs