Exemplo n.º 1
0
        private IEnumerable <SplitTunnelingApp> MicrosoftEdge()
        {
            var path = Environment.ExpandEnvironmentVariables(Path.Combine(MicrosoftEdgeFolder, "MicrosoftEdge.exe"));

            if (!File.Exists(path))
            {
                yield break;
            }

            var app = new SplitTunnelingApp
            {
                Name = MicrosoftEdgeName,
                Path = path
            };

            var paths = new List <string>();

            path = Environment.ExpandEnvironmentVariables(Path.Combine(MicrosoftEdgeFolder, "MicrosoftEdgeCP.exe"));
            if (File.Exists(path))
            {
                paths.Add(path);
            }

            path = Environment.ExpandEnvironmentVariables(@"%WinDir%\System32\MicrosoftEdgeCP.exe");
            if (File.Exists(path))
            {
                paths.Add(path);
            }

            app.AdditionalPaths = paths.Any() ? paths.ToArray() : null;
            yield return(app);
        }
Exemplo n.º 2
0
        private IEnumerable <SplitTunnelingApp> InternetExplorer()
        {
            var path = MachineAppPath(@"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE");

            if (string.IsNullOrEmpty(path))
            {
                yield break;
            }

            var x86Path = MachineAppPath(@"SOFTWARE\Microsoft\Internet Explorer\Main", "x86AppPath");

            var app = new SplitTunnelingApp
            {
                Name            = InternetExplorerName,
                Path            = path,
                AdditionalPaths = !string.IsNullOrEmpty(x86Path) ? new [] { x86Path } : null
            };

            yield return(app);
        }
Exemplo n.º 3
0
        public AppViewModel(SplitTunnelingApp dataSource)
        {
            Ensure.NotNull(dataSource, nameof(dataSource));

            _dataSource = dataSource;
        }