Ejemplo n.º 1
0
        /// <summary>
        /// This method process the sequence file
        /// </summary>
        public void Execute()
        {
            if (sequence == null)
            {
                Log.Out(Log.Severity.Error, "Execute", "Sequence content is empty!");
                return;
            }

            // Registers to monitor the Inbox
            MailSimOperationsEventMonitor inboxEvent = new MailSimOperationsEventMonitor();

            inboxEvent.Folder        = "olFolderInbox";
            inboxEvent.OperationName = "DefaultInboxMonitor";
            EventMonitor(inboxEvent);

            // Run each operation group
            foreach (MailSimSequenceOperationGroup group in sequence.OperationGroup)
            {
                int iterations = GetIterationCount(group.Iterations);

                // Run the operations file
                operations = ConfigurationFile.LoadOperationFile(group.OperationFile, out operationXML);

                if (operations == null)
                {
                    Log.Out(Log.Severity.Error, group.Name, "Skipping OperationGroup");
                    continue;
                }

                for (int count = 1; count <= iterations; count++)
                {
                    Log.Out(Log.Severity.Info, group.Name, "Starting group run {0}", count);

                    foreach (MailSimSequenceOperationGroupTask task in group.Task)
                    {
                        ProcessTask(task);
                    }

                    Log.Out(Log.Severity.Info, group.Name, "Completed group task run {0}", count);

                    SleepOrStop(group.Name, group.Sleep);
                }

                CleanupAfterIteration();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This method process the sequence file
        /// </summary>
        internal void Execute()
        {
            if (sequence == null)
            {
                Log.Out(Log.Severity.Error, "Execute", "Sequence content is empty!");
                return;
            }

            // Registers to monitor the Inbox
            MailSimOperationsEventMonitor inboxEvent = new MailSimOperationsEventMonitor();
            inboxEvent.Folder = "olFolderInbox";
            inboxEvent.OperationName = "DefaultInboxMonitor";
            EventMonitor(inboxEvent);

            // Run each operation group
            foreach (MailSimSequenceOperationGroup group in sequence.OperationGroup)
            {
                int iterations = GetIterationCount(group.Iterations);

                // Run the operations file
                operations = ConfigurationFile.LoadOperationFile(group.OperationFile);

                if (operations == null)
                {
                    Log.Out(Log.Severity.Error, group.Name, "Skipping OperationGroup");
                    continue;
                }

                for (int count = 1; count <= iterations; count++)
                {
                    Log.Out(Log.Severity.Info, group.Name, "Starting group run {0}", count);

                    foreach (MailSimSequenceOperationGroupTask task in group.Task)
                    {
                        ProcessTask(task);
                    }

                    Log.Out(Log.Severity.Info, group.Name, "Completed group task run {0}", count);

                    SleepOrStop(group.Name, group.Sleep);
                }

                CleanupAfterIteration();
            }
        }