Esempio n. 1
0
        /// <summary>
        /// Auto-generated argument  string
        /// </summary>
        public string GetArgsString()
        {
            var ops = new List <string>();

            foreach (FieldInfo item in this.GetType().GetFields())
            {
                var  atts  = item.CustomAttributes;
                bool hasIt = atts.ToList().Exists(n => n.AttributeType == typeof(OptionAttribute));

                if (hasIt)
                {
                    string optionName      = item.Name;
                    string value           = (string)item.GetValue(this);
                    string surroundedValue = StringModifier.SurroundWith("\"", value);
                    string op = $"-{optionName}:{surroundedValue}";

                    ops.Add(op);
                }
            }

            string cmd = string.Join(" ", ops);

            return(cmd);
        }
Esempio n. 2
0
 /// <summary>
 /// Exe file path surrounded by " charater
 /// </summary>
 public string GetExePath()
 {
     return(StringModifier.SurroundWith("\"", _exePath));
 }