예제 #1
0
        /// <summary>
        /// Adds director to Video
        /// </summary>
        /// <param name="director">Person, to be added as director</param>
        public void AddDirector(Director director)
        {
            bool addDirector = true;
            foreach (Director currentDirector in this.Directors)
            {
                if (currentDirector.Name == director.Name)
                {
                    addDirector = false;
                }
            }

            if (addDirector)
            {
                this.Directors.Add(director);
            }
        }
예제 #2
0
        /// <summary>
        /// Reads crew information from MovieCollector XML-file
        /// </summary>
        /// <param name="xMLNode">Part of XML-file representing Crew information</param>
        public void ReadCrew(XmlNode xMLNode)
        {
            foreach (XmlNode xMLCrewmember in xMLNode.XMLReadSubnode("crew").XMLReadSubnodes("crewmember"))
            {
                bool isDirector = xMLCrewmember.XMLReadSubnode("roleid").XMLReadInnerText(string.Empty) == "dfDirector";
                bool isWriter = xMLCrewmember.XMLReadSubnode("roleid").XMLReadInnerText(string.Empty) == "dfWriter";

                if (isDirector)
                {
                    Director director = new Director(this.Configuration);
                    director.ReadPerson(xMLCrewmember.XMLReadSubnode("person"));
                    this.Directors.Add(director);
                }

                if (isWriter)
                {
                    Writer writer = new Writer(this.Configuration);
                    writer.ReadPerson(xMLCrewmember.XMLReadSubnode("person"));
                    this.Writers.Add(writer);
                }
            }
        }