public List<TaskMetadata> GetAvailableTaskList() { var typeList = this._moduleInspector.FindTypesImplementingInterfaces(typeof(IDeployTaskDefinition)); List<TaskMetadata> returnList = new List<TaskMetadata>(); foreach(var type in typeList) { if(type.IsClass && !type.IsAbstract) { string taskDisplayName = type.Name; var attribute = type.GetCustomAttributes(typeof(TaskDefinitionMetadataAttribute), true).FirstOrDefault(); if(attribute != null) { taskDisplayName = ((TaskDefinitionMetadataAttribute)attribute).TaskName; } var item = new TaskMetadata { TaskTypeName = type.FullName, TaskDisplayName = taskDisplayName }; returnList.Add(item); } } return returnList; }
public object Get(TaskMetadata x) { return _taskManager.GetAvailableTaskList(); }