Пример #1
0
        bool TryGetConstructor(out FlowConstructor constructor)
        {
            constructor = null;

            var constructors = _info.DeclaredType.GetConstructors(BindingFlags.Public | BindingFlags.Instance);

            if (constructors.Length == 0)
            {
                Log.Warning("[timeline] Flow {Type} has no public parameterless constructor; ignoring", _info);
            }
            else
            {
                if (constructors.Length == 1)
                {
                    if (constructors[0].GetParameters().Length == 0)
                    {
                        constructor = new FlowConstructor(constructors[0]);
                    }
                    else
                    {
                        Log.Warning("[timeline] Flow {Type} constructor has parameters; ignoring", _info);
                    }
                }
            }

            return(constructor != null);
        }
Пример #2
0
 internal TopicType(
     AreaTypeInfo info,
     FlowConstructor constructor,
     FlowObservationSet observations,
     ResumeAlgorithm resumeAlgorithm)
     : base(info, constructor, observations, resumeAlgorithm)
 {
 }
Пример #3
0
 internal QueryType(
     AreaTypeInfo info,
     FlowConstructor constructor,
     FlowObservationSet observations,
     ResumeAlgorithm resumeAlgorithm,
     int batchSize)
     : base(info, constructor, observations, resumeAlgorithm)
 {
     BatchSize = batchSize;
 }
Пример #4
0
 internal FlowType(
     AreaTypeInfo info,
     FlowConstructor constructor,
     FlowObservationSet observations,
     ResumeAlgorithm resumeAlgorithm)
     : base(info)
 {
     Constructor     = constructor;
     Observations    = observations;
     ResumeAlgorithm = resumeAlgorithm;
 }