コード例 #1
0
 public RegionWithHealthRisk AddRegionWithCases(Region region, NumberOfPeople numCases)
 {
     return(new RegionWithHealthRisk()
     {
         Id = region,
         NumCases = numCases
     });
 }
コード例 #2
0
 public RegionWithHealthRisk AddRegionWithCases(RegionName region, int day, NumberOfPeople numCases)
 {
     return(new RegionWithHealthRisk()
     {
         Name = region,
         Days0to6 = 0,
         Days7to13 = 0,
         Days14to20 = 0,
         Days21to27 = 0
     });
 }
コード例 #3
0
 protected void AddNumberOfPeople(NumberOfPeople value)
 {
     if (QueryParameters.ContainsKey(Constants.NumberOfPeopleKey))
     {
         QueryParameters[Constants.NumberOfPeopleKey] = value == NumberOfPeople.None
             ? value
             : (NumberOfPeople)QueryParameters[Constants.NumberOfPeopleKey] | value;
     }
     else
     {
         QueryParameters.Add(Constants.NumberOfPeopleKey, value);
     }
 }
コード例 #4
0
        /// <summary>
        /// Override of the equality method.
        /// </summary>
        /// <param name="o"></param>
        /// <returns></returns>
        public bool Equals(Meals o)
        {
            //Check whether the compared object is null.
            if (ReferenceEquals(o, null))
            {
                return(false);
            }

            //Check whether the compared object references the same data.
            if (ReferenceEquals(this, o))
            {
                return(true);
            }

            //Check whether the Meals' properties are equal.
            return(_id.Equals(o._id) && NumberOfPeople.Equals(o.NumberOfPeople) && Type.Equals(o.Type));
        }
コード例 #5
0
 public void InsertNumCases(RegionWithHealthRisk region, int day, NumberOfPeople numCases)
 {
     if (day < 7)
     {
         region.Days0to6 += numCases;
     }
     else if (day < 14)
     {
         region.Days7to13 += numCases;
     }
     else if (day < 21)
     {
         region.Days14to20 += numCases;
     }
     else
     {
         region.Days21to27 += numCases;
     }
 }
コード例 #6
0
 public SearchImagesEditorial WithNumberOfPeople(NumberOfPeople value)
 {
     AddNumberOfPeople(value);
     return(this);
 }
コード例 #7
0
 public SearchImagesCreative WithNumberOfPeople(NumberOfPeople value)
 {
     AddNumberOfPeople(value);
     return(this);
 }
コード例 #8
0
        public SearchImages WithNumberOfPeople(NumberOfPeople value)
        {
            if (QueryParameters.ContainsKey(Constants.NumberOfPeopleKey))
            {
                QueryParameters[Constants.NumberOfPeopleKey] = value == NumberOfPeople.None
                    ? value
                    : (NumberOfPeople) QueryParameters[Constants.NumberOfPeopleKey] | value;
            }
            else
            {
                QueryParameters.Add(Constants.NumberOfPeopleKey, value);
            }

            return this;
        }
コード例 #9
0
 IEditorialImagesSearch IEditorialImagesSearch.WithNumberOfPeople(NumberOfPeople value)
 {
     return WithNumberOfPeople(value);
 }
コード例 #10
0
 /// <summary>
 /// Override of the get hash code method.
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode()
 {
     //Calculate the hash code for the GPOPolicy.
     return(_id.GetHashCode() ^ NumberOfPeople.GetHashCode() ^ Type.GetHashCode());
 }
コード例 #11
0
 IBlendedImagesSearch IBlendedImagesSearch.WithNumberOfPeople(NumberOfPeople value)
 {
     return WithNumberOfPeople(value);
 }
コード例 #12
0
 ICreativeImagesSearch ICreativeImagesSearch.WithNumberOfPeople(NumberOfPeople value)
 {
     return WithNumberOfPeople(value);
 }