public ActionInfoAttribute(Type[] argAcceptedSubjects, Type[] argAcceptedObjects, params object[] argSkills) : this() { AcceptedSubjects = argAcceptedSubjects; AcceptedObjects = argAcceptedObjects; foreach (object ob in argSkills) { if (ob is string) { RequiredSkills.Add(Skills.GetSkillByName(ob as string)); } } }
/// <summary> /// Parse the result from the answer of question answer activity. /// </summary> /// <returns></returns> public void ParseResult_Execute(object sender, EventArgs e) { AgentSkill agentSkill = null; if (!_currentSkill.IsValidValue(this.Result)) { int index = int.Parse(Result) - 1; //the recognition match must be an index rather than the value itself. agentSkill = new AgentSkill(_currentSkill, _currentSkill.Values[index]); RequiredSkills.Add(agentSkill); } else if (this._currentSkill.IsValidValue(this.Result)) { //the value itself was recognized. agentSkill = new AgentSkill(_currentSkill, this.Result); RequiredSkills.Add(agentSkill); } }