Click here to Skip to main content
15,897,226 members
Articles / Programming Languages / C#

Visual Studio 2010 Add-in that Adds Diff Tools, Web Project Reporting and Some Subversion Support

Rate me:
Please Sign up or sign in to vote.
4.56/5 (13 votes)
12 May 2010CPOL4 min read 163.1K   2.7K   98  
With this add-in, you get new tools and commands that boost your productivity while developing, and some helpful reports especially for web projects - Version 2.2
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html style="border:0px" onscroll="menubar.style.pixelTop=window.document.documentElement.scrollTop">
  <head>
    <meta http-equiv='Expires' content='0'>
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    <title>Textfile differences</title>
    <style>
      BODY {FONT-FAMILY: Arial,Verdana; FONT-SIZE: 9pt; COLOR: black; margin:0px;padding:0px;BACKGROUND-COLOR:#dbe7f3}
      #header { background-color:#DDDDDD;border-bottom:#395d9a 2px solid; padding-top:24px }
      #menubar { BORDER-BOTTOM: gray 1px solid;background-color:#DDDDDD;position:absolute;top:0px;left:0px }
      #header table { TABLE-LAYOUT: fixed }
      #header h1 {FONT-SIZE: 11pt;margin:0px;padding:0px}
      #header a {vertical-align:middle}

      tr.code { FONT-SIZE: 8pt; margin-left: 6px; FONT-FAMILY:Courier New; WHITE-SPACE: pre; BACKGROUND-COLOR: white }
      
      TABLE {EMPTY-CELLS:show;BORDER-COLLAPSE:collapse}
      THEAD TR {BACKGROUND-COLOR:silver; }
      #resultTab THEAD TD {padding-right:2px; border-bottom:1px solid gray }
      .i {COLOR:black; BACKGROUND-COLOR:#A0FFA0}
      .d {COLOR:black; BACKGROUND-COLOR:#FFA0A0}
      .c {COLOR:black; BACKGROUND-COLOR:white;}
      .sel {COLOR:white; BACKGROUND-COLOR:black;}
      IMG {border:0px};
    </style>
  </head>
  <body>
    <div id='header'>
      <table id="menubar">
        <tr>
          <td style="WIDTH: 48px">
            <A href="dte:back"><IMG src="[ROOT]\back.gif"></A>
            <A href="dte:reload"><IMG src="[ROOT]\refresh.gif"></A>
          </td>
          <td style="width:60px;">
            <a onclick="javascript:prv()" style="FONT-WEIGHT: bold" tabindex="1" title="Previous diffrerence (Shift+F8)">
              &lt;&lt;&lt;</a>&nbsp; <a onclick="javascript:nxt()" style="FONT-WEIGHT: bold" tabindex="1" title="Next diffrerence (F8)">
              &gt;&gt;&gt;</a></td>
          <td style="BORDER-LEFT: gray 1px solid; PADDING-LEFT: 4px">
            <h1>Diff files</h1>
          </td>
        </tr>
      </table>
      <table style="TABLE-LAYOUT: fixed">
        <tbody>
          <tr>
            <td width="70">new file:</td>
            <td width="*"><A class="i" id="newfile" href="dte:file?file=[NEWFILEENC]">[NEWFILE]</A></td>
          </tr>
          <tr>
            <td width="70">old file:</td>
            <td width="*"><A class="d" id="oldfile" href="dte:file?file=[OLDFILEENC]">[OLDFILE]</A></td>
          </tr>
        </tbody>
      </table>
    </div>
    <table class="code" id="resultTab">
      <colgroup>
        <col align='right' width='40'>
        <col align='left' width='*'>
      </colgroup>
      <tbody>
        [RESULT]
      </tbody>
    </table>
    <script language='javascript'>
var selDiff = -1;

// add the click-event
function resultTab.ondblclick() {
  var obj = event.srcElement;
  var cn, line;
  while ((obj != null) && (obj.tagName != 'TR')) obj = obj.parentElement;
  if (obj != null) {
    cn = obj.cells(1).className;
    line = obj.cells(0).innerHTML;
    if (line.charAt(0) == '(') line = line.substr(1, line.length-2);
    if (cn == 'd') {
      window.navigate('dte:file?file=' + oldfile.innerText + '&line=' + line);
    } else {
      window.navigate('dte:file?file=' + newfile.innerText + '&line=' + line);
    }
  } // if
} // resultTab.onclick


// catch F8
function document.onkeydown() {
  // F8
  if (event.keyCode == 119) {
    if (event.shiftKey)
      prv();
    else
      nxt();
  } // if
} // onkeydown


// search next diff
function nxt() {
  var rows = resultTab.tBodies(0).rows;
  if (selDiff >= 0)
    rows(selDiff).cells(0).className = "";
    
  n = selDiff+1;
  if (selDiff >= 0)
    while ((n < rows.length) && (rows(n).cells(1).className != ""))
      n++;

  while (n < rows.length) {
    if (rows(n).cells(1).className != "") {
      selDiff = n;
      break;
    } // if
    n++;
  } // while
  
  if (selDiff >= 0) {
    rows(selDiff).cells(0).className = "sel";
    rows(selDiff).scrollIntoView();
    window.scrollBy(0, -36);
  } // if
} // nxt()


// search prev diff
function prv() {
  var rows = resultTab.tBodies(0).rows;
  if (selDiff >= 0)
    rows(selDiff).cells(0).className = "";
    
  for (n = selDiff-1; n >= 0; n--) {
    if (rows(n).cells(1).className != "") {
      selDiff = n;
      break;
    } // if
  } // for

  while ((selDiff > 0) && (rows(selDiff-1).cells(1).className != ""))
    selDiff--;

  if (selDiff >= 0) {
    rows(selDiff).cells(0).className = "sel";
    rows(selDiff).scrollIntoView();
    window.scrollBy(0, -36);
  } // if
} // prv()

    </script>
  </body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Deutsche Bank AG
Germany Germany
see https://www.mathertel.de

Comments and Discussions