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
- StringHelper.cs
- ViewService.cs
- StructuredTypeEmitter.cs
- OciHandle.cs
- XmlDataContract.cs
- ILGenerator.cs
- ResXDataNode.cs
- ObjectPersistData.cs
- GroupPartitionExpr.cs
- PolyLineSegmentFigureLogic.cs
- SqlRewriteScalarSubqueries.cs
- SizeKeyFrameCollection.cs
- TextEditorLists.cs
- CrossAppDomainChannel.cs
- TextSearch.cs
- UnauthorizedWebPart.cs
- EventLogPermissionHolder.cs
- DragCompletedEventArgs.cs
- StoreAnnotationsMap.cs
- ClientType.cs
- CngKeyBlobFormat.cs
- Transform3DGroup.cs
- TextServicesDisplayAttribute.cs
- TabControl.cs
- keycontainerpermission.cs
- updatecommandorderer.cs
- RootBrowserWindow.cs
- BoundPropertyEntry.cs
- Blend.cs
- wpf-etw.cs
- WinCategoryAttribute.cs
- TextDecorationUnitValidation.cs
- RectKeyFrameCollection.cs
- ClientRoleProvider.cs
- BindingListCollectionView.cs
- RuleInfoComparer.cs
- VirtualPath.cs
- EntityType.cs
- VisualBrush.cs
- XmlNodeChangedEventArgs.cs
- UnhandledExceptionEventArgs.cs
- XpsS0ValidatingLoader.cs
- WebDisplayNameAttribute.cs
- DbMetaDataColumnNames.cs
- SimpleFileLog.cs
- CharAnimationUsingKeyFrames.cs
- MarkupCompilePass2.cs
- JsonEncodingStreamWrapper.cs
- Hex.cs
- KeyValuePair.cs
- InkPresenterAutomationPeer.cs
- ConcurrentQueue.cs
- ObjectDataSource.cs
- QueryOutputWriter.cs
- CodeIdentifier.cs
- ConfigurationSchemaErrors.cs
- SpecularMaterial.cs
- AnnotationComponentManager.cs
- ProcessingInstructionAction.cs
- MetricEntry.cs
- SimpleHandlerBuildProvider.cs
- ChangeDirector.cs
- SpellerError.cs
- DataSet.cs
- CalendarDayButton.cs
- ThemeableAttribute.cs
- UIntPtr.cs
- QuotedStringFormatReader.cs
- HebrewCalendar.cs
- InstanceHandleReference.cs
- EnumValAlphaComparer.cs
- ToolStripContentPanel.cs
- IndicShape.cs
- AssemblyAttributes.cs
- SiteMapDesignerDataSourceView.cs
- SqlExpressionNullability.cs
- WebHttpEndpoint.cs
- IgnorePropertiesAttribute.cs
- _SpnDictionary.cs
- TemplatePartAttribute.cs
- NameService.cs
- DynamicDataExtensions.cs
- Encoder.cs
- TemplateKey.cs
- Typography.cs
- EncoderNLS.cs
- PreservationFileReader.cs
- PackagingUtilities.cs
- Icon.cs
- XmlNodeChangedEventManager.cs
- TextSimpleMarkerProperties.cs
- System.Data.OracleClient_BID.cs
- BaseUriHelper.cs
- FilterQuery.cs
- InkSerializer.cs
- TreeNode.cs
- SafeFileMapViewHandle.cs
- ObjectStateFormatter.cs
- FontDriver.cs
- DrawingVisual.cs