DeriveProgramFilesSentinel() private static method

private static DeriveProgramFilesSentinel ( ) : string
return string
Example #1
0
        private static string DeriveVisualStudioPath(string debuggerPath)
        {
            string a1   = SyncVS.DeriveProgramFilesSentinel();
            string a2   = "Common7";
            bool   flag = false;

            string[] strArray = debuggerPath.Split(new char[2]
            {
                Path.DirectorySeparatorChar,
                Path.AltDirectorySeparatorChar
            }, StringSplitOptions.RemoveEmptyEntries);
            string path1 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);

            foreach (string str in strArray)
            {
                if (!flag && string.Equals(a1, str, StringComparison.OrdinalIgnoreCase))
                {
                    flag = true;
                }
                else if (flag)
                {
                    path1 = Path.Combine(path1, str);
                    if (string.Equals(a2, str, StringComparison.OrdinalIgnoreCase))
                    {
                        break;
                    }
                }
            }
            return(Paths.Combine(path1, "IDE", "devenv.exe"));
        }
Example #2
0
        private static string DeriveVisualStudioPath(string debuggerPath)
        {
            string a    = SyncVS.DeriveProgramFilesSentinel();
            string a2   = "Common7";
            bool   flag = false;

            string[] array = debuggerPath.Split(new char[]
            {
                Path.DirectorySeparatorChar,
                Path.AltDirectorySeparatorChar
            }, StringSplitOptions.RemoveEmptyEntries);
            string text = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);

            string[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                string text2 = array2[i];
                if (!flag && string.Equals(a, text2, StringComparison.OrdinalIgnoreCase))
                {
                    flag = true;
                }
                else
                {
                    if (flag)
                    {
                        text = Path.Combine(text, text2);
                        if (string.Equals(a2, text2, StringComparison.OrdinalIgnoreCase))
                        {
                            break;
                        }
                    }
                }
            }
            return(Paths.Combine(new string[]
            {
                text,
                "IDE",
                "devenv.exe"
            }));
        }