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
- XsdBuildProvider.cs
- WizardStepCollectionEditor.cs
- NameObjectCollectionBase.cs
- ParentUndoUnit.cs
- RangeValidator.cs
- ReadOnlyDataSource.cs
- UndirectedGraph.cs
- ParameterCollection.cs
- precedingquery.cs
- ThreadPool.cs
- ToolStripPanelCell.cs
- EdmProperty.cs
- WindowsGrip.cs
- SparseMemoryStream.cs
- CalendarSelectionChangedEventArgs.cs
- WebPartCollection.cs
- SecurityTimestamp.cs
- StandardCommands.cs
- FontFamilyConverter.cs
- ApplicationFileCodeDomTreeGenerator.cs
- XpsFontSerializationService.cs
- Typography.cs
- RemotingAttributes.cs
- WebPartEditVerb.cs
- WasHostedComPlusFactory.cs
- _NegoStream.cs
- TTSEvent.cs
- GrammarBuilder.cs
- RbTree.cs
- BitmapCodecInfoInternal.cs
- FormViewModeEventArgs.cs
- DataGridView.cs
- UInt16Storage.cs
- GlyphTypeface.cs
- NetworkInformationException.cs
- Span.cs
- TraceData.cs
- HtmlButton.cs
- TableProvider.cs
- Win32.cs
- SecurityCriticalDataForSet.cs
- DataGridViewCellStyleConverter.cs
- IInstanceTable.cs
- DBPropSet.cs
- _ChunkParse.cs
- WebCategoryAttribute.cs
- BulletedListEventArgs.cs
- X509CertificateCollection.cs
- WebPartZone.cs
- CounterSample.cs
- TextDecorations.cs
- SerializableReadOnlyDictionary.cs
- SerialErrors.cs
- PersonalizationProviderHelper.cs
- MembershipSection.cs
- RouteTable.cs
- Line.cs
- Configuration.cs
- NetStream.cs
- XPathAncestorIterator.cs
- SqlHelper.cs
- XmlDigitalSignatureProcessor.cs
- EntitySetBaseCollection.cs
- GridItemPattern.cs
- VisualBrush.cs
- GetTokenRequest.cs
- ListViewUpdatedEventArgs.cs
- PropertyDescriptorGridEntry.cs
- SapiAttributeParser.cs
- CharEnumerator.cs
- ZipQueryOperator.cs
- JsonSerializer.cs
- ReadContentAsBinaryHelper.cs
- ResourceExpressionEditorSheet.cs
- RegionInfo.cs
- OdbcConnectionHandle.cs
- HealthMonitoringSection.cs
- HtmlTableCell.cs
- TraceUtils.cs
- XmlAnyElementAttributes.cs
- VirtualPath.cs
- DataControlFieldTypeEditor.cs
- DesignerActionGlyph.cs
- contentDescriptor.cs
- Assembly.cs
- SyntaxCheck.cs
- UriTemplateEquivalenceComparer.cs
- ConstraintEnumerator.cs
- NumberSubstitution.cs
- SoapIgnoreAttribute.cs
- WhitespaceRuleLookup.cs
- CheckBoxRenderer.cs
- ReadOnlyAttribute.cs
- Table.cs
- TableCell.cs
- NamespaceEmitter.cs
- BitConverter.cs
- SiteMembershipCondition.cs
- ReachIDocumentPaginatorSerializer.cs
- ValidatedMobileControlConverter.cs