Info() public method

public Info ( string mesage ) : void
mesage string
return void
コード例 #1
0
ファイル: Runner.cs プロジェクト: rosaliafx/Rosalia
        protected WorkflowInfo GetWorkflowInfo(RunningOptions options, IList<IWorkflowLookup> lookups, LogHelper log)
        {
            log.Info("Searching for workflows...");

            var lookupOptions = new LookupOptions(options);
            foreach (var lookup in lookups)
            {
                if (lookup.CanHandle(lookupOptions))
                {
                    log.Info("using lookup {0} for workflow searching", lookup.GetType());
                    var foundWorkflows = lookup.Find(lookupOptions);

                    return SelectDefaultWorkflow(foundWorkflows.ToList(), options, log);
                }
            }

            throw new Exception(string.Format("No lookup to handle input file: {0}", options.InputFile));
        }
コード例 #2
0
ファイル: Runner.cs プロジェクト: rosaliafx/Rosalia
        private WorkflowInfo SelectDefaultWorkflow(IList<WorkflowInfo> foundWorkflows, RunningOptions options, LogHelper log)
        {
            log.Info("workflows found: {0}", foundWorkflows.Count);

            if (foundWorkflows.Count == 0)
            {
                throw new Exception("No workflows found");
            }

            WorkflowInfo workflowToExecute = null;
            if (foundWorkflows.Count > 1)
            {
                if (string.IsNullOrEmpty(options.Workflow))
                {
                    throw new Exception("Multiple workflows found but default workflow was not set!");
                }

                workflowToExecute = foundWorkflows.FirstOrDefault(info =>
                    info.WorkflowType.FullName.Contains(options.Workflow));
            }
            else
            {
                workflowToExecute = foundWorkflows[0];
            }

            if (workflowToExecute == null)
            {
                throw new Exception("Could not select default workflow to execute.");
            }

            log.Info("Workflow to execute: {0}", workflowToExecute.WorkflowType.Name);

            return workflowToExecute;
        }