コード例 #1
0
        /// <summary>
        /// 将一周内的某一天的工作表项,拷贝到一周内的其他日期中。
        /// </summary>
        /// <param name="dayOfWeek">星期几</param>
        public void CopyToAll(DayOfWeek dayOfWeek)
        {
            lock (this)
            {
                DayOfWeekWorkSheet ws = this[(Int32)dayOfWeek];
                var items             = (from i in ws.Items
                                         select new { i.BeginTime, i.EndTime, i.Enabled, i.Content, i.Id }).ToArray();

                for (int i = 0; i < m_Items.Count; ++i)
                {
                    m_Items[i].Items.Clear();

                    foreach (var it in items)
                    {
                        m_Items[i].Items.Add(it.BeginTime.Hour, it.BeginTime.Minute, it.BeginTime.Second, it.EndTime.Hour, it.EndTime.Minute, it.EndTime.Second, it.Enabled, it.Content);
                    }
                }
            }
        }
コード例 #2
0
 /// <summary>
 /// 创建工作表项容器
 /// </summary>
 /// <param name="owner">容器拥有者</param>
 public DayOfWeekWorkSheetItemCollection(DayOfWeekWorkSheet owner)
 {
     m_Owner = owner;
 }