Exemple #1
0
 public void init()
 {
     try
     {
         if (Initilized)
         {
             return;
         }
         Initilized   = false;
         _windowCache = new HwndCache();
         Log.Debug("javahook.init()");
         accessBridge.Initilized += (e1, e2) =>
         {
             Initilized = true;
             Log.Information("javahook._accessBridge.Initilized");
             OnInitilized?.Invoke(accessBridge);
         };
         accessBridge.Initialize();
         refreshJvms(200);
         EnsureJavaBridge();
         pipeclient = new NamedPipeClient <JavaEvent>("openrpa_javabridge");
         pipeclient.ServerMessage += Pipeclient_ServerMessage;
         pipeclient.AutoReconnect  = true;
         pipeclient.Start();
     }
     catch (Exception ex)
     {
         Log.Error(ex.ToString());
     }
 }
Exemple #2
0
        public void init()
        {
            try
            {
                if (PluginConfig.auto_launch_java_bridge)
                {
                    EnsureJavaBridge();
                }
                if (pipeclient == null)
                {
                    var SessionId = System.Diagnostics.Process.GetCurrentProcess().SessionId;
                    pipeclient = new NamedPipeClient <JavaEvent>(SessionId + "_openrpa_javabridge");
                    pipeclient.ServerMessage += Pipeclient_ServerMessage;
                    pipeclient.Connected     += Pipeclient_Connected;
                    pipeclient.Disconnected  += Pipeclient_Disconnected;
                    pipeclient.AutoReconnect  = true;
                    pipeclient.Start();
                }
                if (Initilized)
                {
                    return;
                }
                GenericTools.RunUI(() =>
                {
                    Initilized   = false;
                    _windowCache = new HwndCache();
                    Log.Debug("javahook.init()");
                    accessBridge.Initilized += (e1, e2) =>
                    {
                        Initilized = true;
                        Log.Information("javahook._accessBridge.Initilized");
                        OnInitilized?.Invoke(accessBridge);
                    };
                    try
                    {
                        if (IntPtr.Size == 4)
                        {
                            // accessBridge.Initialize(true);
                            accessBridge.Initialize(false);
                        }
                        else
                        {
                            accessBridge.Initialize(false);
                        }

                        refreshJvms(200);
                    }
                    catch (Exception ex)
                    {
                        Log.Error(ex.ToString());
                    }
                });
            }
            catch (Exception ex)
            {
                Log.Error(ex.ToString());
            }
        }
Exemple #3
0
        public void init()
        {
            try
            {
                if (Initilized)
                {
                    return;
                }
                GenericTools.RunUI(() =>
                {
                    Initilized   = false;
                    _windowCache = new HwndCache();
                    Log.Debug("javahook.init()");
                    accessBridge.Initilized += (e1, e2) =>
                    {
                        Initilized = true;
                        Log.Information("javahook._accessBridge.Initilized");
                        OnInitilized?.Invoke(accessBridge);
                    };
                    try
                    {
                        if (IntPtr.Size == 4)
                        {
                            // accessBridge.Initialize(true);
                            accessBridge.Initialize(false);
                        }
                        else
                        {
                            accessBridge.Initialize(false);
                        }

                        refreshJvms(200);
                    }
                    catch (Exception ex)
                    {
                        Log.Error(ex.ToString());
                    }
                });
            }
            catch (Exception ex)
            {
                Log.Error(ex.ToString());
            }
        }