Exemplo n.º 1
0
 private static string FormatMessage(string message, WorkflowSchemeParser parser)
 {
     return(parser.ReadDone
         ? message
         : string.Format("[{0}, стр {1}, поз {2}] {3}",
                         parser.FileName, parser.LineNumber, parser.LinePosition, message));
 }
        protected internal override WorkflowScheme CreateInstance(
            string workflowSchemeUri, IEnumerable <KeyValuePair <string, XmlReader> > customXmlSchemas)
        {
            CodeContract.Requires(!string.IsNullOrEmpty(workflowSchemeUri));
            var parser = new WorkflowSchemeParser();

            parser.Parse(workflowSchemeUri, customXmlSchemas);
            return(parser.Scheme);
        }
Exemplo n.º 3
0
        private Activity GetStartActivity(WorkflowExecutionContext context)
        {
            if (context.Restoring)
            {
                return(Activities[context.GetActivityNameToRestore()]);
            }
            if (StartActivity == null)
            {
                return(Activities.Values.First());
            }
            var startActivityFullName = WorkflowSchemeParser.CreateFullActivityName(StartActivity, Name);

            if (!Activities.ContainsKey(startActivityFullName))
            {
                throw new ActivityExecutionException(
                          "Начальное действие не найдено: " + startActivityFullName, this, context);
            }
            return(Activities[startActivityFullName]);
        }
Exemplo n.º 4
0
 public Activity GetChildActivity(string localChildActivityName)
 {
     return(Activities[WorkflowSchemeParser.CreateFullActivityName(localChildActivityName, this)]);
 }
Exemplo n.º 5
0
 public WorkflowSchemeParserException(string message, Exception innerEx, WorkflowSchemeParser parser)
     : base(FormatMessage(message, parser), innerEx)
 {
 }