Example #1
0
        public static IServerManager GetServer(string serverName, string parameters = null)
        {
            NamedValues <ZValue> parameters2 = ParseParameters(parameters);
            bool test = WebData.GetTestValue(parameters2);

            InitServers(test);
            return(ServerManagers_v2.Get(serverName));
        }
Example #2
0
 public static void InitServers_v2(bool test)
 {
     if (!_serverInitialized)
     {
         _serverInitialized = true;
         ServerManagers_v2.Add(TelechargerMagazine.TelechargerMagazine_v3.Create(test));
         ServerManagers_v2.Add(Vosbooks.Vosbooks_v6.Create(test));
     }
 }
Example #3
0
        //public IEnumerable<ServerManager> CreateServerManagers()
        //{
        //    foreach (XElement xe in _xeConfig.zXPathElements("ServerManagers/ServerManager"))
        //    {
        //        ServerManager serverManager = ServerManagers.Get(xe.zExplicitAttribValue("name"));
        //        serverManager.EnableLoadNewPost = xe.zAttribValue("enableLoadNewPost").zTryParseAs(true);
        //        serverManager.EnableSearchPostToDownload = xe.zAttribValue("enableSearchPostToDownload").zTryParseAs(true);
        //        serverManager.DownloadDirectory = xe.zAttribValue("downloadDirectory").zNullIfEmpty();
        //        //Trace.WriteLine("  create server manager \"{0}\" enable load new post {1} enable search post to download {2} download directory \"{3}\"", serverManager.Name, serverManager.EnableLoadNewPost, serverManager.EnableSearchPostToDownload, serverManager.DownloadDirectory);
        //        yield return serverManager;
        //    }
        //}

        public IEnumerable <IServerManager> CreateServerManagers()
        {
            foreach (XElement xe in _xeConfig.zXPathElements("ServerManagers/ServerManager"))
            {
                IServerManager serverManager = ServerManagers_v2.Get(xe.zExplicitAttribValue("name"));
                serverManager.EnableLoadNewDocument          = xe.zAttribValue("enableLoadNewPost").zTryParseAs(true);
                serverManager.EnableSearchDocumentToDownload = xe.zAttribValue("enableSearchPostToDownload").zTryParseAs(true);
                serverManager.DownloadDirectory = xe.zAttribValue("downloadDirectory").zNullIfEmpty();
                //Trace.WriteLine("  create server manager \"{0}\" enable load new post {1} enable search post to download {2} download directory \"{3}\"", serverManager.Name, serverManager.EnableLoadNewPost, serverManager.EnableSearchPostToDownload, serverManager.DownloadDirectory);
                yield return(serverManager);
            }
        }