コード例 #1
0
ファイル: FileParser.cs プロジェクト: humeaua/CVATools
        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
ファイル: Tournament.cs プロジェクト: humeaua/CVATools
 public void Add(ref Player sPlayer, double dResult)
 {
     sResults.Add (new Tuple<string, string> (sPlayer.FirstName, sPlayer.LastName), dResult);
 }