/// <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);
            }
        }
Esempio n. 2
0
        public webRequestBlockEventArgs(webRequestBlockEventType __type, String __message = "")

        {
            _type   = __type;
            message = __message;
        }