Ejemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 public Players() {
     fileNameField = string.Empty;
     versionField = 0;
     userIdField = 0;
     fetchedDateField = DateTime.MinValue;
     userIsSupporterField = false;
     isYouthField = false;
     actionTypeField = string.Empty;
     isPlayingMatchField = false;
     teamField = new Team();
 }
        private Team ParseTeamNode(XmlNode teamNode)
        {
            try {
                Team team = new Team();

                foreach (XmlNode xmlNode in teamNode.ChildNodes) {
                    switch (xmlNode.Name) {
                        case Tags.TeamID:
                            team.teamIdField = GenericFunctions.ConvertStringToUInt(xmlNode.InnerText);
                            break;
                        case Tags.TeamName:
                            team.teamNameField = xmlNode.InnerText;
                            break;
                        case Tags.PlayerList:
                            if (xmlNode.ChildNodes != null) {
                                team.playerListField = ParsePlayerListNode(xmlNode);
                            }
                            break;
                    }
                }

                return team;
            } catch (Exception ex) {
                throw ex;
            }
        }