Beispiel #1
0
 protected virtual void OnProcessAdded(Public.ProcessEventArgs e)
 {
     if (ProcessAdded != null)
     {
         ProcessAdded(this, e);
     }
 }
Beispiel #2
0
 protected virtual void OnWindowPositionSizeChanged(Public.ProcessEventArgs e)
 {
     if (WindowPositionSizeChanged != null)
     {
         WindowPositionSizeChanged(this, e);
     }
 }
Beispiel #3
0
 protected virtual void OnWindowTitleChanged(Public.ProcessEventArgs e)
 {
     if (WindowTitleChanged != null && !myWindowProcess.HasExited)
     {
         WindowTitleChanged(this, e);
     }
 }
Beispiel #4
0
 protected virtual void OnWindowProcessExit(Public.ProcessEventArgs e)
 {
     if (WindowProcessExit != null)
     {
         WindowProcessExit(this, e);
     }
 }
Beispiel #5
0
 protected virtual void OnProcessFound_Removed(object sender, Public.ProcessEventArgs e)
 {
     try
     {
         if (myWindowsForWatching != null)
         {
             foreach (WindowHandle.Window w in myWindowsForWatching)
             {
                 if (w != null && e != null && e.Window != null && w.Processname == e.Window.Processname)
                 {
                     Events_WatchingWindows(w, false);
                     w.Dispose();
                     break;
                 }
             }
         }
         else
         {
             throw new ArgumentNullException("myWindowsForWatching");
         }
     }
     catch (Exception ex)
     {
         Log.cLogger.Log(ex);
     }
 }
Beispiel #6
0
        protected virtual void OnProcessFound_Added(object sender, Public.ProcessEventArgs e)
        {
            try
            {
                if (myWindowsForWatching != null)
                {
                    if (e != null && e.Window != null)
                    {
                        myWindowsForWatching.Add(e.Window);

                        Events_WatchingWindows(e.Window, true);
                    }
                    else
                    {
                        Log.cLogger.Log("Can't add Window to the Watching collection, event or Window is null");
                    }
                }
                else
                {
                    throw new ArgumentNullException("myWindowsForWatching");
                }
            } catch (Exception ex)
            {
                Log.cLogger.Log(ex);
            }
        }
Beispiel #7
0
 void Window_WindowBasicChanged(object sender, Public.ProcessEventArgs e)
 {
     try
     {
         ExternalToolConfig _ret = CheckProcessForEvents(e.Window.Processname, ProcessEventTyp.BasicData);
         if (_ret != null)
         {
             //Process exit event
             OnLoadedEvent(e.Window, _ret);
         }
     } catch (Exception ex)
     {
         Log.cLogger.Log(ex);
     }
 }
Beispiel #8
0
        void myGPrc_ProcessRemoved(object sender, Public.ProcessEventArgs e)
        {
            try
            {
                if (myProcessToWatch != null && myProcessToWatch.ContainsKey(e.Window.Processname))
                {
                    ExternalToolConfig _ret = CheckProcessForEvents(e.Window.Processname, ProcessEventTyp.ProcessEnd);
                    if (_ret != null)
                    {
                        //Process exit event
                        OnLoadedEvent(e.Window, _ret);
                    }

                    Log.cLogger.Log(string.Format("Watcher found Process in Collection are getting removed, Processname:'{0}'", e.Window.Processname));

                    OnProcessFound_Removed(sender, e);
                }
            } catch (Exception ex)
            {
                Log.cLogger.Log(ex);
            }
        }