/// <summary>
        /// Event invoker za BlockFinishedEvent - ako je ovaj objekat uzrok dogadjaja onda moze i bez argumenata da se pozove
        /// </summary>
        /// <param name="sender">Objekat koji je pozvao izvrsavanje - ako je null smatrace da je ovaj objekat uzrok dogadjaja</param>
        /// <param name="args">Argumenti dogadjaja - ako je null postavlja da je unknown</param>
        public void callBlockFinishedEvent()
        {
            webRequestBlockEventType status = webRequestBlockEventType.executedAllOk;
            Int32 withErrors = 0;

            foreach (webRequest rq in this)
            {
                if (rq.isErrorStatus)
                {
                    withErrors++;
                }
            }

            if (withErrors == 0)
            {
                status = webRequestBlockEventType.executedAllOk;
            }
            else if (withErrors == Count)
            {
                status = webRequestBlockEventType.executedAllError;
            }
            else
            {
                status = webRequestBlockEventType.executedWithErrors;
            }

            String __message = " Execution success rate: " + imbStringFormats.imbGetPercentage(withErrors, Count, 1);

            webRequestBlockEventArgs args = new webRequestBlockEventArgs(status, __message);

            if (onBlockFinishedEvent != null)
            {
                onBlockFinishedEvent(this, args);
            }
        }
Пример #2
0
 /// <summary>
 /// Event invoker za RequestBlockFinished - ako je ovaj objekat uzrok dogadjaja onda moze i bez argumenata da se pozove
 /// </summary>
 /// <param name="sender">Objekat koji je pozvao izvrsavanje - ako je null smatrace da je ovaj objekat uzrok dogadjaja</param>
 /// <param name="args">Argumenti dogadjaja - ako je null postavlja da je unknown</param>
 public void callRequestBlockFinished(webRequestBlock sender, webRequestBlockEventArgs args)
 {
     if (onRequestBlockAborted != null)
     {
         webLoaderEventArgs loaderArgs = new webLoaderEventArgs(webLoaderEventType.blockFinished, args.message);
         onRequestBlockAborted(this, loaderArgs);
     }
 }
Пример #3
0
 public void callExecutionProgress(webRequestBlock sender, webRequestBlockEventArgs args)
 {
     if (onExecutionProgress != null)
     {
         webLoaderEventArgs loaderArgs = new webLoaderEventArgs(webLoaderEventType.progress, args.message);
         onExecutionProgress(this, loaderArgs);
     }
 }
Пример #4
0
        /// <summary>
        /// Event invoker za ExecutionProgress - Progress
        /// </summary>
        public void callExecutionProgress()
        {
            if (onExecutionProgress != null)
            {
                webRequestBlockEventArgs args = new webRequestBlockEventArgs(webRequestBlockEventType.progressReport,
                                                                             progressMessage);

                onExecutionProgress(this, args);
            }
        }
Пример #5
0
        /// <summary>
        /// Event invoker za BlockAbortedEvent - ako je ovaj objekat uzrok dogadjaja onda moze i bez argumenata da se pozove
        /// </summary>
        /// <param name="sender">Objekat koji je pozvao izvrsavanje - ako je null smatrace da je ovaj objekat uzrok dogadjaja</param>
        /// <param name="args">Argumenti dogadjaja - ako je null postavlja da je unknown</param>
        public void callBlockAbortedEvent(String __message = "User aborted")
        {
            webRequestBlockEventArgs args = new webRequestBlockEventArgs(webRequestBlockEventType.aborted,
                                                                         "Aborted :: " + title + " [" + output.Count +
                                                                         " / " + Count + "] :: " + __message);

            if (onBlockAbortedEvent != null)
            {
                onBlockAbortedEvent(this, args);
            }
        }