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); }
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)); } } }
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); }
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; }
internal static void VerifyFile(string filename, VccOptionPage options) { string addArguments = GetArgumentsFromOptions(options, true); LaunchVCC(String.Format("{0} \"{1}\"", addArguments, filename)); }
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)); }
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)); }
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; }