Exemplo n.º 1
0
        public virtual IAlgorithm CreateInstance()
        {
            IAlgorithm alg = AlgorithmPluginEnumerator.GetAlgorithm(Type.ConvertToType(true));

            if (null != alg && alg.TakesParameters)
            {
                alg.Parameters = this.Parameters;
            }

            return(alg);
        }
Exemplo n.º 2
0
 public static IEditableParameter AsEditable(this IAlgorithm alg)
 {
     return(new EditableParameterBase()
     {
         ParamName = alg.Name,
         Description = "TODO Add description attributes to algorithms",
         // TODO Should be same as AlgorithmParameter::GetDefault()
         Default = AlgorithmPluginEnumerator.GetAlgorithm(alg.GetType()),
         ValueType = typeof(IAlgorithm),
         Value = alg,
         Property = null
     });
 }
Exemplo n.º 3
0
        public override IAlgorithm CreateInstance()
        {
            CompositeAlgorithm alg = AlgorithmPluginEnumerator.GetAlgorithm(Type.ConvertToType(true)) as CompositeAlgorithm;

            if (alg == null)
            {
                throw new Exception("Failed to create composite algorithm from composite algorithm info");
            }

            alg.Algorithms = new AlgorithmList();
            alg.Algorithms.AddRange(this.Algorithms.Select(info => info.ToInstance()));

            alg.CompositeName = this.CompositeName;

            return(alg);
        }
Exemplo n.º 4
0
 public override object GetDefault()
 {
     return(AlgorithmPluginEnumerator.GetAlgorithm(DefaultType));
 }
Exemplo n.º 5
0
 private static IAlgorithm FindAlgorithm(string typeName)
 {
     return(AlgorithmPluginEnumerator.GetAlgorithm(typeName));
 }