Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- DerivedKeySecurityToken.cs
- Property.cs
- MsmqInputChannelListener.cs
- ToolStripDropDownItem.cs
- ComponentCodeDomSerializer.cs
- ButtonField.cs
- SmiEventStream.cs
- DoubleAnimationUsingKeyFrames.cs
- MetadataArtifactLoaderFile.cs
- MouseGestureConverter.cs
- SecurityContextSecurityTokenParameters.cs
- Utils.cs
- ConfigurationElementCollection.cs
- base64Transforms.cs
- ToolboxItemWrapper.cs
- X509AsymmetricSecurityKey.cs
- ProfileModule.cs
- DataTableMapping.cs
- GlyphsSerializer.cs
- CodeGen.cs
- TextModifier.cs
- XpsSerializerFactory.cs
- HtmlLink.cs
- MouseButton.cs
- CriticalHandle.cs
- DecimalAnimationUsingKeyFrames.cs
- VirtualDirectoryMapping.cs
- GeneralTransform3DTo2DTo3D.cs
- CategoryAttribute.cs
- MultipleViewPattern.cs
- TimeSpanMinutesConverter.cs
- ELinqQueryState.cs
- ContractMethodInfo.cs
- EntityViewGenerationAttribute.cs
- PopupEventArgs.cs
- BroadcastEventHelper.cs
- PaperSize.cs
- TokenBasedSet.cs
- ListViewSelectEventArgs.cs
- GenericWebPart.cs
- AdornedElementPlaceholder.cs
- dataSvcMapFileLoader.cs
- Color.cs
- StatusBarPanel.cs
- SoapFormatter.cs
- DataBindEngine.cs
- DrawTreeNodeEventArgs.cs
- SymmetricSecurityProtocolFactory.cs
- XsltException.cs
- ElementsClipboardData.cs
- SqlLiftWhereClauses.cs
- XmlAnyElementAttribute.cs
- CodeAccessPermission.cs
- SharedPerformanceCounter.cs
- PropertyGridCommands.cs
- AnimationClock.cs
- InvocationExpression.cs
- PathStreamGeometryContext.cs
- EnumBuilder.cs
- TreeIterators.cs
- IndexedDataBuffer.cs
- TransactionOptions.cs
- SByteStorage.cs
- ClientUtils.cs
- ModelFunctionTypeElement.cs
- LinqDataSourceDeleteEventArgs.cs
- MultiBinding.cs
- Polygon.cs
- BinaryFormatter.cs
- FixedFindEngine.cs
- DateTimeFormatInfo.cs
- PackWebRequest.cs
- LeafCellTreeNode.cs
- QueryContinueDragEvent.cs
- Size3DValueSerializer.cs
- ColumnCollection.cs
- StyleBamlRecordReader.cs
- ScriptHandlerFactory.cs
- OleDbStruct.cs
- SHA256CryptoServiceProvider.cs
- ClientSideProviderDescription.cs
- SettingsPropertyValue.cs
- TrackingProfile.cs
- SourceInterpreter.cs
- TypeExtensionConverter.cs
- DispatcherExceptionFilterEventArgs.cs
- BaseTemplateParser.cs
- DbConnectionPool.cs
- SimpleNameService.cs
- DataGridViewRowPostPaintEventArgs.cs
- Walker.cs
- DbConnectionPoolOptions.cs
- Wizard.cs
- SqlEnums.cs
- HtmlSelect.cs
- SessionStateUtil.cs
- PersianCalendar.cs
- BuildProviderAppliesToAttribute.cs
- BitVector32.cs
- CultureSpecificCharacterBufferRange.cs