学习010-04-04-05 Localize a Splash Form (WinForms)(本地化启动窗体(Windows 窗体))

Localize a Splash Form (WinForms)(本地化启动窗体(Windows 窗体))

Use one of the approaches below to localize splash forms that have customizable text: a Splash Screen or a Wait Form.
使用以下方法之一来本地化具有可自定义文本的启动窗体:启动屏幕或等待窗体。

Tip
Do not use the standard XAF localization approach to localize splash forms. This approach requires the Application Model. The Application Model is not available on startup, when some splash forms are shown.
不要使用标准的XAF本地化方法来本地化 启动窗体。这种方法需要应用程序模型。当显示某些 启动窗体时,应用程序模型在启动时不可用。

Use the SetDisplayText Method to Localize ISplash Descendants(使用SetDisplayText方法本地化ISplash后代)

Use this approach for splash forms that support the ISplash interface.
对支持ISplash接口的启动窗体使用此方法。

Open the Program.cs file in the WinForms Application project. Call the ISplash.SetDisplayText method before methods that start the application. Specify the text you require. A Splash Screen or a Wait Form that is currently open displays this text.
在WinForms Application项目中打开Program. cs文件。在启动应用程序的方法之前调用ISplash.SetDisplayText方法。指定您需要的文本。当前打开的启动屏幕或等待窗体会显示此文本。

C# 
static class Program {
    // ...
    static void Main() {
        // ...
        MySolutionWindowsFormsApplication winApplication = 
            new MySolutionWindowsFormsApplication();
        // ...
        try {
            winApplication.SplashScreen.SetDisplayText("Custom Text");
            winApplication.Setup();
            winApplication.Start();
            // ...
        }
    }
}

You can also customize text as described in the Customize the Default Splash Screen section.
您还可以按照自定义默认启动画面部分中的说明自定义文本。

Use the UpdateStatus Method to Localize ISupportUpdateSplash Descendants(使用Updatestatus方法本地化ISupportUpdateSplash后代)

To localize splash forms that support the ISupportUpdateSplash interface, use one of the following approaches:
要本地化支持ISupportUpdateSplash接口的启动窗体,请使用以下方法之一:

  • Localize Status Messages Manually
    手动本地化状态消息
  • Use Satellite Assemblies to Localize Status Messages
    使用附属程序集本地化状态消息

Localize Status Messages Manually(手动本地化状态消息)

Access the WinApplication.cs file in the WinForms Application project. Override the WinApplication.UpdateStatus method. To determine the current context, compare the context parameter with one of the ApplicationStatusMessageId enumeration values.
访问WinForms Application项目中的WinApplication. cs文件。覆盖WinApplication.Updatestatus方法。要确定当前上下文,请将上下文参数与ApplicationStatusMessageId枚举值之一进行比较。

C# 
using DevExpress.ExpressApp.Localization;
// ...
namespace MySolution.Win {
    public partial class MySolutionWindowsFormsApplication : WinApplication {
        // ...
        public override void UpdateStatus(
            string context, string title, string message, params object[] additionalParams) {
            if(context == ApplicationStatusMesssageId.ApplicationSetupStarted.ToString()) {
                title = "My localized title";
                message = "My localized message";
            }
            base.UpdateStatus(context, title, message, additionalParams);
        }
    }
}

Use Satellite Assemblies to Localize Status Messages(使用附属程序集本地化状态消息)

XAF can retrieve localized messages from the DevExpress.ExpressApp.v24.1.resources.dll satellite assembly and assign them to the ApplicationStatusMessageId enum values.
XAF可以从DevExpress. ExpressApp.v24.1.Resources.dll附属程序集中检索本地化消息,并将它们分配给ApplicationStatusMessageId枚举值。

Satellite assemblies for German (de), Spanish (es), and Japanese (ja) languages are installed in %PROGRAMFILES%\DevExpress 24.1\Components\Bin folder and GAC. You can download satellite assemblies for other languages from the DevExpress Localization Service. Refer to the How to: Install an assembly into the global assembly cache article for more information on how to register satellite assemblies in the GAC.
德语(de)、西班牙语(es)和日语(ja)语言的附属程序集安装在%PROGRAMFILES%\DevExpress 24.1\Components\bin文件夹和GAC中。您可以从DevExpress本地化服务下载其他语言的附属程序集。有关如何在GAC中注册附属程序集的更多信息,请参阅如何:将程序集安装到全局程序集缓存一文。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

汤姆•猫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值