Exemplo n.º 1
0
        //public static ObservableCollection<Member> _members;

        /*private ObservableCollection<Member> GenerateMembers(int cnt)
         * {
         *  var obvlist = new ObservableCollection<Member>();
         *
         *  for (int i = 0; i < cnt; i++)
         *  {
         *      obvlist.Add(new Member { firstName = "fn" + i, lastName = "ln" + i });
         *  }
         *
         *  return obvlist;
         * }*/

        /*        private string _firstName = "Akshay";
         *      public string FirstName
         *      {
         *          get
         *          {
         *              return _firstName;
         *          }
         *          set
         *          {
         *//* _firstName = value;
         *               NotifyOfPropertyChange(() => FirstName);*//*
         *              _firstName = value;
         *
         *          }
         *      }*/

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            //Get the needed data

            //_members = GenerateMembers(20);

            _matchDetails = ClassXML.ReadXML <ObservableCollection <FootMatches> >("Football_Match_Details.xml");

            if (_matchDetails == null)
            {
                _matchDetails = new ObservableCollection <FootMatches>();
            }
        }
Exemplo n.º 2
0
        /*public string Add_Match(string[] _detailsMatch)
         * {
         *  var obvMatch = new ObservableCollection<FootMatches>();
         *  //obvMatch.Add(new FootMatches { FirstName = "fn" + i, LastName = "ln" + i });
         *  if (_detailsMatch != null)
         *  {
         *      MessageBox.Show("Please " + _detailsMatch[2]);
         *//* MessageBox.Show("Please " + _detailsMatch["Team1"]);
         *       MessageBox.Show("Please " + _detailsMatch["typeOfPitch"]);
         *       MessageBox.Show("Please " + _detailsMatch["MatchDate"]); */
        /* var Team1 = _detailsMatch["Team1"];
         * var Team2 = _detailsMatch["Team2"];*/
        /*obvMatch.Add(_detailsMatch["Team2"]);*/

        /*ClassXML.WriteXml<Dictionary<string, string>>(_detailsMatch, "Football_Match_Details.xml");*//*
         * ClassXML.WriteXml<string[]>(_detailsMatch, "Football_Match_Details.xml");
         *
         *
         * }
         *
         * return "Msg";
         * }*/

        public ObservableCollection <FootMatches> Add_Match(Dictionary <string, string> _detailsMatch)
        {
            /*var obvMatch = new ObservableCollection<FootMatches>();*/
            //obvMatch.Add(new FootMatches { FirstName = "fn" + i, LastName = "ln" + i });
            if (_detailsMatch != null)
            {
                /*MessageBox.Show("Please " + _detailsMatch[2]);*/

                var team_one = _detailsMatch["Team1"];
                var team_two = _detailsMatch["Team2"];

                App._matchDetails.Add(new FootMatches {
                    Team1 = _detailsMatch["Team1"], Team2 = _detailsMatch["Team2"], MatchDate = _detailsMatch["MatchDate"], typeOfPitch = _detailsMatch["typeOfPitch"], Referee = _detailsMatch["Referee"]
                });
                /*ClassXML.WriteXml<Dictionary<string, string>>(_detailsMatch, "Football_Match_Details.xml");*/
                ClassXML.WriteXml <ObservableCollection <FootMatches> >(App._matchDetails, "Football_Match_Details.xml");
                MessageBox.Show("Match Details Saved");
            }

            return(App._matchDetails);
        }