28 lines
640 B
C#
28 lines
640 B
C#
namespace Dipper.Alioth.Services;
|
|
|
|
public class ManagerStarlet : IStarlet
|
|
{
|
|
private readonly ApplicationPartManager _partManager;
|
|
|
|
|
|
public ManagerStarlet(ApplicationPartManager partManager)
|
|
{
|
|
_partManager = partManager;
|
|
}
|
|
|
|
public IEnumerable<string> GetList()
|
|
{
|
|
return _partManager.ApplicationParts.Select(x => x.Name);
|
|
}
|
|
|
|
public bool Remove(string name)
|
|
{
|
|
var part = _partManager.ApplicationParts.FirstOrDefault(part => part.Name == name);
|
|
if (part is null)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return _partManager.ApplicationParts.Remove(part);
|
|
}
|
|
} |