コード例 #1
0
 public Course(CourseExportV1 export)
 {
     // Load Data
     this.CourseCode    = export.CourseCode;
     this.SubjectName   = export.Title;
     this.Description   = export.Description;
     this.CreditWeight  = export.CreditWeight;
     this.Type          = export.Type;
     this.AU            = export.AU;
     this.Corequisites  = export.Corequisites;
     this.Prerequisites = export.Prerequisites;
     this.Exclusions    = export.Exclusions;
     this.TimeSlots     = export.TimeSlots;
     // Other Initialization
     IsFinished   = false;
     IsPinned     = false;
     IsInterested = false;
 }
コード例 #2
0
 internal void Merge(CourseExportV1 export)
 {
     // Merge if we are empty
     if (string.IsNullOrWhiteSpace(this.SubjectName))
     {
         this.SubjectName = export.Title;
     }
     if (string.IsNullOrWhiteSpace(this.Description))
     {
         this.Description = export.Description;
     }
     if (CreditWeight == 0)
     {
         this.CreditWeight = export.CreditWeight;
     }
     if (this.Type == CourseType.None)
     {
         this.Type = export.Type;
     }
     if (this.AU.Math == 0 && this.AU.CS == 0 && this.AU.ED == 0 && this.AU.ES == 0 && this.AU.NS == 0)
     {
         this.AU = export.AU;
     }
     if (this.Corequisites == null || this.Corequisites.Count == 0)
     {
         this.Corequisites = export.Corequisites;
     }
     if (this.Prerequisites == null || this.Prerequisites.Count == 0)
     {
         this.Prerequisites = export.Prerequisites;
     }
     if (this.Exclusions == null || this.Exclusions.Count == 0)
     {
         this.Exclusions = export.Exclusions;
     }
     if (this.TimeSlots == null || this.TimeSlots.Count == 0)
     {
         this.TimeSlots = export.TimeSlots;
     }
     // Ignore IsFinished, IsPinned and IsInterested
 }