Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- DateTimeValueSerializerContext.cs
- TypePropertyEditor.cs
- UriScheme.cs
- WindowsPrincipal.cs
- SimpleFieldTemplateUserControl.cs
- BufferedWebEventProvider.cs
- HttpCookieCollection.cs
- TreeViewCancelEvent.cs
- FlagsAttribute.cs
- KoreanLunisolarCalendar.cs
- DesignRelationCollection.cs
- CssClassPropertyAttribute.cs
- ObjectQuery.cs
- SqlVersion.cs
- TableProvider.cs
- DataMemberListEditor.cs
- Maps.cs
- QueryException.cs
- DecoderFallbackWithFailureFlag.cs
- BamlBinaryReader.cs
- X509ClientCertificateAuthenticationElement.cs
- RoleProviderPrincipal.cs
- ColumnResizeAdorner.cs
- PresentationTraceSources.cs
- FieldInfo.cs
- Merger.cs
- WebPartHeaderCloseVerb.cs
- BinaryObjectWriter.cs
- FixUpCollection.cs
- WebPermission.cs
- SqlDuplicator.cs
- securitycriticaldata.cs
- Vector3DAnimationUsingKeyFrames.cs
- ValueTable.cs
- DiagnosticsConfiguration.cs
- ThrowOnMultipleAssignment.cs
- HtmlShimManager.cs
- OracleInternalConnection.cs
- TileModeValidation.cs
- XmlSchemaSimpleContent.cs
- StringAttributeCollection.cs
- PerformanceCounterPermissionEntryCollection.cs
- CodeSnippetCompileUnit.cs
- ResourceSetExpression.cs
- HttpWriter.cs
- BitmapMetadataEnumerator.cs
- AccessedThroughPropertyAttribute.cs
- FixedFlowMap.cs
- DesignerSerializationManager.cs
- ElementAction.cs
- SafeNativeMethods.cs
- ToolboxBitmapAttribute.cs
- SynchronizationContext.cs
- HwndPanningFeedback.cs
- HttpListenerException.cs
- WebBrowserDocumentCompletedEventHandler.cs
- X509ChainPolicy.cs
- Util.cs
- DrawingAttributeSerializer.cs
- RootBrowserWindowProxy.cs
- CodeAttributeDeclarationCollection.cs
- EntityClientCacheKey.cs
- ThousandthOfEmRealDoubles.cs
- SplashScreenNativeMethods.cs
- ToolStripDesignerAvailabilityAttribute.cs
- DataBindEngine.cs
- EventMappingSettings.cs
- DataGridParentRows.cs
- CLSCompliantAttribute.cs
- PropertyRef.cs
- SslStream.cs
- DataGridRelationshipRow.cs
- Bezier.cs
- InstanceValue.cs
- DelegatedStream.cs
- SurrogateDataContract.cs
- ConstraintEnumerator.cs
- SqlConnectionString.cs
- CheckedPointers.cs
- Char.cs
- RawStylusActions.cs
- WindowsListViewGroupHelper.cs
- PackWebRequestFactory.cs
- hwndwrapper.cs
- SqlDataSourceCommandEventArgs.cs
- SystemSounds.cs
- XPathAncestorIterator.cs
- UriTemplateMatch.cs
- RoleGroupCollection.cs
- Button.cs
- FormDesigner.cs
- XmlJsonReader.cs
- ToolStripKeyboardHandlingService.cs
- assemblycache.cs
- TraceListeners.cs
- CatchBlock.cs
- DbInsertCommandTree.cs
- MatrixTransform.cs
- XmlDataDocument.cs
- BitmapEffect.cs