Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / Util / UIHelper.cs / 3 / 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
- BamlCollectionHolder.cs
- DebuggerAttributes.cs
- ContentPosition.cs
- WindowsFormsDesignerOptionService.cs
- ExpressionTextBoxAutomationPeer.cs
- ExpressionEditorSheet.cs
- Grant.cs
- ListViewSelectEventArgs.cs
- TextMetrics.cs
- QueryContext.cs
- StringFunctions.cs
- ToolStripPanel.cs
- MenuItemBindingCollection.cs
- WebServiceReceive.cs
- CacheEntry.cs
- KeyGestureConverter.cs
- PersistencePipeline.cs
- _Semaphore.cs
- AssociationEndMember.cs
- SystemIcmpV6Statistics.cs
- Thickness.cs
- DropTarget.cs
- PageAsyncTaskManager.cs
- PenContexts.cs
- GeneralTransform2DTo3D.cs
- CollectionViewProxy.cs
- CommandExpr.cs
- ArgumentNullException.cs
- AdvancedBindingPropertyDescriptor.cs
- FrameworkTextComposition.cs
- ButtonChrome.cs
- BrowserCapabilitiesFactoryBase.cs
- InputLangChangeRequestEvent.cs
- safelinkcollection.cs
- UriWriter.cs
- ScrollItemPattern.cs
- Double.cs
- MultiView.cs
- HtmlInputRadioButton.cs
- EntityTypeBase.cs
- TableLayoutStyleCollection.cs
- XPathNodeHelper.cs
- RemotingException.cs
- HierarchicalDataBoundControlAdapter.cs
- Button.cs
- ClientProxyGenerator.cs
- ColumnWidthChangedEvent.cs
- SspiHelper.cs
- TickBar.cs
- ListenerElementsCollection.cs
- MarkupExtensionReturnTypeAttribute.cs
- IteratorFilter.cs
- OdbcRowUpdatingEvent.cs
- ErrorsHelper.cs
- Blend.cs
- SynchronizationContext.cs
- FixedPosition.cs
- ForeignConstraint.cs
- RuntimeArgumentHandle.cs
- ResourcesChangeInfo.cs
- ChangePassword.cs
- StorageMappingItemCollection.cs
- ColumnClickEvent.cs
- RequestUriProcessor.cs
- CaseInsensitiveOrdinalStringComparer.cs
- HMACMD5.cs
- Int64AnimationUsingKeyFrames.cs
- AssociatedControlConverter.cs
- NameObjectCollectionBase.cs
- SecureStringHasher.cs
- GeometryDrawing.cs
- JsonFormatWriterGenerator.cs
- BindingObserver.cs
- QueryHandler.cs
- FixedPage.cs
- ClientBuildManagerCallback.cs
- WorkerRequest.cs
- XPathBinder.cs
- MergeFilterQuery.cs
- TraceRecord.cs
- TriState.cs
- WebSysDefaultValueAttribute.cs
- hebrewshape.cs
- AuthenticationModuleElement.cs
- InputProcessorProfiles.cs
- WebPartAddingEventArgs.cs
- DataGridPagerStyle.cs
- SortDescriptionCollection.cs
- DocumentGridContextMenu.cs
- QueryOutputWriter.cs
- WindowsListViewGroupSubsetLink.cs
- FlagsAttribute.cs
- Tag.cs
- COM2IDispatchConverter.cs
- NamedPermissionSet.cs
- RegexCharClass.cs
- MetadataPropertyAttribute.cs
- BulletedList.cs
- InputScopeAttribute.cs
- Vector3DValueSerializer.cs