Esempio n. 1
0
        private void prepareDetails()
        {
            foreach (KeyValuePair <string, Sources.Source> pair in runTime.SourceSections.Sections)
            {
                List <string>  texts  = new List <string>();
                Sources.Source source = pair.Value;
                source.Process();

                Sources.Source.Prefix[] prefixes = source.PrefixLines.ToArray();
                string[] lines = source.Lines;
                int      pref  = 0;
                for (int i = 0, j = lines.Length; i < j; i++)
                {
                    string text = String.Format("{0:00000}: ", i);
                    if (pref < prefixes.Length && i == prefixes[pref].Line)
                    {
                        text += (prefixes[pref].Text + (new string(' ', source.LongestPrefix - prefixes[pref].Text.Length)));
                        pref++;
                    }
                    else
                    {
                        text += (new string(' ', source.LongestPrefix));
                    }
                    text += " | ";
                    text += lines[i];
                    texts.Add(text);
                }

                models.Details.Add(pair.Key, texts);

                foreach (KeyValuePair <string, Sources.SourceFunction> pair2 in pair.Value.Funcs)
                {
                    Sources.SourceFunction func = pair2.Value;
                    models.MaxHits.Add(pair.Key + "@" + pair2.Key, func.MaxHitLine);
                }
            }

            // null
            List <string> def = new List <string>()
            {
                "This module was not called."
            };

            models.Details.Add("(null)", def);
        }
Esempio n. 2
0
 public River(RiverContext riverContext)
 {
     _riverContext = riverContext;
     _source = Sources.Source.GetSource(riverContext.Source);
     _mouth = new Mouth(riverContext.Destination);
 }