예제 #1
0
        private ResumeData LoadFromXML(string p_filename)
        {
            ResumeData v_result = new ResumeData();

            if (!string.IsNullOrWhiteSpace(p_filename) && File.Exists(p_filename))
            {
                try
                {
                    var v_serializer = new XmlSerializer(typeof(ResumeData));

                    using (var v_stream = new StringReader(File.ReadAllText(p_filename)))
                    {
                        using (var v_reader = XmlReader.Create(v_stream))
                        {
                            v_result = (ResumeData)v_serializer.Deserialize(v_reader);
                        }
                    }
                }
                catch (Exception v_ex)
                {
                }
            }

            return(v_result);
        }
예제 #2
0
        public Resume()
        {
            ResumeData v_myResumeFromXML = LoadFromXML(AppLocationFinder.Current + @"\Data\ResumeData.xml");

            Speak();
            //Init();
            Init(v_myResumeFromXML);
        }
예제 #3
0
 private void Init(ResumeData p_resume)
 {
     InitCivil(p_resume);
     InitPro(p_resume);
     InitHobbies(p_resume);
     InitLearning(p_resume);
     InitTechSkills(p_resume);
     InitLanguages(p_resume);
     InitManagerSkills(p_resume);
 }
예제 #4
0
        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)
                });
            }
        }
예제 #5
0
        private void InitCivil(ResumeData p_resume)
        {
            ResumeDataHome v_home = (ResumeDataHome)p_resume.Items[0];

            for (int i = 0; i < v_home.HomeElement.Length; i++)
            {
                ResumeDataHomeHomeElement v_adr = (ResumeDataHomeHomeElement)v_home.HomeElement.GetValue(i);
                int v_index = Convert.ToInt16(v_adr.index);
                Civil.Add(v_index, new SimpleResumeElement
                {
                    Description    = v_adr.Value.ToString().Replace("\\n", Environment.NewLine),
                    IconForElement = v_adr.icon
                });
            }
        }
        private void InitManagerSkills(ResumeData p_resume)
        {
            ResumeDataSkills           v_home = (ResumeDataSkills)p_resume.Items[5];
            ResumeDataSkillsManagement v_adr  = (ResumeDataSkillsManagement)v_home.Management.GetValue(0);

            for (int i = 0; i < v_adr.Skill.Length; i++)
            {
                Skill v_skill = (Skill)v_adr.Skill.GetValue(i);

                int v_index = Convert.ToInt16(v_skill.index);
                ManagerSkills.Add(v_index, new SkillsResumeElement
                {
                    Description = !string.IsNullOrEmpty(v_skill.Value) ? v_skill.Value.ToString().Replace("\\n", Environment.NewLine) : null,
                    Level       = Convert.ToByte(v_skill.level)
                });
            }
        }
예제 #7
0
        private void InitLearning(ResumeData p_resume)
        {
            ResumeDataLearning v_home = (ResumeDataLearning)p_resume.Items[4];

            for (int i = 0; i < v_home.Learn.Length; i++)
            {
                ResumeDataLearningLearn v_adr = (ResumeDataLearningLearn)v_home.Learn.GetValue(i);
                int v_index = Convert.ToInt16(v_adr.index);
                Learning.Add(v_index, new LearningResumeElement
                {
                    Name        = v_adr.name,
                    Description = !string.IsNullOrEmpty(v_adr.Value) ? v_adr.Value.ToString().Replace("\\n", Environment.NewLine) : null,
                    Year        = Convert.ToUInt16(v_adr.year),
                    Firm        = v_adr.firm,
                    DayLength   = !string.IsNullOrEmpty(v_adr.length) ? (ushort?)Convert.ToUInt16(v_adr.length) : null
                });
            }
        }
예제 #8
0
        private void InitPro(ResumeData p_resume)
        {
            ResumeDataJobs v_home = (ResumeDataJobs)p_resume.Items[1];

            for (int i = 0; i < v_home.Job.Length; i++)
            {
                ResumeDataJobsJob v_adr = (ResumeDataJobsJob)v_home.Job.GetValue(i);
                int v_index             = Convert.ToInt16(v_adr.index);
                Jobs.Add(v_index, new ProResumeElement
                {
                    Name           = v_adr.name,
                    Description    = !string.IsNullOrEmpty(v_adr.Value) ? v_adr.Value.ToString().Replace("\\n", Environment.NewLine) : null,
                    IconForElement = v_adr.icon,
                    FirmName       = v_adr.firm,
                    StartingDate   = Convert.ToDateTime(v_adr.startingDate),
                    EndingDate     = !string.IsNullOrEmpty(v_adr.endingDate) ? Convert.ToDateTime(v_adr.endingDate) : new DateTime(2017, 9, 1)
                });
            }
        }
예제 #9
0
        private void InitTechSkills(ResumeData p_resume)
        {
            ResumeDataSkills v_home = (ResumeDataSkills)p_resume.Items[5];

            for (int j = 0; j < v_home.Technical.Length; j++)
            {
                ResumeDataSkillsTechnical v_adr = (ResumeDataSkillsTechnical)v_home.Technical.GetValue(j);

                for (int i = 0; i < v_adr.Skill.Length; i++)
                {
                    Skill v_skill = (Skill)v_adr.Skill.GetValue(i);

                    int v_index = Convert.ToInt16(v_skill.index);
                    Skills.Add(v_index * (10 * j + 1), new SkillsResumeElement
                    {
                        Description = !string.IsNullOrEmpty(v_skill.Value) ? v_skill.Value.ToString().Replace("\\n", Environment.NewLine) : null,
                        Level       = Convert.ToByte(v_skill.level),
                        Group       = (SkillsResumeElement.Category)Enum.Parse(typeof(SkillsResumeElement.Category), v_adr.category, true)
                    });
                }
            }
        }