/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see .
*/
using System.Threading;
using System.Threading.Tasks;
namespace dnSpy.Contracts.Debugger.Attach {
///
/// Returns all processes that the debug engines support
///
public abstract class AttachableProcessesService {
///
/// Gets all programs that can be attached to
///
/// Cancellation token
///
public Task GetAttachableProcessesAsync(CancellationToken cancellationToken = default) =>
GetAttachableProcessesAsync(null, null, null, cancellationToken);
///
/// Gets all programs that can be attached to
///
/// Process name. If it's empty or null, it matches any string. This can include wildcards (* and ?).
/// Cancellation token
///
public Task GetAttachableProcessesAsync(string processName, CancellationToken cancellationToken = default) =>
GetAttachableProcessesAsync(string.IsNullOrEmpty(processName) ? null : new[] { processName }, null, null, cancellationToken);
///
/// Gets all programs that can be attached to
///
/// Process names or null/empty to match any process name. The process name can
/// include wildcards (* and ?)
/// names, see
/// Cancellation token
///
public Task GetAttachableProcessesAsync(string[] processNames, string[] providerNames, CancellationToken cancellationToken = default) =>
GetAttachableProcessesAsync(processNames, null, providerNames, cancellationToken);
///
/// Gets all programs that can be attached to
///
/// Process names or null/empty to match any process name. The process name can
/// include wildcards (* and ?)
/// Process ids or null/empty to match any process id
/// names or null, see
/// Cancellation token
///
public abstract Task GetAttachableProcessesAsync(string[]? processNames, int[]? processIds, string[]? providerNames, CancellationToken cancellationToken = default);
}
}