private void AddHobby(int p_index, string p_hobby) { Hobbies.Add(p_index, new SimpleResumeElement { Description = p_hobby }); }
public void AddNewHobby(Hobby hobby) { if (Hobbies.Count < maxHobbyCount) { Hobbies.Add(hobby); } else { Console.WriteLine($"Can not add {hobby.Text}. Person has too many hobbies"); } }
private void InitHobbies(ResumeData p_resume) { ResumeDataHobbies v_home = (ResumeDataHobbies)p_resume.Items[2]; for (int i = 0; i < v_home.Hobbie.Length; i++) { ResumeDataHobbiesHobbie v_adr = (ResumeDataHobbiesHobbie)v_home.Hobbie.GetValue(i); int v_index = Convert.ToInt16(v_adr.index); Hobbies.Add(v_index, new SimpleResumeElement { Description = v_adr.Value.ToString().Replace("\\n", Environment.NewLine) }); } }
public virtual void ReadXml(XmlReader r) { r.ReadStartElement(); _name = r.ReadElementContentAsString("name", ""); _position = (EmployeePosition)Enum.Parse(typeof(EmployeePosition), r.ReadElementContentAsString("position", "")); _capacity = r.ReadElementContentAsFloat("capacity", ""); if (r.Name == "Hobbies") { while (r.NodeType == XmlNodeType.Element) { if (r.Name == "Hobbies") { Hobbies.Add(r.ReadElementContentAsString("hobby", "")); } } } r.ReadEndElement(); }