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
- SkewTransform.cs
- ImageClickEventArgs.cs
- CustomAttributeSerializer.cs
- handlecollector.cs
- SemaphoreSecurity.cs
- ActiveDocumentEvent.cs
- WindowsListBox.cs
- SmiContextFactory.cs
- FormViewActionList.cs
- InputDevice.cs
- Button.cs
- TypedTableHandler.cs
- ContainerParagraph.cs
- TypeForwardedFromAttribute.cs
- OutputCacheSettings.cs
- xmlsaver.cs
- TextHidden.cs
- EntityContainerEmitter.cs
- ReliabilityContractAttribute.cs
- Visitor.cs
- ListViewItemEventArgs.cs
- ToolStripMenuItem.cs
- UndirectedGraph.cs
- Matrix.cs
- GroupDescription.cs
- ResolvedKeyFrameEntry.cs
- CroppedBitmap.cs
- DoubleMinMaxAggregationOperator.cs
- EdmItemCollection.cs
- CacheMemory.cs
- HttpDictionary.cs
- CollectionView.cs
- GenericRootAutomationPeer.cs
- XPathParser.cs
- FactorySettingsElement.cs
- DWriteFactory.cs
- URLString.cs
- TextEditorContextMenu.cs
- GACMembershipCondition.cs
- Odbc32.cs
- IndexOutOfRangeException.cs
- EntityDataSourceContainerNameItem.cs
- UshortList2.cs
- ObjectCloneHelper.cs
- EntityDataSourceUtil.cs
- HttpHeaderCollection.cs
- XhtmlBasicPhoneCallAdapter.cs
- RunWorkerCompletedEventArgs.cs
- ScrollItemProviderWrapper.cs
- CompiledScopeCriteria.cs
- XPathBuilder.cs
- ConstructorBuilder.cs
- EntityTransaction.cs
- InternalCompensate.cs
- GeneralTransform3DTo2DTo3D.cs
- AmbiguousMatchException.cs
- Boolean.cs
- dataprotectionpermission.cs
- SoapSchemaMember.cs
- ModuleBuilder.cs
- AlphabeticalEnumConverter.cs
- FirstMatchCodeGroup.cs
- RangeValueProviderWrapper.cs
- MetadataHelper.cs
- hresults.cs
- CompilerState.cs
- CrossAppDomainChannel.cs
- WebServiceData.cs
- XmlHelper.cs
- columnmapkeybuilder.cs
- PeerNeighborManager.cs
- TreeViewCancelEvent.cs
- MenuRendererStandards.cs
- MatrixAnimationUsingKeyFrames.cs
- ComboBoxItem.cs
- ListBoxDesigner.cs
- TypeDescriptionProviderAttribute.cs
- RelationshipEndMember.cs
- PKCS1MaskGenerationMethod.cs
- PreProcessor.cs
- COM2ExtendedTypeConverter.cs
- SqlHelper.cs
- RequestTimeoutManager.cs
- ScrollData.cs
- PolicyUtility.cs
- EventQueueState.cs
- PagesSection.cs
- ErrorRuntimeConfig.cs
- ConnectionPoint.cs
- ErrorTableItemStyle.cs
- DragAssistanceManager.cs
- SqlBuilder.cs
- XmlSortKey.cs
- StringConverter.cs
- HttpDebugHandler.cs
- EmissiveMaterial.cs
- ConfigXmlCDataSection.cs
- ToolStripPanelCell.cs
- Lock.cs
- DeploymentExceptionMapper.cs