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
- SqlDataSourceEnumerator.cs
- BinaryUtilClasses.cs
- CqlErrorHelper.cs
- MultiAsyncResult.cs
- HMACSHA512.cs
- MappedMetaModel.cs
- HtmlInputButton.cs
- XPathAxisIterator.cs
- XmlSchemaAppInfo.cs
- MaskedTextBox.cs
- GeometryModel3D.cs
- DbConnectionPoolOptions.cs
- SamlAuthorizationDecisionStatement.cs
- SystemColorTracker.cs
- ParameterCollection.cs
- XmlArrayItemAttribute.cs
- DeclaredTypeValidator.cs
- FloatSumAggregationOperator.cs
- TextDpi.cs
- UInt64Converter.cs
- WizardForm.cs
- UInt32Storage.cs
- CustomAttributeBuilder.cs
- SymbolType.cs
- HtmlInputButton.cs
- ErrorInfoXmlDocument.cs
- ChannelBinding.cs
- DataServiceRequestArgs.cs
- XamlToRtfWriter.cs
- Thickness.cs
- ConnectionsZone.cs
- InkCanvasFeedbackAdorner.cs
- StretchValidation.cs
- EmptyEnumerator.cs
- WebZone.cs
- StructuredTypeEmitter.cs
- CodeBlockBuilder.cs
- DataViewManagerListItemTypeDescriptor.cs
- FormParameter.cs
- SecurityContextKeyIdentifierClause.cs
- ContentElementCollection.cs
- AsyncPostBackTrigger.cs
- AdCreatedEventArgs.cs
- DataGridViewCellParsingEventArgs.cs
- mediaeventargs.cs
- OleDbPermission.cs
- MenuAdapter.cs
- PlainXmlSerializer.cs
- PrimitiveType.cs
- CommandConverter.cs
- CopyOfAction.cs
- EntityConnectionStringBuilderItem.cs
- CodeCompiler.cs
- NamespaceList.cs
- ComplexObject.cs
- RuntimeConfig.cs
- SignedXml.cs
- PrintPageEvent.cs
- _NegoState.cs
- Schema.cs
- InputMethodStateTypeInfo.cs
- SR.cs
- XmlAnyElementAttributes.cs
- NativeWindow.cs
- FocusTracker.cs
- PermissionSet.cs
- DataColumnSelectionConverter.cs
- StorageRoot.cs
- TextRangeEdit.cs
- WindowsScrollBar.cs
- HtmlSelect.cs
- Page.cs
- followingsibling.cs
- PageCatalogPart.cs
- Utils.cs
- WebPartConnectionsDisconnectVerb.cs
- TypedRowHandler.cs
- Columns.cs
- InnerItemCollectionView.cs
- Scheduler.cs
- NameTable.cs
- WorkflowOperationErrorHandler.cs
- StrokeRenderer.cs
- ConsumerConnectionPointCollection.cs
- SortedDictionary.cs
- OracleParameterCollection.cs
- SchemaType.cs
- wgx_render.cs
- RemoteHelper.cs
- VSWCFServiceContractGenerator.cs
- EntityObject.cs
- XmlDataSourceView.cs
- AutoSizeComboBox.cs
- Compiler.cs
- XPathAxisIterator.cs
- XmlNamedNodeMap.cs
- DataBindingList.cs
- mactripleDES.cs
- TextElementCollectionHelper.cs
- AmbientEnvironment.cs