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
- SQLDecimal.cs
- Environment.cs
- TextTreeRootNode.cs
- WorkflowRuntimeServiceElementCollection.cs
- DeferredElementTreeState.cs
- BehaviorEditorPart.cs
- SrgsRule.cs
- TextInfo.cs
- TextSegment.cs
- KeyValueSerializer.cs
- SystemResourceHost.cs
- EpmTargetPathSegment.cs
- URL.cs
- IteratorAsyncResult.cs
- httpstaticobjectscollection.cs
- Vector3DKeyFrameCollection.cs
- ResourceWriter.cs
- AuthenticationException.cs
- InvalidOperationException.cs
- PeerCustomResolverBindingElement.cs
- KeyedHashAlgorithm.cs
- HtmlInputText.cs
- CodeNamespaceImportCollection.cs
- Rotation3DAnimation.cs
- UserUseLicenseDictionaryLoader.cs
- EntityReference.cs
- Module.cs
- ObjectParameter.cs
- AliasExpr.cs
- linebase.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- BuilderInfo.cs
- future.cs
- WmfPlaceableFileHeader.cs
- MethodExpr.cs
- WebPartManagerInternals.cs
- ThicknessConverter.cs
- TextOptionsInternal.cs
- ObjectRef.cs
- WebFaultClientMessageInspector.cs
- SizeConverter.cs
- XPathAncestorIterator.cs
- ParameterElement.cs
- XMLSchema.cs
- InvokeDelegate.cs
- SoapEnumAttribute.cs
- BamlTreeMap.cs
- Control.cs
- WebPartActionVerb.cs
- CollectionType.cs
- MatrixTransform.cs
- ApplicationGesture.cs
- UpnEndpointIdentityExtension.cs
- ExceptionUtil.cs
- SiblingIterators.cs
- WebConfigurationManager.cs
- DomainConstraint.cs
- TheQuery.cs
- dbdatarecord.cs
- CachedFontFamily.cs
- TraceContext.cs
- Int16AnimationUsingKeyFrames.cs
- XmlCollation.cs
- ITextView.cs
- LocalizableAttribute.cs
- NegatedCellConstant.cs
- XmlSchemaAttributeGroupRef.cs
- Focus.cs
- StringComparer.cs
- PropertyMetadata.cs
- ProjectedSlot.cs
- SqlFacetAttribute.cs
- TerminatorSinks.cs
- ComboBoxAutomationPeer.cs
- Table.cs
- SweepDirectionValidation.cs
- AssertUtility.cs
- StylusCaptureWithinProperty.cs
- SimpleHandlerBuildProvider.cs
- ThreadWorkerController.cs
- FontCollection.cs
- safemediahandle.cs
- MatrixAnimationUsingPath.cs
- TargetConverter.cs
- AsyncCompletedEventArgs.cs
- FileLogRecordStream.cs
- AdRotator.cs
- HttpServerVarsCollection.cs
- _AutoWebProxyScriptHelper.cs
- IdentityNotMappedException.cs
- DLinqTableProvider.cs
- HandleRef.cs
- NTAccount.cs
- _LoggingObject.cs
- InstanceLockTracking.cs
- AccessViolationException.cs
- HtmlInputSubmit.cs
- ListenerConnectionModeReader.cs
- RSACryptoServiceProvider.cs
- HttpResponse.cs