public Warning(string code, WarningLine line, int startPosition, int endPosition, string source)
 {
     Code          = code;
     Line          = line;
     StartPosition = startPosition;
     EndPosition   = endPosition;
     Source        = source;
     MemeberName   = line.Line.Text.Substring(startPosition, endPosition - startPosition);
 }
            public WarningLine Line(int lineIndex)
            {
                WarningLine line;

                if (!_lines.TryGetValue(lineIndex, out line))
                {
                    _lines[lineIndex] = line = new WarningLine(this, lineIndex);
                }

                return(line);
            }
        public void WhenWarningLineRawProvidedWeGetMSB3276Back()
        {
            var lineNumber       = 17;
            var testLine         = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\MSBuild\\Current\\Bin\\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the \"AutoGenerateBindingRedirects\" property to true in the project file.";
            var token            = new WarningLine();
            var tokenMatchesLine = token.ProcessLine(17, testLine);

            Assert.IsNotNull(token);
            Assert.IsTrue(tokenMatchesLine, "Token didn't match line as expected:" + testLine);
            var expectedRegexMatch = "MSB3276";
            var actualEventExists  = EventHelper.HasSpecificWarningAddedEvent(lineNumber, testLine, expectedRegexMatch);

            Assert.IsTrue(actualEventExists);
        }
 private void Refresh()
 {
     m_warningsList.Controls.Clear();
     foreach (var warning in MySimpleProfiler.CurrentWarnings.Values)
     {
         if (warning.Time < 120 || m_showAll)
         {
             WarningLine warningLine;
             if (!m_warningLines.TryGetValue(warning.Block, out warningLine))
             {
                 warningLine = new WarningLine(warning, this);
                 m_warningLines.Add(warning.Block, warningLine);
             }
         }
     }
     m_areaTitleGraphics.Add(m_warningsList, m_showAll);
     m_areaTitleBlocks.Add(m_warningsList, m_showAll);
     m_areaTitleOther.Add(m_warningsList, m_showAll);
 }
 private void Refresh()
 {
     m_warningsList.Controls.Clear();
     foreach (var warning in MySimpleProfiler.CurrentWarnings.Values)
     {
         if (warning.Time < 120 || m_showAll)
         {
             WarningLine warningLine;
             if (!m_warningLines.TryGetValue(warning.Block, out warningLine))
             {
                 warningLine = new WarningLine(warning, this);
                 m_warningLines.Add(warning.Block, warningLine);
             }
         }
     }
     m_areaTitleGraphics.Add(m_warningsList, m_showAll);
     m_areaTitleBlocks.Add(m_warningsList, m_showAll);
     m_areaTitleOther.Add(m_warningsList, m_showAll);
 }