예제 #1
0
        private string ParseMembershipTree(StreamReader diagFile, TreeNodeCollection parentNode)
        {
            List <ScriptDumpLine> scriptLines = new List <ScriptDumpLine> ();
            string line;

            while ((line = diagFile.ReadLine()) != null)
            {
                if (line.StartsWith("* ["))
                {
                    // Collect membership script dump lines
                    ScriptDumpLine scriptLine = new ScriptDumpLine(line);
                    scriptLines.Add(scriptLine);
                }
                else if (line.StartsWith("===Membership changes"))
                {
                    DisplayMembershipTree(parentNode, scriptLines);
                    // End of this membership tree
                    return(line);
                }
            }
            if (scriptLines.Count != 0)
            {
                // Display last membership tree
                DisplayMembershipTree(parentNode, scriptLines);
            }
            return("");
        }
예제 #2
0
        private void AddScriptNode(TreeNodeCollection parentNode, ScriptDumpLine scriptLine)
        {
            TreeNode newNode = parentNode.Add(scriptLine.ScriptId,                    // Key
                                              scriptLine.ScriptId + scriptLine.Line); // Display label

            newNode.Tag = scriptLine.ScriptId;
            if (scriptLine.IsMissing())
            {
                newNode.StateImageIndex = 1;
            }
            else if (scriptLine.IsRejected())
            {
                newNode.StateImageIndex = 0;
            }
        }