/// <summary> /// 建立 SessionObject 淺層複本 /// </summary> /// <returns>返回值: SessionObject 類別</returns> public SessionObject Clone() { SessionObject cSession = this.MemberwiseClone() as SessionObject; if (this.Daylight != null) { cSession.Daylight = this.Daylight.Clone(); } return(cSession); }
private void btnSessionCreate_Click(object sender, EventArgs e) { SessionObject cSession = new SessionObject(); cSession.EndDay = DayOfWeek.Monday; cSession.EndTime = TimeSpan.Zero; cSession.StartDay = DayOfWeek.Monday; cSession.StartTime = TimeSpan.Zero; sourceSessions.Add(cSession); sourceSessions.Refresh(); }