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
- CacheForPrimitiveTypes.cs
- BamlBinaryReader.cs
- TraceContextEventArgs.cs
- SHA512.cs
- LifetimeManager.cs
- ArraySegment.cs
- ConfigurationElementCollection.cs
- WasHostedComPlusFactory.cs
- CustomAttributeBuilder.cs
- RegexFCD.cs
- RuleSetDialog.cs
- GenericTypeParameterBuilder.cs
- ManagedWndProcTracker.cs
- SettingsBindableAttribute.cs
- XmlMemberMapping.cs
- RuntimeConfigLKG.cs
- CommandPlan.cs
- DataTable.cs
- X509Extension.cs
- SBCSCodePageEncoding.cs
- DefaultAutoFieldGenerator.cs
- TextViewBase.cs
- followingquery.cs
- OnOperation.cs
- DetailsViewRowCollection.cs
- WebPartExportVerb.cs
- StatusBar.cs
- QuaternionKeyFrameCollection.cs
- CodeCommentStatement.cs
- TracingConnectionInitiator.cs
- ConfigurationValue.cs
- XmlRootAttribute.cs
- GridView.cs
- XhtmlStyleClass.cs
- DecoderFallback.cs
- CompensationParticipant.cs
- ClientUtils.cs
- ObjectSpanRewriter.cs
- SubMenuStyleCollection.cs
- Label.cs
- TPLETWProvider.cs
- SQLRoleProvider.cs
- WebPartConnectionsConfigureVerb.cs
- RelationshipFixer.cs
- XmlSerializerFactory.cs
- ProfileManager.cs
- UpdatePanelTrigger.cs
- ControlValuePropertyAttribute.cs
- SystemIPAddressInformation.cs
- StrongTypingException.cs
- DockPatternIdentifiers.cs
- InkCanvasSelectionAdorner.cs
- WebBrowserSiteBase.cs
- ExpandCollapsePattern.cs
- VirtualPath.cs
- SqlClientWrapperSmiStream.cs
- RemotingServices.cs
- WrappedIUnknown.cs
- Serializer.cs
- PeerServiceMessageContracts.cs
- TypeBinaryExpression.cs
- ItemDragEvent.cs
- SafeTimerHandle.cs
- FileChangesMonitor.cs
- X509CertificateCollection.cs
- FacetDescription.cs
- EngineSite.cs
- Expressions.cs
- XmlProcessingInstruction.cs
- DispatcherExceptionEventArgs.cs
- HandlerFactoryCache.cs
- CodeTypeDeclarationCollection.cs
- DefaultValidator.cs
- CompilationLock.cs
- ScriptBehaviorDescriptor.cs
- ComponentDispatcher.cs
- ScrollItemProviderWrapper.cs
- AttributeQuery.cs
- EventArgs.cs
- Point3DIndependentAnimationStorage.cs
- IndependentAnimationStorage.cs
- WebPartEditVerb.cs
- TranslateTransform3D.cs
- XmlCDATASection.cs
- BaseTemplateParser.cs
- Transactions.cs
- ColorTransformHelper.cs
- SchemaCollectionPreprocessor.cs
- SystemEvents.cs
- ViewBase.cs
- SettingsAttributeDictionary.cs
- StrongNameUtility.cs
- MenuEventArgs.cs
- SoapTypeAttribute.cs
- ContextMenu.cs
- VirtualDirectoryMapping.cs
- ParagraphVisual.cs
- ConfigurationStrings.cs
- DateTimeOffset.cs
- SafeCryptHandles.cs