Ejemplo n.º 1
0
        internal static bool DocumentsSavedCheck(VccOptionPage options)
        {
            if (DTE.Documents.Cast <Document>().All(document => document.Saved))
            {
                return(true);
            }

            if (options.SaveMode == SaveMode.Automatically)
            {
                DTE.Documents.SaveAll();
                return(true);
            }

            if (MessageBox.Show(
                    "There are unsaved changes. Press OK to save all documents and proceed with the verification.",
                    "Unsaved Changes",
                    MessageBoxButtons.OKCancel,
                    MessageBoxIcon.Question,
                    MessageBoxDefaultButton.Button1) == DialogResult.OK)
            {
                DTE.Documents.SaveAll();
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
 internal static void CustomVerify(string filename, VccOptionPage options)
 {
     using (var customVerifyForm = new CustomVerifyForm(GetArgumentsFromOptions(options, false)))
     {
         if (customVerifyForm.ShowDialog() == DialogResult.OK)
         {
             LaunchVCC(String.Format("{0} \"{1}\"", customVerifyForm.Arguments, filename));
         }
     }
 }
Ejemplo n.º 3
0
        private static string GetArgumentsFromOptions(VccOptionPage options, bool respectCustomFlag)
        {
            string result = !respectCustomFlag || options.UseAdditionalCommandlineArguments ?
                            options.AdditionalCommandlineArguments :
                            string.Empty;

            if (options.ShowZ3Inspector)
            {
                result += " /i";
            }

            result += " /bvd";

            return(result);
        }
Ejemplo n.º 4
0
    internal static bool DocumentsSavedCheck(VccOptionPage options) {
      if (DTE.Documents.Cast<Document>().All(document => document.Saved)) return true;

      if (options.SaveMode == SaveMode.Automatically) {
        DTE.Documents.SaveAll();
        return true;
      }
      
      if (MessageBox.Show(
        "There are unsaved changes. Press OK to save all documents and proceed with the verification.",
        "Unsaved Changes",
        MessageBoxButtons.OKCancel,
        MessageBoxIcon.Question,
        MessageBoxDefaultButton.Button1) == DialogResult.OK) {
          DTE.Documents.SaveAll();
          return true;
        }
      
      return false;
    }
Ejemplo n.º 5
0
        internal static void VerifyFile(string filename, VccOptionPage options)
        {
            string addArguments = GetArgumentsFromOptions(options, true);

            LaunchVCC(String.Format("{0} \"{1}\"", addArguments, filename));
        }
Ejemplo n.º 6
0
        internal static void VerifyThis(string filename, string currentFile, int line, VccOptionPage options)
        {
            string addArguments = GetArgumentsFromOptions(options, true);

            addArguments += String.Format(" /loc:\"{0}\":{1} ", currentFile, line);
            LaunchVCC(String.Format("{0} \"{1}\"", addArguments, filename));
        }
Ejemplo n.º 7
0
        internal static void VerifyFileWithoutIncludes(string filename, string currentFile, VccOptionPage options)
        {
            string addArguments = GetArgumentsFromOptions(options, true);

            addArguments += " /ii:" + currentFile;
            LaunchVCC(String.Format("{0} \"{1}\"", addArguments, filename));
        }
Ejemplo n.º 8
0
        private static string GetArgumentsFromOptions(VccOptionPage options, bool respectCustomFlag)
        {
            string result = !respectCustomFlag || options.UseAdditionalCommandlineArguments ?
              options.AdditionalCommandlineArguments :
              string.Empty;

              if (options.ShowZ3Inspector)
              {
            result += " /i";
              }

              result += " /bvd";

              return result;
        }
Ejemplo n.º 9
0
 internal static void VerifyThis(string filename, string currentFile, int line, VccOptionPage options)
 {
     string addArguments = GetArgumentsFromOptions(options, true);
       addArguments += String.Format(" /loc:\"{0}\":{1} ", currentFile, line);
       LaunchVCC(String.Format("{0} \"{1}\"", addArguments, filename));
 }
Ejemplo n.º 10
0
 internal static void VerifyFileWithoutIncludes(string filename, string currentFile, VccOptionPage options)
 {
     string addArguments = GetArgumentsFromOptions(options, true);
       addArguments += " /ii:" + currentFile;
       LaunchVCC(String.Format("{0} \"{1}\"", addArguments, filename));
 }
Ejemplo n.º 11
0
 internal static void VerifyFile(string filename, VccOptionPage options)
 {
     string addArguments = GetArgumentsFromOptions(options, true);
       LaunchVCC(String.Format("{0} \"{1}\"", addArguments, filename));
 }
Ejemplo n.º 12
0
 internal static void CustomVerify(string filename, VccOptionPage options)
 {
     using (var customVerifyForm = new CustomVerifyForm(GetArgumentsFromOptions(options, false)))
       {
     if (customVerifyForm.ShowDialog() == DialogResult.OK)
     {
       LaunchVCC(String.Format("{0} \"{1}\"", customVerifyForm.Arguments, filename));
     }
       }
 }