Example #1
0
        private void UpdateHistoryPage(RobloxDeployLogBranch deployBranch)
        {
            string branch = deployBranch.Name;
            List <RobloxDeployLog> deployLogs = deployBranch.Logs;
            TabPage  page = deployBranch.HistoryPage;
            TreeView tree = (TreeView)page.Controls[branch + "_Tree"];

            foreach (RobloxDeployType deployType in Enum.GetValues(typeof(RobloxDeployType)))
            {
                List <RobloxDeployLog> deployTypedLogs = deployLogs
                                                         .Where(log => log.DeployType == deployType)
                                                         .ToList();

                deployTypedLogs.Sort();

                string   type = deployType.ToString();
                TreeNode root = tree.Nodes[type];
                if (root == null)
                {
                    root = tree.Nodes.Add(type, type);
                }

                foreach (RobloxDeployLog deployLog in deployTypedLogs)
                {
                    RobloxVersionInfo info    = deployLog.VersionInfo;
                    string            name    = deployLog.DeployTime.ToString("MM/dd/yyyy hh:mm:ss tt");
                    TreeNode          logNode = root.Nodes[name];
                    if (logNode == null)
                    {
                        logNode = root.Nodes.Insert(0, name, name);

                        TreeNode versionNode =
                            logNode.Nodes.Add("Version Info: " + info.ToString());

                        if (info.Available)
                        {
                            versionNode.Nodes.Add("Generation: " + info.Generation);
                            versionNode.Nodes.Add("Version:    " + info.Version);
                            versionNode.Nodes.Add("Patch:      " + info.Patch);
                            versionNode.Nodes.Add("Commit:     " + info.Commit);
                        }

                        logNode.Nodes.Add("GUID:         " + deployLog.VersionGuid);
                        logNode.Nodes.Add("Deploy Time:  " + name);
                    }
                }
            }
        }
Example #2
0
        public static void AddDeployLogs(RobloxDeployLogBranch branch, List <string> deployLogs)
        {
            foreach (string log in deployLogs)
            {
                Match    match = Regex.Match(log, MatchPattern);
                string[] data  = match.Groups.Cast <Group>()
                                 .Select(group => group.Value)
                                 .Where(value => value.Length != 0)
                                 .ToArray();

                RobloxDeployLog deployLog  = new RobloxDeployLog();
                string          deployType = data[1];

                if (Enum.TryParse(deployType, out deployLog.DeployType))
                {
                    deployLog.SourceLog   = data[0];
                    deployLog.VersionGuid = data[2];
                    deployLog.DeployTime  = DateTime.Parse(data[3], CultureInfo.InvariantCulture);

                    if (data.Length > 4)
                    {
                        RobloxVersionInfo versionInfo = new RobloxVersionInfo {
                            Available = true
                        };
                        int.TryParse(data[5], out versionInfo.Generation);
                        int.TryParse(data[6], out versionInfo.Version);
                        int.TryParse(data[7], out versionInfo.Patch);
                        int.TryParse(data[8], out versionInfo.Commit);

                        deployLog.VersionInfo = versionInfo;
                    }

                    branch.Logs.Add(deployLog);
                }
            }
        }