/// <summary>
 /// Called when [process event].
 /// </summary>
 /// <param name="processType">Type of the process.</param>
 private void OnProcessEvent(ProcessEventType processType)
 {
     if (processType == ProcessEventType.ModulesInitialized)
     {
         _container.Resolve <MeterView>();
     }
 }
 /// <summary>
 /// Called when [process event].
 /// </summary>
 /// <param name="processType">Type of the process.</param>
 private void OnProcessEvent(ProcessEventType processType)
 {
     if (processType == ProcessEventType.ModulesInitialized)
     {
         _container.Resolve<MeterView>();
     }
 }
 /// <summary>
 /// Called when [process event].
 /// </summary>
 /// <param name="processEvent">The process event.</param>
 private void OnProcessEvent(ProcessEventType processEvent)
 {
     if (processEvent == ProcessEventType.ApplicationShutdown && !_databaseWriter.IsBusy)
     {
         WriteDatabaseToDisk();
     }
 }
Exemple #4
0
        private void event_arrived(ProcessEventType type, uint pid)
        {
            if (IsDisposed || !this.IsHandleCreated)
            {
                return;
            }

            lock (_locker)
            {
                this.BeginInvoke(new MethodInvoker(() =>
                {
                    if (type == ProcessEventType.Start)
                    {
                        var process      = Process.GetProcessById((int)pid);
                        var button       = GetProcessButton(process);
                        var killerButton = GetProcessKillerButton(button);
                        _buttonsContainer.Controls.Add(button);
                        if (_disableProcessKiller)
                        {
                            killerButton.Hide();
                        }
                        _buttonsContainer.Controls.Add(killerButton);
                        button.ShowPerformanceCounter();
                        SetProcessButtonActiveByProcessId(pid);
                    }
                    else if (type == ProcessEventType.Stop)
                    {
                        var processButtons       = _buttonsContainer.Controls.OfType <ProcessButton>().ToList();
                        var processKillerButtons = _buttonsContainer.Controls.OfType <ProcessKillerButton>().ToList();

                        var buttonToRemove = processButtons.FirstOrDefault(button => button.Process.Id == pid);
                        if (buttonToRemove == null)
                        {
                            return;
                        }

                        buttonToRemove.HidePerformanceCounter();
                        _buttonsContainer?.Controls.Remove(buttonToRemove);
                        buttonToRemove.Dispose();

                        var killerButtonToRemove = processKillerButtons.FirstOrDefault(button => button.ProcessButton.Process.Id == pid);
                        if (killerButtonToRemove == null)
                        {
                            return;
                        }
                        _buttonsContainer?.Controls.Remove(killerButtonToRemove);
                        killerButtonToRemove.Dispose();
                    }

                    ResizeWindowIfNeeded();
                }));
            }
        }
 /// <summary>
 /// Called when [process event].
 /// </summary>
 /// <param name="processEvent">The process event.</param>
 private void OnProcessEvent(ProcessEventType processEvent)
 {
     if (processEvent == ProcessEventType.ApplicationShutdown && !_databaseWriter.IsBusy) 
         WriteDatabaseToDisk();
 }
 /// <summary>
 /// Creates a new instance of the ProcessEventArgs class
 /// </summary>
 /// <param name="eventType">The type of event</param>
 /// <param name="process">The process</param>
 public ProcessEventArgs(ProcessEventType eventType, Process process)
     : this(eventType, process, null)
 {
 }
 /// <summary>
 /// Creates a new instance of the ProcessEventArgs class
 /// </summary>
 /// <param name="eventType">The type of event</param>
 /// <param name="process">The process</param>
 /// <param name="line">The line</param>
 public ProcessEventArgs(ProcessEventType eventType, Process process, string line)
 {
     EventType = eventType;
     Process   = process;
     Line      = line;
 }
Exemple #8
0
        /// <summary>
        /// Retrieve a list of process statuses, which shows information regarding previously executed PUT/POST requests in descending order.
        /// You need to supply an entity id and event type.
        /// </summary>
        /// <param name="entityId">The entity id is not unique so you need to provide an event type. The entity id can either be order item id, transport id, return number or inbound reference.</param>
        /// <param name="eventType">The event type can only be used in combination with the entity id.</param>
        /// <param name="page">The requested page number with a pagesize of 50</param>
        /// <returns></returns>
        public async Task <ProcessStatusesContainer> GetProcessStatusByEntityAndEvent(string entityId, ProcessEventType eventType, int page = 1)
        {
            var queryParameters = new Dictionary <string, string>
            {
                { "entity-id", entityId },
                { "event-type", eventType.ToString() },
                { "page", page.ToString() }
            };
            var response = await Get("/process-status", queryParameters).ConfigureAwait(false);

            return(await BolApiHelper.GetContentFromResponse <ProcessStatusesContainer>(response).ConfigureAwait(false));
        }
 public ProcessEventArgs(string processName, int processId, ProcessEventType eventType)
 {
     _processName = processName;
     _processId = processId;
     _eventType = eventType;
 }