Messagebox wird angezeigt wenn export fertiggestellt wurde

This commit is contained in:
Husky
2021-07-04 18:51:32 +02:00
parent a0eae3d069
commit c38dd1830b
3 changed files with 51 additions and 59 deletions

View File

@@ -18,9 +18,7 @@ namespace SanSystem
return Content.Count() + 1;
}
public static Task ExportAsync(Projekt projekt, string destinationPath = "./")
{
return Task.Factory.StartNew(() =>
public static bool Export(Projekt projekt, string destinationPath = "./")
{
destinationPath = Path.Combine(destinationPath, "EXPORT");
foreach (Inspektionsobjekt d in projekt.Objekte)
@@ -76,8 +74,7 @@ namespace SanSystem
}
}
}
});
return true;
}
}
}

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\ILMerge.3.0.41\build\ILMerge.props" Condition="Exists('..\packages\ILMerge.3.0.41\build\ILMerge.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -515,10 +514,4 @@
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\ILMerge.3.0.41\build\ILMerge.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ILMerge.3.0.41\build\ILMerge.props'))" />
</Target>
</Project>

View File

@@ -376,7 +376,9 @@ namespace SanSystem
private async void OnExportedExecuted(string destinationPath)
{
await BüroExporter.ExportAsync(Datenbank.Instance.loadedProjekt,destinationPath);
Task<bool> export = Task.Factory.StartNew(() => BüroExporter.Export(Datenbank.Instance.loadedProjekt, destinationPath));
export.ContinueWith(task => MessageBox.Show("Büro export abgeschlossen"));
}
}
}