Exemple #1
0
        private void LinkLabel_Click(object sender, EventArgs e)
        {
            LinkLabel link = sender as LinkLabel;

            if (link == null)
            {
                return;
            }
            DevenvCommand cmd = new DevenvCommand();

            cmd.EditFile(link.Text);
            link.BackColor = link.BackColor == Color.Gold ? Color.Beige : Color.Gold;
        }
 private void Build()
 {
     if (btnStop.Enabled)
     {
         StopServer();
     }
     UpdateMessage("sln building...");
     BuildResults = string.Empty;
     if (DevenvCommand.MSBuildFileFullPath.LastIndexOf("devenv", StringComparison.OrdinalIgnoreCase) >= 0)
     {
         DevenvCommand cmd     = new DevenvCommand();
         string        results = cmd.BuildSolution(WebSite.Solution);
         BuildResults = results;
         Regex  reg   = new Regex(@"====([ \w,-:]+)====");
         string final = (from Match m in reg.Matches(results) where m.Success where m.Groups.Count > 1 select m.Groups[1].Value).FirstOrDefault();
         UpdateMessage(final ?? "sln build finish!");
     }
     else
     {
         MSBuildCommand cmd     = new MSBuildCommand();
         string         results = cmd.BuildSolution(WebSite.Solution);
         BuildResults = results;
         string suc           = "Build succeeded.";
         Regex  timeElapseReg = new Regex("Time Elapsed [0-9:.]+");
         string time          = timeElapseReg.Match(results).Value;
         if (results.IndexOf(suc) >= 0)
         {
             UpdateMessage(suc + "  " + time);
         }
         else
         {
             Regex  errorReg = new Regex(@"[0-9]+\s+Error");
             string error    = errorReg.Match(results).Value;
             UpdateMessage("Build Failed" + "  (" + error + ")  " + time);
         }
     }
 }
Exemple #3
0
 private void LinkLabel_Click(object sender, EventArgs e)
 {
     LinkLabel link = sender as LinkLabel;
     if (link == null) return;
     DevenvCommand cmd = new DevenvCommand();
     cmd.EditFile(link.Text);
     link.BackColor = link.BackColor == Color.Gold ? Color.Beige : Color.Gold;
 }
Exemple #4
0
 private void Build()
 {
     if (btnStop.Enabled) StopServer();
     UpdateMessage("sln building...");
     BuildResults = string.Empty;
     if (DevenvCommand.MSBuildFileFullPath.LastIndexOf("devenv", StringComparison.OrdinalIgnoreCase) >= 0)
     {
         DevenvCommand cmd = new DevenvCommand();
         string results = cmd.BuildSolution(WebSite.Solution);
         BuildResults = results;
         Regex reg = new Regex(@"====([ \w,-:]+)====");
         string final = (from Match m in reg.Matches(results) where m.Success where m.Groups.Count > 1 select m.Groups[1].Value).FirstOrDefault();
         UpdateMessage(final ?? "sln build finish!");
     }
     else
     {
         MSBuildCommand cmd = new MSBuildCommand();
         string results = cmd.BuildSolution(WebSite.Solution);
         BuildResults = results;
         string suc = "Build succeeded.";
         Regex timeElapseReg = new Regex("Time Elapsed [0-9:.]+");
         string time = timeElapseReg.Match(results).Value;
         if (results.IndexOf(suc) >= 0)
         {
             UpdateMessage(suc + "  " + time);
         }
         else
         {
             Regex errorReg = new Regex(@"[0-9]+\s+Error");
             string error = errorReg.Match(results).Value;
             UpdateMessage("Build Failed" + "  (" + error + ")  " + time);
         }
     }
 }