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
- PhonemeEventArgs.cs
- TextParagraphView.cs
- HttpModuleCollection.cs
- ClassGenerator.cs
- EnumBuilder.cs
- RepeatInfo.cs
- DbConnectionPool.cs
- UrlMappingCollection.cs
- WeakEventTable.cs
- OperatorExpressions.cs
- RelationshipManager.cs
- Paragraph.cs
- URL.cs
- SqlUtil.cs
- DataGridPageChangedEventArgs.cs
- SystemResourceKey.cs
- TreeNode.cs
- AtlasWeb.Designer.cs
- DefaultExpression.cs
- HyperLinkColumn.cs
- HuffModule.cs
- OwnerDrawPropertyBag.cs
- PathFigureCollection.cs
- _FtpDataStream.cs
- MultipartContentParser.cs
- CompositeScriptReference.cs
- SspiHelper.cs
- DataGridViewCellStyleConverter.cs
- InvalidCastException.cs
- RowSpanVector.cs
- SafeLibraryHandle.cs
- SimpleBitVector32.cs
- TemplateInstanceAttribute.cs
- ProviderManager.cs
- ConsumerConnectionPoint.cs
- SetMemberBinder.cs
- DynamicFilter.cs
- MaskedTextBoxTextEditor.cs
- CallbackCorrelationInitializer.cs
- Vector.cs
- UseManagedPresentationElement.cs
- ChannelManagerService.cs
- SmiSettersStream.cs
- Hash.cs
- RangeContentEnumerator.cs
- __Error.cs
- PeerCollaborationPermission.cs
- GridViewColumnCollectionChangedEventArgs.cs
- SqlTypesSchemaImporter.cs
- AsymmetricSecurityProtocolFactory.cs
- ScrollPattern.cs
- XmlDeclaration.cs
- ThicknessKeyFrameCollection.cs
- TreeNodeConverter.cs
- OwnerDrawPropertyBag.cs
- InputManager.cs
- HandleDictionary.cs
- ContainerParaClient.cs
- SmiXetterAccessMap.cs
- AncillaryOps.cs
- AssociatedControlConverter.cs
- TextDecorationCollection.cs
- StringReader.cs
- DataGridViewSelectedColumnCollection.cs
- NonParentingControl.cs
- StringSorter.cs
- DataGridViewBand.cs
- DataServiceQuery.cs
- DataDesignUtil.cs
- Frame.cs
- KeyManager.cs
- MenuAutomationPeer.cs
- XamlStyleSerializer.cs
- processwaithandle.cs
- StringFunctions.cs
- EventLogLink.cs
- handlecollector.cs
- HttpResponseInternalBase.cs
- DataSourceViewSchemaConverter.cs
- CellPartitioner.cs
- TransformerTypeCollection.cs
- ProfileInfo.cs
- DeleteHelper.cs
- SessionMode.cs
- PlatformCulture.cs
- VectorConverter.cs
- AnnotationElement.cs
- WebServiceErrorEvent.cs
- UmAlQuraCalendar.cs
- StrokeCollection.cs
- OrderedDictionary.cs
- XsltException.cs
- WhereQueryOperator.cs
- _AutoWebProxyScriptHelper.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- UnmanagedHandle.cs
- HttpProfileBase.cs
- SpecialFolderEnumConverter.cs
- PropertyChangingEventArgs.cs
- FormViewUpdateEventArgs.cs