mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 15:26:30 +00:00
dll loader done
This commit is contained in:
@@ -40,12 +40,13 @@ public partial class App
|
||||
new ConfigUpdater().CheckConfig();
|
||||
|
||||
var result = Parser.Default.ParseArguments<ApiCredentials>(Environment.GetCommandLineArgs());
|
||||
if (result.Errors.Any())
|
||||
return;
|
||||
var apiCreds = result.Value;
|
||||
|
||||
var apiCreds = !result.Errors.Any()
|
||||
? result.Value
|
||||
: new ApiCredentials();
|
||||
|
||||
ResourceLoader = new ResourceLoader(CreateApiClient(apiCreds), apiCreds);
|
||||
AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => ResourceLoader.LoadAssembly(args.Name);
|
||||
//AppDomain.CurrentDomain.AssemblyResolve += (_, args) => ResourceLoader.LoadAssembly(args.Name);
|
||||
}
|
||||
|
||||
private static AzaionApiClient CreateApiClient(ApiCredentials credentials)
|
||||
@@ -172,10 +173,11 @@ public partial class App
|
||||
|
||||
private WindowEnum GetParentWindow(FrameworkElement? element)
|
||||
{
|
||||
if (element?.GetType().Name == "LibVLCSharp.WPF.ForegroundWindow")
|
||||
return WindowEnum.Annotator;
|
||||
|
||||
while (element != null && element is not TabItem)
|
||||
{
|
||||
element = element.Parent as FrameworkElement;
|
||||
}
|
||||
|
||||
if (element is not TabItem || element.Tag == null)
|
||||
return WindowEnum.None;
|
||||
|
||||
Reference in New Issue
Block a user