Ejemplo n.º 1
0
        public static List <string> GetAlgorithParamtersDescriptions(AlgorithmDefinition item, bool showCurrentValues = false, string cssForName = "", string cssForValue = "")
        {
            List <string> parameters       = new List <string>();
            var           cssForNameClose  = "";
            var           cssForValueClose = "";

            if (!string.IsNullOrWhiteSpace(cssForName))
            {
                cssForName      = $"<span class=\"{cssForName}\">";
                cssForNameClose = "</span>";
            }

            if (!string.IsNullOrWhiteSpace(cssForValue))
            {
                cssForValue      = $"<span class=\"{cssForValue}\">";
                cssForValueClose = "</span>";
            }

            foreach (var parm in item.Parameters)
            {
                if (parm.UseRange && !showCurrentValues)
                {
                    if (parm.ValueIsBoolean)
                    {
                        parameters.Add($"{cssForName}{GetAbbreviation(parm.Name)}{cssForNameClose}({cssForValue}TF{cssForValueClose})");
                    }
                    else
                    {
                        parameters.Add($"{cssForName}{GetAbbreviation(parm.Name)}{cssForNameClose}({cssForValue}{parm.RangeStart:G10}{cssForValueClose}-{cssForValue}{parm.RangeEnd:G10}{cssForValueClose}-{cssForValue}{parm.RangeStep:G10}{cssForValueClose})");
                    }
                }
                else
                {
                    if (parm.ValueIsBoolean)
                    {
                        bool boolVal = parm.BooleanValue;

                        parameters.Add($"{cssForName}{GetAbbreviation(parm.Name)}{cssForNameClose}({cssForValue}{(boolVal ? "T" : "F")}{cssForValueClose})");
                    }
                    else
                    {
                        parameters.Add($"{cssForName}{GetAbbreviation(parm.Name)}{cssForNameClose}({cssForValue}{parm.NumericValue:G10}{cssForValueClose})");
                    }
                }
            }

            return(parameters);
        }
Ejemplo n.º 2
0
 public static string GetAlgorithDescription(AlgorithmDefinition item, bool showCurrentValues = false, string cssForName = "", string cssForValue = "")
 {
     return(GetAlgorithmString(
                GetAbbreviation(item.Name),
                GetAlgorithParamtersDescriptions(item, showCurrentValues, cssForName, cssForValue)));
 }