private void dispose(bool disposing)
 {
     if (_disposed)
     {
         if (disposing)
         {
             ClientHub.Dispose();
             ThumbnailMgr.Dispose();
         }
         ClientHub    = null;
         ThumbnailMgr = null;
         _disposed    = true;
     }
 }
        private void UpdateWebApiUrl(string ip)
        {
            string url = $"http://{ip}:{ConfigReader.Instance.WebApiPort}";

            if (ClientHub != null)
            {
                ClientHub.Dispose();
            }
            if (ThumbnailMgr != null)
            {
                ThumbnailMgr.Dispose();
            }

            ClientHub    = new CCTVDefaultInfoSync(url);
            ThumbnailMgr = new ThumbnailManager(url, ConstSettings.ThumbnailPath);
            //集中存储配置信息获取。
            SyncParams <StorageSource> param = new SyncParams <StorageSource>("CenterStorage", Timeout.InfiniteTimeSpan);

            ClientHub.RegisterDefault(CCTVInfoType.HierarchyInfo, TimeSpan.Zero);
            ClientHub.RegisterDefault(CCTVInfoType.StaticInfo, TimeSpan.Zero);
            ClientHub.RegisterDefault(CCTVInfoType.OnlineStatus, TimeSpan.FromSeconds(5));
            ClientHub.RegisterDefault(CCTVInfoType.DynamicInfo, TimeSpan.FromSeconds(5));
            ClientHub.RegisterSynchronizer(param);
        }