public void LoadValues(int Days, ref MyFitnessList myFitnesses)
 {
     foreach (var MyFitnessStat in Enum.GetValues(typeof(MyFitnessStatType)).Cast<MyFitnessStatType>())
     {
         GetValue(MyFitnessStat, myFitnesses.Values, Days);
     }
 }
 public IGraphCreator GetCaloriesComparisonGraph(GraphType graphType, MyFitnessList MyFitnesses, DataSetBuilder dataSetBuilder, int Days)
 {
     int LeftRange;
     List<int[]> caloriesComparison = dataSetBuilder.CaloriesComparison(out LeftRange);
     IGraphCreator Graph = new GoogleChartGraphCreator(caloriesComparison, dataSetBuilder.DateLabels, LeftRange);
     Graph.CreateChart(graphType);
     return Graph;
 }
Esempio n. 3
0
        private void DoUpdate()
        {
            if (MyFitnesses==null)
                MyFitnesses = new MyFitnessList();
            CreateSomeXMLFitnesses();

            UpdateForm();
        }
Esempio n. 4
0
 public DataSetBuilder(MyFitnessList FitnessList, int Days)
 {
     if ((Days > (DateTime.IsLeapYear(DateTime.Now.Year) ? 366 : 365)) || (Days < 1))
     {
         throw new ArgumentOutOfRangeException("Number of Days cannot exceed number of days this year or be less than 1");
     }
     fitnessList = FitnessList;
     this.Days = Days;
 }
Esempio n. 5
0
        private void btnDeSerialize_Click(object sender, EventArgs e)
        {
            using (TextReader tr = File.OpenText("xmlout.xml"))
            {
                textBox2.Text = "XML DeSerialisation Starting";
                System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(typeof(MyFitnessList));
                MyFitnesses=(MyFitnessList)x.Deserialize(tr);

            }
        }
 public MyFitnessPalXMLWrapper(string ConfigFileName, int Days, IGraphWrapper graphWrapper)
 {
     config = new LoadConfig(ConfigFileName);
     loginDetails = (LoginDetails)config.GetContents(typeof(LoginDetails));
     cookieDetails = (CookieDetails)config.BinaryDeserialize(typeof(CookieDetails));
     login = new Login(loginDetails, cookieDetails);
     Loader = new XMLMyFitnessLoader(login);
     MyFitnesses = new MyFitnessList();
     this.graphWrapper = graphWrapper;
     this.Days = Days;
 }
 public XMLMyFitnessImporter(ref MyFitnessList MyFitnesses, string FileName)
 {
     this._MyFitnesses = MyFitnesses;
     this._FileName = FileName;
 }