00001 using System; 00002 using Gtk; 00003 using Foodolini.Activities; 00004 using Foodolini.BusinessLogic; 00005 00006 namespace Foodolini.Activities.RegisterExercise 00007 { 00008 [System.ComponentModel.ToolboxItem(true)] 00009 public partial class ExerciseEditor : Gtk.Bin, IActivity 00010 { 00011 private IOwner owner; 00012 private Exercise chosenExercise; 00013 00014 public ExerciseEditor() 00015 { 00016 this.Build(); 00017 } 00018 00019 public void SetDetails(Exercise chosenExercise) { 00020 spbtHours.Value = (double)chosenExercise.Duration.Hours; 00021 spbtMinutes.Value = (double)chosenExercise.Duration.Minutes; 00022 calDatePerformed.Date = chosenExercise.PerformedDate; 00023 choosesportsactivity1.SportsActivity = chosenExercise.Activity; 00024 00025 } 00026 00027 public void Register(IOwner owner){ 00028 this.owner = owner; 00029 } 00030 00031 public void Unregister(){ 00032 00033 this.owner = null; 00034 } 00035 00036 public Widget Widget{ 00037 get{ 00038 return this; 00039 } 00040 } 00041 } 00042 }