/// <summary>
 /// 如果目标配置存在,则复制之
 /// </summary>
 /// <param name="option"></param>
 internal void CopyByHase(ZeroAppConfig option)
 {
     if (!string.IsNullOrWhiteSpace(option.AddInPath))
     {
         AddInPath = option.AddInPath;
     }
     if (!string.IsNullOrWhiteSpace(option.AddInPath))
     {
         ConfigFolder = option.ConfigFolder;
     }
     if (!string.IsNullOrWhiteSpace(option.LogFolder))
     {
         LogFolder = option.LogFolder;
     }
     if (!string.IsNullOrWhiteSpace(option.DataFolder))
     {
         DataFolder = option.DataFolder;
     }
     if (!string.IsNullOrWhiteSpace(option.StationName))
     {
         StationName = option.StationName;
     }
     if (!string.IsNullOrWhiteSpace(option.ShortName))
     {
         ShortName = option.ShortName;
     }
     if (!string.IsNullOrWhiteSpace(option.ServiceName))
     {
         ServiceName = option.ServiceName;
     }
     if (option.StationIsolate != null)
     {
         StationIsolate = option.StationIsolate;
     }
 }
 /// <summary>
 /// 如果本配置内容为空则用目标配置补全
 /// </summary>
 /// <param name="option"></param>
 public void CopyByEmpty(ZeroAppConfig option)
 {
     if (string.IsNullOrWhiteSpace(AddInPath))
     {
         AddInPath = option.AddInPath;
     }
     if (string.IsNullOrWhiteSpace(ConfigFolder))
     {
         ConfigFolder = option.ConfigFolder;
     }
     if (string.IsNullOrWhiteSpace(LogFolder))
     {
         LogFolder = option.LogFolder;
     }
     if (string.IsNullOrWhiteSpace(DataFolder))
     {
         DataFolder = option.DataFolder;
     }
     if (string.IsNullOrWhiteSpace(StationName))
     {
         StationName = option.StationName;
     }
     if (string.IsNullOrWhiteSpace(ShortName))
     {
         ShortName = option.ShortName;
     }
     if (string.IsNullOrWhiteSpace(ServiceName))
     {
         ServiceName = option.ServiceName;
     }
     if (StationIsolate == null)
     {
         StationIsolate = option.StationIsolate;
     }
 }
Beispiel #3
0
        /// <summary>
        /// 如果目标配置存在,则复制之
        /// </summary>
        /// <param name="option"></param>
        public void CopyByHase(ZeroAppConfig option)
        {
            if (option == null)
            {
                return;
            }

            if (!string.IsNullOrWhiteSpace(option.AppName))
            {
                AppName = option.AppName;
            }
            if (!string.IsNullOrWhiteSpace(option.ApiServiceName))
            {
                ApiServiceName = option.ApiServiceName;
            }
            if (!string.IsNullOrWhiteSpace(option.ShortName))
            {
                ShortName = option.ShortName;
            }

            if (option.MaxIOThreads > 0)
            {
                MaxIOThreads = option.MaxIOThreads;
            }
            if (option.MaxWorkThreads > 0)
            {
                MaxWorkThreads = option.MaxWorkThreads;
            }
            if (option.MaxCloseSecond > 0)
            {
                MaxCloseSecond = option.MaxCloseSecond;
            }
            if (option.IsOpenAccess)
            {
                IsOpenAccess = option.IsOpenAccess;
            }

            if (!string.IsNullOrWhiteSpace(option.AppVersion))
            {
                AppVersion = option.AppVersion;
            }

            if (option.IsolateFolder)
            {
                IsolateFolder = option.IsolateFolder;
            }
        }