JetBrains.Profiler.SelfApi/src/DotMemory.cs [129:218]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - public static Task InitAsync(CancellationToken cancellationToken, IProgress progress = null, Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) { lock (Mutex) return ConsoleRunnerPackage.DownloadAsync(nugetUrl, nugetApi, downloadTo, progress, cancellationToken); } /// /// The self-profiling API requires the dotMemory command-line profiler for its work.
/// This method checks that the profiler is located at and initializes the profiler.
/// You should call this or another Init method before any other method of the self-profiling API.
///
/// /// Use this method only if your computer doesn't have access to the internet, and you want to use the locally installed command-line profiler.
/// Otherwise, use or . ///
/// Folder with the command-line profiler public static void InitOffline(string commandLineToolsFolder) => ConsoleRunnerPackage.AssertLocalBinaryFolder(commandLineToolsFolder); /// /// It's the shortcut for InitAsync(CancellationToken.None, progress: null, nugetUrl, prerequisitePath).Wait() /// public static void Init(Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) => InitAsync(CancellationToken.None, null, nugetUrl, nugetApi, downloadTo).Wait(); /// /// It's the shortcut for InitAsync(CancellationToken.None, progress, nugetUrl, prerequisitePath) /// public static Task InitAsync(IProgress progress = null, Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) => InitAsync(CancellationToken.None, progress, nugetUrl, nugetApi, downloadTo); /// /// This method is obsolete, use or instead
/// It makes sure that the dotMemory command-line profiler is downloaded and is ready to use. ///
/// /// 1. Looks for command-line profiler in the folder (if specified). Uses it if it's found.
/// 2. Looks for command-line profiler in the same folder with the running assembly. Uses it if it's found.
/// 3. Downloads the latest `JetBrains.dotMemory.Console` NuGet package into the /// folder and uses the command-line profiler from this package. The basic package version is defined by . /// The command-line profiler is saved to `{downloadTo}/dotMemory/{Version}/dotMemory.exe` /// If the file exists, a new one is not downloaded. ///
/// Cancellation token /// Download progress callback from 0.0 to 100.0. If null, progress is not reported. /// URL of NuGet mirror. If null, www.nuget.org is used. /// NuGet API version. /// NuGet download destination folder. If null, %LocalAppData% is used. [Obsolete("Use " + nameof(InitAsync) + " or " + nameof(InitOffline) + " instead")] public static Task EnsurePrerequisiteAsync( CancellationToken cancellationToken, IProgress progress = null, Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) { lock (Mutex) { if (ConsoleRunnerPackage.CheckLocalBinaryFolder(string.IsNullOrEmpty(downloadTo) ? PrerequisiteBase.GetNearbyPath() : downloadTo)) return Task.FromResult(Missing.Value); return ConsoleRunnerPackage.DownloadAsync(nugetUrl, nugetApi, downloadTo, progress, cancellationToken); } } /// /// This method is obsolete, use or instead
/// It's the shortcut for EnsurePrerequisiteAsync(CancellationToken.None, progress, nugetUrl, prerequisitePath) ///
[Obsolete("Use " + nameof(InitAsync) + " or " + nameof(InitOffline) + " instead")] public static Task EnsurePrerequisiteAsync( IProgress progress = null, Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) { return EnsurePrerequisiteAsync(CancellationToken.None, progress, nugetUrl, nugetApi, downloadTo); } /// /// This method is obsolete, use or instead
/// It's the shortcut for EnsurePrerequisiteAsync(CancellationToken.None, progress: null, nugetUrl, prerequisitePath).Wait() ///
[Obsolete("Use " + nameof(Init) + " or " + nameof(InitOffline) + " instead")] public static void EnsurePrerequisite( Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) { EnsurePrerequisiteAsync(null, nugetUrl, nugetApi, downloadTo).Wait(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - JetBrains.Profiler.SelfApi/src/DotTrace.cs [140:227]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - public static Task InitAsync(CancellationToken cancellationToken, IProgress progress = null, Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) { lock (Mutex) return ConsoleRunnerPackage.DownloadAsync(nugetUrl, nugetApi, downloadTo, progress, cancellationToken); } /// /// The self-profiling API requires the dotTrace command-line profiler for its work.
/// This method checks that the profiler is located at and initializes the profiler.
/// You should call this or another Init method before any other method of the self-profiling API.
///
/// /// Use this method only if your computer doesn't have access to the internet, and you want to use the locally installed command-line profiler.
/// Otherwise, use or . ///
/// Folder with the command-line profiler public static void InitOffline(string commandLineToolsFolder) => ConsoleRunnerPackage.AssertLocalBinaryFolder(commandLineToolsFolder); /// /// It's the shortcut for InitAsync(CancellationToken.None, progress: null, nugetUrl, prerequisitePath).Wait() /// public static void Init(Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) => InitAsync(CancellationToken.None, null, nugetUrl, nugetApi, downloadTo).Wait(); /// /// It's the shortcut for InitAsync(CancellationToken.None, progress, nugetUrl, prerequisitePath) /// public static Task InitAsync(IProgress progress = null, Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) => InitAsync(CancellationToken.None, progress, nugetUrl, nugetApi, downloadTo); /// /// This method is obsolete, use or instead
/// It makes sure that the dotTrace command-line profiler is downloaded and is ready to use. ///
/// /// 1. Looks for dotTrace executable in the same directory with the running assembly. Uses it if it's found.
/// 2. Downloads `JetBrains.dotTrace.CommandLineTools` NuGet package into the /// directory and uses the dotTrace command-line profiler from this package. The package version is defined by . /// The command-line profiler is saved to `{downloadTo}/dotTrace.{NupkgVersion}` ///
/// Cancellation token /// Download progress callback from 0.0 to 100.0. If null, progress is not reported. /// URL of NuGet mirror. If null, www.nuget.org is used. /// NuGet API version. /// NuGet download destination directory. If null, %LocalAppData% is used. [Obsolete("Use " + nameof(InitAsync) + " or " + nameof(InitOffline) + " instead")] public static Task EnsurePrerequisiteAsync( CancellationToken cancellationToken, IProgress progress = null, Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) { lock (Mutex) { if (ConsoleRunnerPackage.CheckLocalBinaryFolder(string.IsNullOrEmpty(downloadTo) ? PrerequisiteBase.GetNearbyPath() : downloadTo)) return Task.FromResult(Missing.Value); return ConsoleRunnerPackage.DownloadAsync(nugetUrl, nugetApi, downloadTo, progress, cancellationToken); } } /// /// This method is obsolete, use or instead
/// It's the shortcut for EnsurePrerequisiteAsync(CancellationToken.None, progress, nugetUrl, prerequisitePath) ///
[Obsolete("Use " + nameof(InitAsync) + " or " + nameof(InitOffline) + " instead")] public static Task EnsurePrerequisiteAsync( IProgress progress = null, Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) { return EnsurePrerequisiteAsync(CancellationToken.None, progress, nugetUrl, nugetApi, downloadTo); } /// /// This method is obsolete, use or instead
/// It's the shortcut for EnsurePrerequisiteAsync(CancellationToken.None, progress: null, nugetUrl, prerequisitePath).Wait() ///
[Obsolete("Use " + nameof(Init) + " or " + nameof(InitOffline) + " instead")] public static void EnsurePrerequisite( Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) { EnsurePrerequisiteAsync(null, nugetUrl, nugetApi, downloadTo).Wait(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -