Beispiel #1
0
        private void SaveClock(object clockObject)
        {
            ClockViewModel cvm = clockObject as ClockViewModel;

            if (cvm != null)
            {
                if (cvm.editingMode)
                {
                    int index = Clocks.IndexOf(cvm.selectedClock);
                    Clocks.RemoveAt(index);
                    Clocks.Insert(index, new ClockModel()
                    {
                        HeadColor     = cvm.ClockHeadColor,
                        FaceColor     = cvm.ClockFaceColor,
                        ClockTimeZone = cvm.ClockTimeZoneInfo
                    });
                    UpdateDB();
                }
                else
                {
                    var newClock = new ClockModel()
                    {
                        HeadColor     = cvm.ClockHeadColor,
                        FaceColor     = cvm.ClockFaceColor,
                        ClockTimeZone = cvm.ClockTimeZoneInfo
                    };

                    Clocks.Add(newClock);
                    App.Database.AddClock(newClock, currentUserId);
                }
            }
            Back();
        }
Beispiel #2
0
 public void AddClock(ClockInfo info)
 {
     if (!Clocks.Contains(info))
     {
         Clocks.Add(info);
     }
 }
Beispiel #3
0
        private void GetClocksFromDB()
        {
            var list = App.Database.GetClocks(currentUserId);

            foreach (var item in list)
            {
                Clocks.Add(item);
            }
        }
        public AudioProcessingUnit()
        {
            Devices.Add(Processor);
            Clocks.Add(Clock);
            Busses.Add(Bus);

            BusDevices.Add(new BusDevice {
                Bus = Bus, Device = Processor
            });
            ClockDevices.Add(new ClockDevice {
                Clock = Clock, Device = Processor
            });
        }