public CCTVHierarchyNode GetHierarchyRoot() { _hub.UpdateDefault(CCTVInfoType.HierarchyInfo); CCTVHierarchyNode[] nodes = _hub.GetAllHierarchyRoots(); if (nodes != null && nodes.Length > 0) { if (nodes.Length == 1) { return(nodes[0]); } else { return(new CCTVHierarchyNode() { Id = Guid.NewGuid().ToString(), Type = NodeType.Server, Name = "虚拟节点", Children = nodes }); } } else { return(null); } }
private CCTVInfo getCCTVInfo() { if (_autoGenHub) { _clientHub.UpdateDefault(CCTVInfoType.GlobalInfo); } CCTVGlobalInfo gInfo = _clientHub.GetGlobalInfo(); if (gInfo != null) { if (_cctvInfo == null || _cctvInfo.ServerHost != gInfo.CCTV1Host) { if (_cctvInfo != null) { _cctvInfo.Stop(); } _cctvInfo = new CCTVInfo(gInfo.CCTV1Host); _cctvInfo.Start(); } } return(_cctvInfo); }