Skip to content

Commit

Permalink
Merge pull request #782 from skadefro/master
Browse files Browse the repository at this point in the history
Fix lock issue / bump version
  • Loading branch information
skadefro authored Mar 14, 2024
2 parents 528f551 + 7cffcd7 commit 9448896
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 37 deletions.
4 changes: 2 additions & 2 deletions OpenRPA.Interfaces/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public T GetProperty<T>(string pluginname, T mydefault, [System.Runtime.Compiler
try
{
var c = new System.Drawing.RectangleConverter();
value = c.ConvertFromString(value.ToString());
value = c.ConvertFromString(null, new System.Globalization.CultureInfo("en-US"), value.ToString());
return (T)value;
}
catch (Exception)
Expand All @@ -427,7 +427,7 @@ public T GetProperty<T>(string pluginname, T mydefault, [System.Runtime.Compiler
try
{
var c = new System.Drawing.RectangleConverter();
value = c.ConvertFromString(null, new System.Globalization.CultureInfo("en-US"), value.ToString());
value = c.ConvertFromString(value.ToString());
return (T)value;
}
catch (Exception)
Expand Down
54 changes: 31 additions & 23 deletions OpenRPA.Interfaces/GenericTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,42 +170,50 @@ public static async Task<T> RunUIAsync<T>(System.Windows.Window window, Func<Tas
private static readonly object statelock = new object();
public static void RunUI(Action action)
{
try
if (System.Windows.Application.Current.Dispatcher.CheckAccess())
{
action();
} else
{
if (System.Threading.Monitor.TryEnter(statelock, 10))
try
{
try
// if (System.Threading.Monitor.TryEnter(statelock, Config.local.thread_lock_timeout_seconds * 1000))
if (System.Threading.Monitor.TryEnter(statelock, 1000))
{
if (AutomationHelper.syncContext == null)
{
AutomationHelper.syncContext = System.Threading.SynchronizationContext.Current;
}
AutomationHelper.syncContext.Send(o =>
try
{
try
if (AutomationHelper.syncContext == null)
{
action();
AutomationHelper.syncContext = System.Threading.SynchronizationContext.Current;
}
catch (Exception ex)
AutomationHelper.syncContext.Send(o =>
{
Log.Error(ex.ToString());
}
}, null);
try
{
action();
}
catch (Exception ex)
{
Log.Error(ex.ToString());
}
}, null);

}
finally
{
System.Threading.Monitor.Exit(statelock);
}
}
finally
{
System.Threading.Monitor.Exit(statelock);
else {
// throw new LockNotReceivedException("Failed returning list of workflow instances");
Log.Error("Failed getting exclusive UIThread lock");
}
}
else {
// throw new LockNotReceivedException("Failed returning list of workflow instances");
catch (Exception ex)
{
Log.Error(ex.ToString());
}
}
catch (Exception ex)
{
Log.Error(ex.ToString());
}
}
private delegate void SafeCallDelegate();
public static void RunUI(System.Windows.Forms.Form window, Action action)
Expand Down
24 changes: 14 additions & 10 deletions OpenRPA.Interfaces/Plugins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,20 @@ public static void LoadPlugins(IOpenRPAClient client, string projectsDirectory,
if (dllFile.Contains("grpc_csharp_ext")) continue;
if (dllFile.Contains("chrome_elf.")) continue;
if (dllFile.Contains("d3dcompiler_")) continue;
if (dllFile.Contains("libcef.dll")) continue;
if (dllFile.Contains("libEGL.dll")) continue;
if (dllFile.Contains("libGLESv2.dll")) continue;
if (dllFile.Contains("WindowsAccessBridge-32.dll")) continue;
if (dllFile.Contains("WindowsAccessBridge-64.dll")) continue;
if (dllFile.Contains("WindowsAccessBridge.dll")) continue;
if (dllFile.Contains("vk_swiftshader.dll")) continue;
if (dllFile.Contains("vulkan-1.dll")) continue;
if (dllFile.Contains("cvextern.dll")) continue;
if (dllFile.Contains("opencv_videoio_ffmpeg455_64.dll")) continue;
if (dllFile.EndsWith("libcef.dll")) continue;
if (dllFile.EndsWith("libEGL.dll")) continue;
if (dllFile.EndsWith("libGLESv2.dll")) continue;
if (dllFile.EndsWith("WindowsAccessBridge-32.dll")) continue;
if (dllFile.EndsWith("WindowsAccessBridge-64.dll")) continue;
if (dllFile.EndsWith("WindowsAccessBridge.dll")) continue;
if (dllFile.EndsWith("vk_swiftshader.dll")) continue;
if (dllFile.EndsWith("vulkan-1.dll")) continue;
if (dllFile.EndsWith("cvextern.dll")) continue;
if (dllFile.EndsWith("opencv_videoio_ffmpeg455_64.dll")) continue;
if (dllFile.EndsWith("BouncyCastle.Crypto.dll")) continue;
if (dllFile.EndsWith("MailKit.dll")) continue;
if (dllFile.EndsWith("MimeKit.dll")) continue;

AssemblyName an = AssemblyName.GetAssemblyName(dllFile);
Assembly assembly = Assembly.Load(an);
// assemblies.Add(assembly);
Expand Down
2 changes: 1 addition & 1 deletion OpenRPA/OpenRPA.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Description>Base UI of OpenRPA, used as part of OpenRPA robot</Description>
<PackageLicenseExpression>MPL-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/open-rpa/openrpa</PackageProjectUrl>
<Version>1.4.55</Version>
<Version>1.4.56</Version>
<PackageReleaseNotes></PackageReleaseNotes>
<PackageIcon>openrpa.png</PackageIcon>
<Configurations>Debug;Release;ReleaseNuget;PrepInstaller</Configurations>
Expand Down
2 changes: 1 addition & 1 deletion OpenRPA/RobotInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ private async void RobotInstance_WebSocketClient_OnOpen()
}
GenericTools.RunUI(() =>
{
if (pendingwin.result == false)
if (pendingwin == null || pendingwin.result == false)
{
try
{
Expand Down

0 comments on commit 9448896

Please sign in to comment.