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
- BindingExpressionUncommonField.cs
- CodeVariableReferenceExpression.cs
- SqlFlattener.cs
- SqlConnectionString.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- Simplifier.cs
- SortExpressionBuilder.cs
- DbProviderConfigurationHandler.cs
- DataGridViewDataConnection.cs
- MessageBuffer.cs
- EtwTrace.cs
- RotateTransform.cs
- SqlGatherConsumedAliases.cs
- TextEmbeddedObject.cs
- ConfigXmlText.cs
- NotConverter.cs
- CfgArc.cs
- HtmlUtf8RawTextWriter.cs
- ContractComponent.cs
- FrameworkContentElement.cs
- DataGridViewBand.cs
- XPathDocumentNavigator.cs
- EndPoint.cs
- ApplicationServicesHostFactory.cs
- MainMenu.cs
- OleDbInfoMessageEvent.cs
- TraversalRequest.cs
- _SafeNetHandles.cs
- ListItemParagraph.cs
- NativeRecognizer.cs
- ScriptResourceDefinition.cs
- DataPagerFieldItem.cs
- SqlCacheDependency.cs
- PersonalizationState.cs
- SqlUDTStorage.cs
- NamedPipeConnectionPoolSettingsElement.cs
- FileUpload.cs
- Rotation3DKeyFrameCollection.cs
- XmlnsDefinitionAttribute.cs
- MemberInfoSerializationHolder.cs
- CacheMemory.cs
- CompiledXpathExpr.cs
- SQLString.cs
- PolicyException.cs
- BlockUIContainer.cs
- TablePattern.cs
- Int32.cs
- DispatcherHookEventArgs.cs
- EntityDataSourceChangingEventArgs.cs
- ZipIOCentralDirectoryFileHeader.cs
- BitStack.cs
- WpfWebRequestHelper.cs
- Pen.cs
- ValidationEventArgs.cs
- BamlLocalizer.cs
- SessionPageStateSection.cs
- DelayedRegex.cs
- DynamicArgumentDialog.cs
- EntityFunctions.cs
- EventBuilder.cs
- BlurEffect.cs
- GPPOINTF.cs
- MatrixConverter.cs
- SqlFacetAttribute.cs
- TableCellCollection.cs
- XmlRawWriter.cs
- NullableDoubleMinMaxAggregationOperator.cs
- UpdatePanelTrigger.cs
- Point.cs
- OleAutBinder.cs
- HostProtectionPermission.cs
- SamlAttribute.cs
- RootBrowserWindowProxy.cs
- DesignerVerbCollection.cs
- ThemeableAttribute.cs
- HttpResponse.cs
- WrappingXamlSchemaContext.cs
- ApplyImportsAction.cs
- SoapFormatter.cs
- LayoutEditorPart.cs
- IsolatedStoragePermission.cs
- EncoderFallback.cs
- ConditionedDesigner.cs
- ClientSettings.cs
- LayoutInformation.cs
- cryptoapiTransform.cs
- IdentityReference.cs
- Error.cs
- path.cs
- ForeignConstraint.cs
- ServiceManagerHandle.cs
- BinaryConverter.cs
- CollectionChangeEventArgs.cs
- SqlXmlStorage.cs
- XPathNodeList.cs
- DependencyPropertyKind.cs
- SHA384.cs
- TTSEngineTypes.cs
- Classification.cs
- LinkedResource.cs