Beispiel #1
0
        public void UpdateSettings(InstanceModel model)
        {
            var settings = this.Platform <ISettings>();
            var index    = Instances.FindIndex(it => it.CreateAt == model.CreateAt);

            if (index > 0)
            {
                Instances[index] = model;
            }

            settings.Set("instance", Instances);
            RockApp.Current.GetAllInstance();
            OnPropertyChanged(nameof(Instances));
        }
Beispiel #2
0
        public static void Add(string ip, int textIndex, DateTime date)
        {
            int index = Instances.FindIndex(
                instance => {
                return(instance.Ip == ip);
            }
                );

            if (index == -1)
            {
                IpWEvents addMe2 = new IpWEvents(ip, textIndex, date);
                Instances.Add(addMe2);
            }
            else
            {
                Instances[index].Events.Add(new SomeEvent(textIndex, date));
            }
        }