本文整理汇总了C#中IConnectionManager.LoadSettings方法的典型用法代码示例。如果您正苦于以下问题:C# IConnectionManager.LoadSettings方法的具体用法?C# IConnectionManager.LoadSettings怎么用?C# IConnectionManager.LoadSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IConnectionManager
的用法示例。
在下文中一共展示了IConnectionManager.LoadSettings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
//Display general Info
printLogo();
Console.Title = "Wolpertinger Fileserver";
Console.WriteLine();
ConsoleHelper.WriteLine(ConsoleColor.Red, " Wolpertinger.FileServer {0}", Assembly.GetExecutingAssembly().GetName().Version.ToString());
ConsoleHelper.WriteLine(ConsoleColor.Red, " Wolpertinger.Core {0}", Assembly.GetAssembly(typeof(DefaultConnectionManager)).GetName().Version.ToString());
Console.WriteLine();
//Set up XmlSerializer
XmlSerializer.RegisterType(typeof(ClientInfo), "clientInfo");
XmlSerializer.RegisterType(typeof(DirectoryObject), "directoryObject");
XmlSerializer.RegisterType(typeof(FileObject), "fileObject");
XmlSerializer.RegisterType(typeof(Permission), "permission");
XmlSerializer.RegisterType(typeof(MountInfo), "mountInfo");
XmlSerializer.RegisterType(typeof(SnapshotInfo), "snapshotInfo");
XmlSerializer.RegisterType(typeof(RemoteMethodCall), "remoteMethodCall");
XmlSerializer.RegisterType(typeof(RemoteMethodResponse), "remoteMethodResponse");
XmlSerializer.RegisterType(typeof(RemoteError), "remoteError");
//Set up logger
LoggerService.SetLogger(new CompositeLogger(new Wolpertinger.Core.ConsoleLogger(), new XmppLogger()));
logger = LoggerService.GetLogger("Wolpertinger.Fileserver");
FileObject.HashingService = HashingService.GetHashingService();
AuthenticationComponent foo = new AuthenticationComponent();
if (!Directory.Exists(Path.GetDirectoryName(folder)))
{
Directory.CreateDirectory(Path.GetDirectoryName(folder));
}
//Set up AppData directory
if (!Directory.Exists(folder))
{
Directory.CreateDirectory(folder);
}
//Set up databasefolder
if (!Directory.Exists(DatabaseFolder))
{
Directory.CreateDirectory(DatabaseFolder);
}
//Initalize ConnectionManager
//TODO manager.AddProfile(Profile.FileServer);
//manager.AddComponent(typeof(ClientInfoProvider), typeof(XmppLoggingConfigurator), typeof(FileShare));
connectionManager = new DefaultConnectionManager();
//connectionManager.ComponentFactory = new DefaultComponentFactory();
connectionManager.LoadSettings(folder);
//connectionManager.Connect();
connectionManager.AcceptIncomingConnections = true;
XmppLogger.ConnectionManager = connectionManager;
XmppLogger.LoadSettings();
//Load setting specific to this role
connectionManager.WolpertingerUsername = settingsFile.GetItem<string>("AdminUsername");
connectionManager.WolpertingerPassword = settingsFile.GetItem<string>("AdminPassword").ToSecureString();
FileShareServerComponent.Init();
//Console.WriteLine("Account: " + connectionManager.XmppUsername + "@" + connectionManager.XmppServer);
Console.ReadLine();
}