本文整理汇总了C#中Setting.Load方法的典型用法代码示例。如果您正苦于以下问题:C# Setting.Load方法的具体用法?C# Setting.Load怎么用?C# Setting.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting.Load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
/// <summary>
/// Server Main Entry Point - Initialize as many things as possible here.
/// Order is important here, any additional initialization should be place at the bottom.
/// </summary>
/// <param name="Directory">Start Directory.</param>
public static void Start(string Directory)
{
try
{
// Initialize Setting
Setting = new Setting(Directory);
// Initialize Logger.
Logger = new LoggerCollection();
Logger.Start();
if (Setting.Load())
{
Setting.Save();
}
else
{
Setting.Save();
Environment.Exit(0);
return;
}
// Initialize Updater
if (Setting.CheckForUpdate)
{
Updater = new Updater();
Updater.Update();
}
if (Setting.MainEntryPoint == Setting.MainEntryPointType.jianmingyong_Server)
{
// Initialize Listener.
Listener = new Server_Client_Listener.Servers.Listener();
Listener.Start();
// Initialize RCONListener.
if (Setting.RCONEnable)
{
RCONListener = new RCON_Client_Listener.Servers.Listener();
RCONListener.Start();
}
// Initialize SCONListener.
if (Setting.SCONEnable)
{
SCONListener = new SCON_Client_Listener.Servers.ModuleSCON();
SCONListener.Start();
//Logger.Log("SCON have been disabled due to incompatible update. Sorry for the inconvience caused.", Server_Client_Listener.Loggers.Logger.LogTypes.Info);
}
// Initialize Nancy.
if (Setting.NancyEnable)
{
var dataApi = new NancyData();
dataApi.Add("online", GetOnlineClients);
NancyImpl.SetDataApi(dataApi);
NancyImpl.Start(Setting.NancyHost, Setting.NancyPort);
}
}
// Initialize Command.
Command = new CommandCollection();
Command.AddCommand();
}
catch (Exception ex)
{
ex.CatchError();
}
}