当前位置: 首页>>代码示例>>C#>>正文


C# IConnectionManager.LoadSettings方法代码示例

本文整理汇总了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();
        }
开发者ID:ap0llo,项目名称:wolpertinger,代码行数:69,代码来源:Program.cs


注:本文中的IConnectionManager.LoadSettings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。