Implemented deletion of collections
This commit is contained in:
@@ -4,4 +4,5 @@ public interface ISecretService
|
|||||||
{
|
{
|
||||||
public List<Secret.Collection> GetCollections();
|
public List<Secret.Collection> GetCollections();
|
||||||
public void CreateCollection(string label);
|
public void CreateCollection(string label);
|
||||||
|
public void DeleteCollection(string label);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public class PasswordStoreService : IPasswordStoreService
|
|||||||
|
|
||||||
public void Delete(uint ID)
|
public void Delete(uint ID)
|
||||||
{
|
{
|
||||||
|
secretService.DeleteCollection(Get(ID).DisplayName ?? Get(ID).Path);
|
||||||
repository.Delete(ID);
|
repository.Delete(ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ public class SecretService : ISecretService
|
|||||||
{
|
{
|
||||||
Secret.Collection collection = (Secret.Collection)GObject.Internal.InstanceWrapper.WrapHandle<Secret.Collection>(data, false);
|
Secret.Collection collection = (Secret.Collection)GObject.Internal.InstanceWrapper.WrapHandle<Secret.Collection>(data, false);
|
||||||
result.Add(collection);
|
result.Add(collection);
|
||||||
Console.WriteLine($" - {collection.Label}");
|
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -27,4 +26,9 @@ public class SecretService : ISecretService
|
|||||||
{
|
{
|
||||||
Secret.Collection.CreateSync(service, label, null, Secret.CollectionCreateFlags.None, null);
|
Secret.Collection.CreateSync(service, label, null, Secret.CollectionCreateFlags.None, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DeleteCollection(string label)
|
||||||
|
{
|
||||||
|
GetCollections().FirstOrDefault(c => c.Label == label).DeleteSync(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user