Ejemplo n.º 1
0
        private void CreateCaloriesGraph(int numberOfEntries)
        {
            var calories   = json.DeserializeKalorienTag();
            var jsonLenght = calories.Count;

            MyValues.Clear();
            TypeOfGraph.Title = "Kalorien";


            if (calories.Count == 0)
            {
                return;
            }
            var helper = jsonLenght - numberOfEntries - 1;

            for (int i = 0; i <= numberOfEntries - 1; i++)
            {
                if (i >= jsonLenght)
                {
                    break;
                }

                if (jsonLenght <= numberOfEntries)
                {
                    MyValues.Add(new ObservableValue(calories[i].CaloriesDay));
                }
                else
                {
                    MyValues.Add(new ObservableValue(calories[helper + i].CaloriesDay));
                }
            }
        }
Ejemplo n.º 2
0
        private void CreateWeightGraph(int numberOfEntries)
        {
            var weight     = json.DeserializeGewichtTag();
            var jsonLenght = weight.Count;

            MyValues.Clear();
            TypeOfGraph.Title = "Gewicht";

            if (jsonLenght == 0)
            {
                return;
            }
            var helper = jsonLenght - numberOfEntries - 1;

            for (int i = 0; i <= numberOfEntries - 1; i++)
            {
                if (i >= jsonLenght)
                {
                    break;
                }

                if (jsonLenght <= numberOfEntries)
                {
                    MyValues.Add(new ObservableValue(weight[i].TodaysWeight));
                }
                else
                {
                    MyValues.Add(new ObservableValue(weight[helper + i].TodaysWeight));
                }
            }
        }
Ejemplo n.º 3
0
        static void Main()
        {
            Check    c        = new Check();
            MyValues defValue = c.Value; // get default value

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new TestForm());
        }
        private void InsertPointOnClick(object sender, RoutedEventArgs e)
        {
            var r = new Random();

            if (MyValues.Count > 3)
            {
                MyValues.Insert(2, new ObservableValue(r.Next(-20, 20)));
            }
        }
Ejemplo n.º 5
0
    static void Main(string[] args)
    {
        var mv = new MyValues()
        {
            SomeString = "asd", SomeInt = 123, SomeBool = false
        };

        Console.WriteLine(funcVars(mv));
        Console.ReadLine();
    }
Ejemplo n.º 6
0
    public static string funcVars(MyValues values)
    {
        string strVars =
            String.Join(", ", new[]
        {
            nameof(values.SomeString), values.SomeString,
            nameof(values.SomeInt), values.SomeInt.ToString(),
            nameof(values.SomeBool), values.SomeBool.ToString()
        });

        return(strVars);
    }
Ejemplo n.º 7
0
        public static int GetValue(MyValues v)
        {
            switch (v)
            {
            case MyValues.Tray_LoopDelaySec:
                return(5);

            case MyValues.Tray_TcpTimeoutSec:
                return(5 * 60);
            }
            return(0);
        }
Ejemplo n.º 8
0
        public ToDoListViewModel()
        {
            _model.PropertyChanged += (s, e) =>
            {
                OnPropertyChanged(e.PropertyName);
            };

            Delete = new Command <object>(i =>
            {
                _model.RemoveValue(i);
            });

            Add = new Command <string>(str => {
                _model.AddValue(str);
                InputText = string.Empty;
                OnPropertyChanged("InputText");
                Console.Write(MyValues);
            });
            MyValues.Add("qwdqwd");
        }
Ejemplo n.º 9
0
 public ValuesController(IOptions <MyValues> optionsValue, IOptionsSnapshot <MyValues> snapshotValue, MyValues directValue)
 {
     _myValues    = optionsValue.Value;
     _snapshot    = snapshotValue.Value;
     _directValue = directValue;
 }
 private void RemovePointOnClick(object sender, RoutedEventArgs e)
 {
     MyValues.RemoveAt(0);
 }
        private void AddPointOnClick(object sender, RoutedEventArgs e)
        {
            var r = new Random();

            MyValues.Add(new ObservableValue(r.Next(-20, 20)));
        }
Ejemplo n.º 12
0
 public IndexModel(AppDbContext db, IOptionsMonitor <MyValues> values)
 {
     _db       = db;
     _myValues = values.CurrentValue;
 }
 public IndexModel(IOptions <MyValues> values)
 {
     Values = values.Value;
 }
Ejemplo n.º 14
0
 public ValuesController(IOptionsMonitor <MyValues> values)
 {
     _myValues = values.CurrentValue;
 }
Ejemplo n.º 15
0
 protected void Page_Load(object source, EventArgs e)
 {
     _values = ViewState["myValues"] as MyValues ?? new MyValues();
 }