コード例 #1
0
        private ProcessDefinition ExtractProcessFromCompiledSource(Compilation compilation, string processName)
        {
            var w = new Walk();
            var processType = w.Visit(compilation.SourceModule.GlobalNamespace);

            if (!processType.Any()) return null;

            INamedTypeSymbol processSymbol = null;
            if (string.IsNullOrWhiteSpace(processName))
            {
                processSymbol = processType.FirstOrDefault(x => x.Interfaces.Any(i => i.Name == ProcessIfxName));
            }
            else
            {
                processSymbol = processType.FirstOrDefault(x => x.Name.Contains(processName) && x.Interfaces.Any(i => i.Name == ProcessIfxName));
            }

            if (processSymbol == null)
                return null;

            var p = new ProcessDefinition(processSymbol, ProcessIfxName);
            p.SetStateEnumUsingStrategy(defaultStateDiscoveryStrategy);

            return p;
        }
コード例 #2
0
 public static MilToken GetTokenFromDefinition(ProcessDefinition definition)
 {
     return((definition == null || !definition.IsDefinitionComplete) ?
            TokenFactory.GetStatementTerminator()
                : TokenFactory.GetStateDefinition(definition.ProcessName, definition.StateProperty.Name, definition.StateEnum.MemberNames));
 }
コード例 #3
0
 public static MilToken GetTokenFromDefinition(ProcessDefinition definition)
 {
     return (definition == null || !definition.IsDefinitionComplete) ?
                                                                         TokenFactory.GetStatementTerminator()
                : TokenFactory.GetStateDefinition(definition.ProcessName, definition.StateProperty.Name, definition.StateEnum.MemberNames);
 }