Golem.Core.RecipeCataloger.CreateTaskFromAttribute C# (CSharp) Method

CreateTaskFromAttribute() private static method

private static CreateTaskFromAttribute ( MethodInfo method, TaskAttribute ta ) : Task
method System.Reflection.MethodInfo
ta TaskAttribute
return Task
        private static Task CreateTaskFromAttribute(MethodInfo method, TaskAttribute ta)
        {
            Task t = new Task();

            if(! String.IsNullOrEmpty(ta.Name))
                t.Name = ta.Name;
            else
                t.Name = method.Name.Replace("Task", "").ToLower();

            t.Method = method;

            if(! String.IsNullOrEmpty(ta.Description))
                t.Description = ta.Description;
            else
                t.Description = "";
            return t;
        }