示例#1
0
        /// <summary>
        /// clone nanny
        /// </summary>
        /// <returns>clone nanny object</returns>
        public Nanny Clone()
        {
            Nanny nanny = (Nanny)MemberwiseClone();

            nanny.IsWork    = (bool[])IsWork.Clone();
            nanny.WorkHours = (TimeSpan[][])WorkHours.Clone();
            return(nanny);
        }
示例#2
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public Mother()
 {
     NeedNannyOnDay = new bool[6];
     HoursForDay    = new WorkHours[6];
     for (int i = 0; i < 6; i++)
     {
         HoursForDay[i] = new WorkHours();
     }
 }
示例#3
0
 public Mother()
 {
     for (int i = 0; i < 6; i++)
     {
         bool flag = false;
         if (i % 2 == 0)
         {
             flag = true;
         }
         workHours[i] = new WorkHours(new TimeSpan(i + 8, 0, 0), new TimeSpan(i + 16, 0, 0), flag);
     }
 }
        public string get_hours_s()
        {
            if (WorkHours == null)
            {
                return(null);
            }
            string result = "";

            if (WorkHours != null)
            {
                int sizeA = WorkHours.GetLength(0);
                int sizeB = WorkHours.GetLength(1);
                result += "" + sizeA + "," + sizeB;
                for (int i = 0; i < sizeA; i++)
                {
                    for (int j = 0; j < sizeB; j++)
                    {
                        result += "," + WorkHours[i, j];
                    }
                }
            }
            return(result);
        }