예제 #1
0
        public void ParsePlayer(ref string cFilePath, ref Player player)
        {
            string cSearchedString = "/events/events_scorecard.sps?EventID";
            string cBegin = @"""newsdate"">";
            //string cEnd = "</a>&nbsp;</td>";
            foreach (var line in System.IO.File.ReadAllLines(cFilePath))
            {
                if (line.Contains (cSearchedString))
                {
                    int iFirst = line.IndexOf (cBegin) + cBegin.Length + 1;
                    int iLast = line.IndexOf (cBegin);

                    //string cTournamentName = line.Substring (iFirst, iLast - iFirst);
                    player.TournamentsPlayed++;
                }
            }
            /*
             static void Main(string[] args) {
            String xml = @"
            <transactions>
                <transaction name=""Fred"" amount=""5,20"" />
                <transaction name=""John"" amount=""10,00"" />
                <transaction name=""Fred"" amount=""3,00"" />
            </transactions>";

            XDocument xmlDocument = XDocument.Parse(xml);

            var query = from x in xmlDocument.Descendants("transaction")
                    group x by x.Attribute("name").Value into g
                    select new { Name = g.Key, Amount = g.Sum(t => Decimal.Parse(t.Attribute("amount").Value)) };

            foreach (var item in query) {
            Console.WriteLine("Name: {0}; Amount: {1:C};", item.Name, item.Amount);
            }
            }
             */
        }
예제 #2
0
 public void Add(ref Player sPlayer, double dResult)
 {
     sResults.Add (new Tuple<string, string> (sPlayer.FirstName, sPlayer.LastName), dResult);
 }