Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / RTLAwareMessageBox.cs / 1305376 / RTLAwareMessageBox.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.Windows.Forms {
using System;
using System.Windows.Forms;
///
///
///
/// The Show method displays a message box that can contain text, buttons, and symbols that
/// inform and instruct the user. This MessageBox will be RTL, if the resources
/// for this dll have been localized to a RTL language.
///
///
internal sealed class RTLAwareMessageBox {
///
///
///
/// Displays a message box with specified text, caption, and style.
/// Makes the dialog RTL if the resources for this dll have been localized to a RTL language.
///
///
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton, MessageBoxOptions options) {
if (RTLAwareMessageBox.IsRTLResources) {
options |= (MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading);
}
return MessageBox.Show(owner, text, caption, buttons, icon, defaultButton, options);
}
///
/// Tells whether the current resources for this dll have been
/// localized for a RTL language.
///
public static bool IsRTLResources {
get {
return SR.GetString(SR.RTL) != "RTL_False";
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.Windows.Forms {
using System;
using System.Windows.Forms;
///
///
///
/// The Show method displays a message box that can contain text, buttons, and symbols that
/// inform and instruct the user. This MessageBox will be RTL, if the resources
/// for this dll have been localized to a RTL language.
///
///
internal sealed class RTLAwareMessageBox {
///
///
///
/// Displays a message box with specified text, caption, and style.
/// Makes the dialog RTL if the resources for this dll have been localized to a RTL language.
///
///
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton, MessageBoxOptions options) {
if (RTLAwareMessageBox.IsRTLResources) {
options |= (MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading);
}
return MessageBox.Show(owner, text, caption, buttons, icon, defaultButton, options);
}
///
/// Tells whether the current resources for this dll have been
/// localized for a RTL language.
///
public static bool IsRTLResources {
get {
return SR.GetString(SR.RTL) != "RTL_False";
}
}
}
}
// 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
- NetworkInformationException.cs
- AlignmentXValidation.cs
- GroupBox.cs
- Range.cs
- LambdaCompiler.ControlFlow.cs
- NotificationContext.cs
- SystemMulticastIPAddressInformation.cs
- DateTimeConstantAttribute.cs
- InlineObject.cs
- ForceCopyBuildProvider.cs
- GroupItem.cs
- FloaterBaseParaClient.cs
- Span.cs
- FunctionUpdateCommand.cs
- ConnectionStringSettings.cs
- XsltCompileContext.cs
- _UriSyntax.cs
- MarshalByRefObject.cs
- DataProtection.cs
- IPGlobalProperties.cs
- StreamGeometryContext.cs
- RepeatBehavior.cs
- VisualProxy.cs
- CommandConverter.cs
- StartUpEventArgs.cs
- WebBrowserNavigatedEventHandler.cs
- ReadOnlyMetadataCollection.cs
- RijndaelManaged.cs
- Int32CollectionValueSerializer.cs
- ChangeTracker.cs
- NativeWindow.cs
- Binding.cs
- Encoder.cs
- DesignTimeParseData.cs
- Number.cs
- SettingsPropertyNotFoundException.cs
- RecognizerBase.cs
- InstalledVoice.cs
- IndexExpression.cs
- ConfigurationLocationCollection.cs
- LayoutExceptionEventArgs.cs
- RawMouseInputReport.cs
- ReflectionUtil.cs
- CryptoKeySecurity.cs
- UpdateTracker.cs
- MediaContextNotificationWindow.cs
- XmlNodeReader.cs
- RawStylusInputCustomData.cs
- CompilerInfo.cs
- Win32KeyboardDevice.cs
- ParserStack.cs
- PlainXmlWriter.cs
- DrawListViewItemEventArgs.cs
- CoreChannel.cs
- GenericParameterDataContract.cs
- SatelliteContractVersionAttribute.cs
- Baml2006Reader.cs
- X509CertificateValidator.cs
- AppSettings.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- WarningException.cs
- SynchronizationFilter.cs
- DeferredRunTextReference.cs
- FormViewRow.cs
- ConnectionOrientedTransportChannelFactory.cs
- TextRenderingModeValidation.cs
- BufferedStream.cs
- TableLayoutSettingsTypeConverter.cs
- Tuple.cs
- TemplateEditingVerb.cs
- ClientScriptManagerWrapper.cs
- TextTabProperties.cs
- SchemaImporterExtension.cs
- PasswordTextNavigator.cs
- ViewGenResults.cs
- MappingMetadataHelper.cs
- Rule.cs
- SqlWriter.cs
- SchemaType.cs
- PropertyMapper.cs
- counter.cs
- RawMouseInputReport.cs
- BooleanToVisibilityConverter.cs
- CurrentTimeZone.cs
- ApplyImportsAction.cs
- PermissionSetTriple.cs
- DataGridViewCellFormattingEventArgs.cs
- BamlResourceContent.cs
- IndentedWriter.cs
- SnapLine.cs
- ToolStripSettings.cs
- DrawingContextDrawingContextWalker.cs
- ClientScriptItem.cs
- ToolStripSeparator.cs
- SrgsToken.cs
- TransformerInfo.cs
- OracleConnectionStringBuilder.cs
- CurrencyManager.cs
- GridViewRowEventArgs.cs
- TimelineCollection.cs