using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using JWH.DATA;
namespace DDUtilityApp.DATA
{
public class Workflow : DataTableBase
{
///
/// Model ID
///
public string ModelID { get; set; }
///
/// File Name
///
public string FileName { get; set; }
///
///
///
public string DisplayName { get; set; }
///
/// Library Name
///
public string LibraryName { get; set; }
///
/// Class Name
///
public string ClassName { get; set; }
///
/// Method Name
///
public string MethodName { get; set; }
///
/// Argument collection
///
public List Arguments { get; set; } = new List();
[ReadOnly(true)]
public string ArgumentsText
{
get { return this.GetArgumentsText(); }
}
public Workflow()
{
}
public Workflow(string modelID, string fileName)
{
this.ModelID = modelID;
this.FileName = fileName;
}
private string GetArgumentsText()
{
StringBuilder sb = new StringBuilder();
foreach (Argument arg in this.Arguments)
{
if (sb.Length > 0) sb.Append(", ");
sb.Append(arg.ToString());
}
return sb.ToString();
}
}
public class Argument
{
public string Name { get; set; }
public string Type { get; set; }
public string Value { get; set; }
public Argument()
{
}
public Argument( string name, string type, string value)
{
this.Name = name;
this.Type = type;
this.Value = value;
}
public override string ToString()
{
return $"Name = {this.Name}, type = {this.Type}, Value = {this.Value}";
}
}
}