示例#1
0
        /// <summary>
        /// Pokreze izvrsavanje bloka
        /// </summary>
        /// <param name="settings">Podesavanja webLoader-a</param>
        /// <param name="__syncMode">mod sinhronizacije</param>
        /// <returns>Referencu prema webResultBlock-u</returns>
        public webResultBlock executeBlock(webLoaderSettings settings, executionSyncMode __syncMode,
                                           webRequestBlockEvent __onFinished = null,
                                           webRequestBlockEvent __onAborted  = null,
                                           webRequestBlockEvent __onProgress = null)
        {
            __settings = settings;

            deploySettings(settings, __onFinished, __onAborted, __onProgress);

            if (__syncMode != executionSyncMode.unknown)
            {
                executeSyncMode = __syncMode;
            }
            output.Clear();


            if (executeSyncMode == executionSyncMode.synced)
            {
                startExecution(settings);
            }
            else
            {
                executeThread = new Thread(startExecution);
                executeThread.Start(settings);
            }

            return(output);
        }
示例#2
0
 /// <summary>
 /// Postavlja event handler za ExecutionProgress (onExecutionProgress)
 /// </summary>
 public void onExecutionProgress_addHandler(webRequestBlockEvent _onExecutionProgress)
 {
     if (!onExecutionProgress_hasHandler)
     {
         onExecutionProgress += _onExecutionProgress;
     }
 }
示例#3
0
 /// <summary>
 /// Postavlja event handler za BlockAbortedEvent (onBlockAbortedEvent)
 /// </summary>
 public void onBlockAbortedEvent_addHandler(webRequestBlockEvent _onBlockAbortedEvent)
 {
     if (!onBlockAbortedEvent_hasHandler)
     {
         onBlockAbortedEvent += _onBlockAbortedEvent;
     }
 }
示例#4
0
        public void deploySettings(webLoaderSettings settings, webRequestBlockEvent __onFinished = null,
                                   webRequestBlockEvent __onAborted = null, webRequestBlockEvent __onProgress = null)
        {
            executeMode = settings.blockExecuteMode;

            onBlockFinishedEvent_addHandler(__onFinished);
            onBlockAbortedEvent_addHandler(__onAborted);
            onExecutionProgress_addHandler(__onProgress);
        }
示例#5
0
        public webRequestBlock(String __title = null, webRequestBlockEvent __onFinished = null,
                               webRequestBlockEvent __onAborted = null)
        {
            if (String.IsNullOrEmpty(__title))
            {
                __title = "Block " + imbStringGenerators.getRandomString(3);
            }

            title = __title;
        }