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
- _ProxyRegBlob.cs
- XmlAtomicValue.cs
- MatrixKeyFrameCollection.cs
- SessionEndingEventArgs.cs
- DeflateEmulationStream.cs
- HtmlShimManager.cs
- HtmlTitle.cs
- ListViewGroupItemCollection.cs
- XmlMemberMapping.cs
- Accessors.cs
- AdapterDictionary.cs
- BitmapPalettes.cs
- PeerServiceMessageContracts.cs
- SHA384.cs
- TdsEnums.cs
- CacheDependency.cs
- PolicyReader.cs
- DiffuseMaterial.cs
- InsufficientMemoryException.cs
- RawStylusInputCustomData.cs
- SafeProcessHandle.cs
- EditorResources.cs
- CustomDictionarySources.cs
- XpsFilter.cs
- ExpressionTextBox.xaml.cs
- ResourceType.cs
- BinaryMessageEncoder.cs
- SwitchLevelAttribute.cs
- CLSCompliantAttribute.cs
- DbProviderFactory.cs
- _Connection.cs
- BindingNavigator.cs
- CodeChecksumPragma.cs
- ChameleonKey.cs
- BrowserPolicyValidator.cs
- Switch.cs
- ObjectTypeMapping.cs
- Material.cs
- SqlClientWrapperSmiStreamChars.cs
- SchemaObjectWriter.cs
- DrawingContext.cs
- MouseOverProperty.cs
- VirtualizedCellInfoCollection.cs
- SqlWorkflowInstanceStoreLock.cs
- _UriSyntax.cs
- AppDomainShutdownMonitor.cs
- WeakReferenceEnumerator.cs
- TextInfo.cs
- SqlDataSourceFilteringEventArgs.cs
- ModifierKeysConverter.cs
- BindingContext.cs
- ObjectAnimationUsingKeyFrames.cs
- RenderContext.cs
- PersonalizationStateInfoCollection.cs
- XmlSchemaObjectCollection.cs
- TriggerCollection.cs
- XPathParser.cs
- EditorServiceContext.cs
- CaseKeyBox.xaml.cs
- XslUrlEditor.cs
- TabOrder.cs
- WmlControlAdapter.cs
- MediaElementAutomationPeer.cs
- GeneralTransform3DCollection.cs
- StylusTouchDevice.cs
- LogicalChannelCollection.cs
- ActivityExecutor.cs
- CodeGen.cs
- MulticastNotSupportedException.cs
- CommentEmitter.cs
- PlainXmlWriter.cs
- IERequestCache.cs
- TreeSet.cs
- RequestTimeoutManager.cs
- TreeNodeSelectionProcessor.cs
- TableHeaderCell.cs
- CustomAttributeFormatException.cs
- WebPartAddingEventArgs.cs
- Version.cs
- AppSecurityManager.cs
- SplitterPanelDesigner.cs
- ObjectStorage.cs
- ImageFormatConverter.cs
- BaseCollection.cs
- TextTreeInsertElementUndoUnit.cs
- CollectionViewGroupInternal.cs
- ElementNotAvailableException.cs
- DesignerImageAdapter.cs
- FocusWithinProperty.cs
- OrderedDictionaryStateHelper.cs
- NameScope.cs
- FindResponse.cs
- __Filters.cs
- TextLine.cs
- ToolStripItemTextRenderEventArgs.cs
- UpdateTracker.cs
- ObjectFullSpanRewriter.cs
- IISUnsafeMethods.cs
- SamlAudienceRestrictionCondition.cs
- NamespaceEmitter.cs