Пример #1
0
 public CricketOfficial(Official u1, Official u2, Official u3, Official referee)
 {
     Umpire1 = u1;
     Umpire2 = u2;
     Umpire3 = u3;
     Referee = referee;
 }
Пример #2
0
        private static CricketOfficial CreateCricketOfficial(KeyValuePair <string, object> match)
        {
            var matchKeyValue = match.Value as Dictionary <string, object>;

            try
            {
                var official = matchKeyValue["official"] as Dictionary <string, Object>;


                if (official != null)
                {
                    Official u1      = GetOfficial(official, "umpire1");
                    Official u2      = GetOfficial(official, "umpire2");
                    Official u3      = GetOfficial(official, "umpire3");
                    Official referee = GetOfficial(official, "referee");

                    return(new  CricketOfficial(u1, u2, u3, referee));
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception)
            {
                return(null);
            }
        }