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
- TextEffectCollection.cs
- HttpListener.cs
- InputLangChangeRequestEvent.cs
- StateChangeEvent.cs
- ExpressionStringBuilder.cs
- DesignBindingPropertyDescriptor.cs
- HtmlElement.cs
- SQLBytes.cs
- MemberAssignmentAnalysis.cs
- IisTraceListener.cs
- ContainerTracking.cs
- HtmlHistory.cs
- PackageStore.cs
- ImageMapEventArgs.cs
- GuidConverter.cs
- NativeCppClassAttribute.cs
- MethodBuilder.cs
- ConfigurationLockCollection.cs
- EntityDataSourceContextCreatedEventArgs.cs
- TransactionContext.cs
- IPAddressCollection.cs
- InternalDuplexBindingElement.cs
- GridViewUpdatedEventArgs.cs
- CalendarDay.cs
- DescendentsWalkerBase.cs
- TableItemProviderWrapper.cs
- SequentialUshortCollection.cs
- ResourceReferenceExpression.cs
- DetailsViewCommandEventArgs.cs
- Debug.cs
- JsonReader.cs
- DataGridBeginningEditEventArgs.cs
- SiteMapNodeItemEventArgs.cs
- Mutex.cs
- RegexWorker.cs
- ContentType.cs
- GridViewRowPresenterBase.cs
- LockCookie.cs
- SelectionItemPattern.cs
- SignatureHelper.cs
- Message.cs
- ProgressBarAutomationPeer.cs
- UriExt.cs
- PageDeviceFont.cs
- EastAsianLunisolarCalendar.cs
- SizeLimitedCache.cs
- PropertyBuilder.cs
- DebugController.cs
- RadioButton.cs
- WebCategoryAttribute.cs
- CollectionViewSource.cs
- QuotedStringWriteStateInfo.cs
- Vector3D.cs
- _OSSOCK.cs
- UnmanagedHandle.cs
- VersionPair.cs
- AliasedSlot.cs
- CachingHintValidation.cs
- TreeView.cs
- SelectionProcessor.cs
- AssemblyBuilder.cs
- NetDataContractSerializer.cs
- SqlProcedureAttribute.cs
- COM2EnumConverter.cs
- ExceptionUtil.cs
- WebCategoryAttribute.cs
- SafeHandles.cs
- WindowsFormsHostAutomationPeer.cs
- XmlCharType.cs
- TreeNodeBinding.cs
- AlphabeticalEnumConverter.cs
- ExpressionBuilder.cs
- Rfc2898DeriveBytes.cs
- ComplusTypeValidator.cs
- TableLayoutCellPaintEventArgs.cs
- MonthChangedEventArgs.cs
- _PooledStream.cs
- XmlDataProvider.cs
- XXXInfos.cs
- ControlBuilderAttribute.cs
- DesignerObjectListAdapter.cs
- DataGridViewSelectedRowCollection.cs
- ProtocolProfile.cs
- DiffuseMaterial.cs
- LocatorBase.cs
- Rotation3DAnimation.cs
- UrlMappingsModule.cs
- ByteConverter.cs
- PathParser.cs
- FacetDescriptionElement.cs
- NamedPipeConnectionPoolSettingsElement.cs
- SmtpReplyReaderFactory.cs
- AssemblyBuilder.cs
- FocusChangedEventArgs.cs
- MatrixUtil.cs
- SmiRequestExecutor.cs
- OracleSqlParser.cs
- DataGridColumn.cs
- ButtonBaseAutomationPeer.cs
- JapaneseCalendar.cs