assert non-disposed status for plugin in each routine, closes #1

This commit is contained in:
2025-03-21 09:05:15 +01:00
parent 7c8b241235
commit 0094f4cb85
4 changed files with 25 additions and 22 deletions

View File

@@ -18,25 +18,25 @@ namespace dopt.DeltaBarth
}
public void Startup(string basisApiUrl, string nutzername, string passwort, string datenbank, string mandant)
{
AssertNotDisposed();
SetzeBasisApiUrl(basisApiUrl);
SetzeNutzerdaten(nutzername, passwort, datenbank, mandant);
}
public void Shutdown()
{
base.Finalise();
}
public void SetzeBasisApiUrl(string basisApiUrl)
{
AssertNotDisposed();
pyModManagement.set_base_url(basisApiUrl);
}
public void SetzeNutzerdaten(string nutzername, string passwort, string datenbank, string mandant)
{
AssertNotDisposed();
using (Py.GIL()) {
pyModManagement.set_credentials(nutzername, passwort, datenbank, mandant);
}
}
public JsonStructs.UmsatzPrognoseAusgabe UmsatzprognoseDummy(int? firmaId, DateTime? buchungsDatum)
{
AssertNotDisposed();
string pyJson;
using (Py.GIL())
{
@@ -48,6 +48,7 @@ namespace dopt.DeltaBarth
}
public JsonStructs.UmsatzPrognoseAusgabe Umsatzprognose(int? firmaId, DateTime? buchungsDatum)
{
AssertNotDisposed();
string pyJson;
using (Py.GIL())
{
@@ -59,6 +60,7 @@ namespace dopt.DeltaBarth
}
protected string GetBaseApiUrl()
{
AssertNotDisposed();
string pyJson;
using (Py.GIL())
{
@@ -68,6 +70,7 @@ namespace dopt.DeltaBarth
}
protected JsonStructs.Credentials GetCredentials()
{
AssertNotDisposed();
string pyJson;
using (Py.GIL())
{

View File

@@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="dopt.SharpPython" Version="0.2.1" />
<PackageReference Include="dopt.SharpPython" Version="0.3.0" />
<Content Include="..\python\**\*">
<Link>python\%(RecursiveDir)/%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>