本文整理汇总了C#中ServiceContainer.SetSplashMessage方法的典型用法代码示例。如果您正苦于以下问题:C# ServiceContainer.SetSplashMessage方法的具体用法?C# ServiceContainer.SetSplashMessage怎么用?C# ServiceContainer.SetSplashMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServiceContainer
的用法示例。
在下文中一共展示了ServiceContainer.SetSplashMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main()
{
TraceVerbose("Instance startup");
try
{
Console.WriteLine(
@"Janus project. Copyright (C) 2002-2012 by Rsdn Team. " +
@"See rsdn.ru for more information.");
// Проверка на единственность экземпляра приложения.
bool cn;
using (var m = new Mutex(true, "JanusRunningInstanceDetectionMutex", out cn))
{
if (!m.WaitOne(0, false))
{
WindowActivator.ActivateWindow(MainForm.GetCaption());
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Создаем контрол, чтобы инициализировать винформсный констекст синхронизации,
// если он еще не инициализирован
using (new Control()) { }
Thread.CurrentThread.CurrentUICulture = new CultureInfo((int)Config.Instance.UILanguage);
if (!CheckEnvironment())
return;
TraceVerbose("ResMgr");
var rootManager = new ServiceContainer(true);
rootManager.Publish<IUIShell>(
new UIShell(
() => ApplicationManager.Instance.MainForm,
freeze => ApplicationManager.Instance.MainForm.Enabled = freeze));
if (Config.Instance.ShowSplash)
{
EventHandler hider = null;
IDisposable informerCookie = null;
IDisposable progressCookie = null;
hider =
(sender, e) =>
{
progressCookie?.Dispose();
rootManager.Publish<IProgressService>(
new DefaultProgressService(rootManager));
informerCookie?.Dispose();
SplashHelper.Hide();
Application.Idle -= hider;
// ReSharper restore AccessToModifiedClosure
};
Application.Idle += hider;
informerCookie = rootManager.Publish(
SplashHelper.Show(rootManager));
progressCookie = rootManager.Publish(
SplashHelper.GetProgressService());
//Thread.Sleep(20000);
}
else
rootManager.Publish<IProgressService>(
new DefaultProgressService(rootManager));
using (var host = new JanusHost(rootManager))
{
using (host.InitScope())
{
rootManager.SetSplashMessage(SR.Splash.ApplicationStart);
TraceVerbose("JanusHost");
// Подписка сервиса на извещения об изменении конфигурации.
var configChangedNotifier = host.GetRequiredService<ConfigChangedNotifier>();
Config.Instance.ConfigChanged +=
(o, args) => configChangedNotifier.FireConfigChanged(Config.Instance);
try
{
//Проверка наличия пользователя
if (!LocalUser.UserExists())
using (var ouf = new OptionsUserForm(host, true))
ouf.ShowDialog();
rootManager.SetSplashMessage(SR.Splash.CheckDatabase);
if (!DBSchemaManager.CheckDB(host))
{
// User cancelled.
//
//.........这里部分代码省略.........