예제 #1
0
        private static void DownloadBrowser()
        {
            var browserFetcher = new BrowserFetcher();

            browserFetcher.DownloadProgressChanged += (sender, e) =>
            {
                Logger.Debug(
                    $"Browser download progress {e.ProgressPercentage}% - {e.BytesReceived}/{e.TotalBytesToReceive}bytes");
            };

            Logger.Debug("Download browser");
            AsyncHelper.RunSync(() => browserFetcher.DownloadAsync(BrowserFetcher.DefaultRevision));

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
            {
                var       executablePath = browserFetcher.GetExecutablePath(BrowserFetcher.DefaultRevision);
                const int _0755          =
                    S_IRUSR | S_IXUSR | S_IWUSR
                    | S_IRGRP | S_IXGRP
                    | S_IROTH | S_IXOTH;
                chmod(executablePath, _0755);
            }

            Logger.Debug("Browser downloaded");
        }
예제 #2
0
 static Chronometer()
 {
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && WindowsClock.IsAvailable)
     {
         BestClock = WindowsClock;
     }
     else
     {
         BestClock = Stopwatch;
     }
 }
예제 #3
0
 public bool IsWindows()
 {
     return(RI.IsOSPlatform(OSPlatform.Windows));
 }