private void getOnlineStatus(Dictionary <string, OnlineStatus> onlineDict, VideoParser.Node node) { string nodeId = getNodeId(node.Id); onlineDict[nodeId] = new OnlineStatus() { NodeId = nodeId, Online = node.Online }; VideoParser.Server server = node as VideoParser.Server; if (server != null) { if (server.Childs != null) { foreach (VideoParser.Node child in server.Childs) { getOnlineStatus(onlineDict, child); } } } else { VideoParser.Front front = node as VideoParser.Front; if (front != null) { if (front.Childs != null) { foreach (VideoParser.Video child in front.Childs) { getOnlineStatus(onlineDict, child); } } } } }
private void getOnlineStatus(Dictionary <string, OnlineStatus> onlineDict, VideoParser.Video video) { string videoId = getNodeId(video.Id); onlineDict[videoId] = new OnlineStatus() { NodeId = videoId, Online = video.Online }; }