Ejemplo n.º 1
0
 /// <summary>
 /// Process the output of the vertarget command.
 /// </summary>
 /// <param name="analysis">The results structure to update.</param>
 /// <param name="commandOutput">The result data to analyze.</param>
 private static void processVerTargetResults(StackHashDumpAnalysis analysis, StackHashScriptLineResult commandOutput)
 {
     foreach (String line in commandOutput.ScriptLineOutput)
     {
         String value = null;
         if ((value = GetColonOption(line, "System Uptime")) != null)
         {
             analysis.SystemUpTime = value;
         }
         else if ((value = GetColonOption(line, "Process Uptime")) != null)
         {
             analysis.ProcessUpTime = value;
         }
         else if (line.StartsWith("Windows", StringComparison.OrdinalIgnoreCase))
         {
             if (line.Contains("x64") || line.Contains("X64"))
             {
                 analysis.OSVersion           = line;
                 analysis.MachineArchitecture = "x64";
             }
             else if (line.Contains("x86") || line.Contains("X86"))
             {
                 analysis.OSVersion           = line;
                 analysis.MachineArchitecture = "x86";
             }
         }
     }
 }
Ejemplo n.º 2
0
        private static void AddResultLineToParagraph(StackHashScriptLineResult line, ref Paragraph para)
        {
            // bold command
            Span commandSpan = new Span();

            commandSpan.FontWeight = FontWeights.Bold;
            commandSpan.Inlines.Add(new Run(line.ScriptLine.Command));

            // add comment if present
            if (!string.IsNullOrEmpty(line.ScriptLine.Comment))
            {
                Span commentSpan = new Span();
                commentSpan.Foreground = Brushes.Green;
                commentSpan.Inlines.Add(new Run(string.Format(CultureInfo.CurrentCulture,
                                                              " * {0}",
                                                              line.ScriptLine.Comment)));

                commandSpan.Inlines.Add(commentSpan);
            }

            // add command/comment to para
            para.Inlines.Add(commandSpan);
            para.Inlines.Add(new LineBreak());

            // add results
            foreach (string outputLine in line.ScriptLineOutput)
            {
                para.Inlines.Add(new Run(outputLine));
                para.Inlines.Add(new LineBreak());
            }

            para.Inlines.Add(new LineBreak());
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Process the output of the lm v m mscorwks command.
 /// This gives the .NET version loaded in the dump.
 /// </summary>
 /// <param name="analysis">The results structure to update.</param>
 /// <param name="commandOutput">The result data to analyze</param>
 private static void processMscorwksResults(StackHashDumpAnalysis analysis, StackHashScriptLineResult commandOutput)
 {
     foreach (String line in commandOutput.ScriptLineOutput)
     {
         String value = null;
         if ((value = GetColonOption(line, "Product version")) != null)
         {
             analysis.DotNetVersion = value;
         }
     }
 }