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
- AsyncOperationManager.cs
- WebPartEventArgs.cs
- RepeatEnumerable.cs
- lengthconverter.cs
- ExtenderControl.cs
- MemberListBinding.cs
- XmlChildEnumerator.cs
- FormViewUpdateEventArgs.cs
- DataTransferEventArgs.cs
- RewritingValidator.cs
- Typeface.cs
- HandlerWithFactory.cs
- FlatButtonAppearance.cs
- LassoSelectionBehavior.cs
- FusionWrap.cs
- GB18030Encoding.cs
- WebPartZoneBase.cs
- PropertyInfo.cs
- IisTraceWebEventProvider.cs
- DBConnection.cs
- GenericTransactionFlowAttribute.cs
- XPathDescendantIterator.cs
- ImportCatalogPart.cs
- XmlILOptimizerVisitor.cs
- SHA256Managed.cs
- Visual3DCollection.cs
- WaitHandleCannotBeOpenedException.cs
- DynamicHyperLink.cs
- HtmlTableRowCollection.cs
- PriorityQueue.cs
- SmtpNegotiateAuthenticationModule.cs
- PropertyOverridesTypeEditor.cs
- FillErrorEventArgs.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- __TransparentProxy.cs
- IgnoreFlushAndCloseStream.cs
- ArraySegment.cs
- OrderedDictionaryStateHelper.cs
- SmiMetaData.cs
- TextDecoration.cs
- ControlAdapter.cs
- Attributes.cs
- ExceptionTranslationTable.cs
- ContextDataSourceContextData.cs
- BooleanAnimationBase.cs
- AlignmentXValidation.cs
- WebProxyScriptElement.cs
- ConnectionInterfaceCollection.cs
- Mutex.cs
- GraphicsState.cs
- MexHttpsBindingElement.cs
- CryptoApi.cs
- DataGridTemplateColumn.cs
- DataGridViewAdvancedBorderStyle.cs
- PartitionResolver.cs
- StrokeCollectionDefaultValueFactory.cs
- NumberAction.cs
- KeySplineConverter.cs
- ReadonlyMessageFilter.cs
- VectorAnimationUsingKeyFrames.cs
- AssemblyName.cs
- PartialCachingControl.cs
- X509SecurityTokenAuthenticator.cs
- DataGridPageChangedEventArgs.cs
- XPathChildIterator.cs
- GridViewHeaderRowPresenter.cs
- HierarchicalDataBoundControl.cs
- XappLauncher.cs
- CopyEncoder.cs
- DbConnectionPoolIdentity.cs
- DocumentApplicationJournalEntry.cs
- HttpEncoderUtility.cs
- SplashScreen.cs
- IncrementalHitTester.cs
- ListViewDesigner.cs
- CodeAttachEventStatement.cs
- VScrollProperties.cs
- SqlResolver.cs
- TreeViewImageKeyConverter.cs
- Processor.cs
- Adorner.cs
- SafeUserTokenHandle.cs
- CoreSwitches.cs
- XmlDataSourceView.cs
- TextSimpleMarkerProperties.cs
- CompilerInfo.cs
- EntityTypeEmitter.cs
- Clock.cs
- SerializationAttributes.cs
- SystemIcons.cs
- ErrorHandlingReceiver.cs
- EnumerableCollectionView.cs
- OracleColumn.cs
- WorkflowEnvironment.cs
- DataGridViewElement.cs
- _LazyAsyncResult.cs
- TypedTableBaseExtensions.cs
- ScriptResourceAttribute.cs
- DeflateEmulationStream.cs
- XmlILIndex.cs