<commit_before>﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;

using JetBrains.Annotations;

using Vulpecula.Mobile.Extensions;
using Vulpecula.Mobile.Models.Interfaces;

namespace Vulpecula.Mobile.Models
{
    [UsedImplicitly]
    public class Configuration
    {
        private readonly IConfiguration _configuration;

        // ReSharper disable once InconsistentNaming
        private List<string> _Accounts
        {
            get { return this._configuration.GetArray("Accounts")?.ToList(); }
            set { this._configuration.SetArray("Accounts", value.ToArray()); }
        }

        public ObservableCollection<string> Accounts => new ObservableCollection<string>(this._Accounts);

        public Configuration()
        {
            this._configuration = App.ModelLocator.GetModel<IConfiguration>();
            if (this._Accounts == null)
            {
                this._Accounts = new List<string>();
            }
            this.Accounts.ToObservable().Subscribe(w =>
            {
                List<string> temp;
                switch (w.EventArgs.Action)
                {
                    case NotifyCollectionChangedAction.Add:
                        temp = this._Accounts;
                        temp.Add(w.EventArgs.NewItems[0].ToString());
                        this._Accounts = new List<string>(temp);
                        break;

                    case NotifyCollectionChangedAction.Remove:
                        temp = this._Accounts;
                        temp.Remove(w.EventArgs.NewItems[0].ToString());
                        this._Accounts = new List<string>(temp);
                        break;
                }
            });
        }
    }
}<commit_msg>[Mobile]Accounts が保存されないのを修正<commit_after>﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;

using JetBrains.Annotations;

using Vulpecula.Mobile.Extensions;
using Vulpecula.Mobile.Models.Interfaces;

namespace Vulpecula.Mobile.Models
{
    [UsedImplicitly]
    public class Configuration
    {
        private readonly IConfiguration _configuration;

        // ReSharper disable once InconsistentNaming
        private List<string> _Accounts
        {
            get { return this._configuration.GetArray("Accounts")?.ToList(); }
            set { this._configuration.SetArray("Accounts", value.ToArray()); }
        }

        public ObservableCollection<string> Accounts { get; }

        public Configuration()
        {
            this._configuration = App.ModelLocator.GetModel<IConfiguration>();
            this.Accounts = new ObservableCollection<string>(this._Accounts);

            if (this._Accounts == null)
            {
                this._Accounts = new List<string>();
            }

            this.Accounts.ToObservable().Subscribe(w =>
            {
                List<string> temp;
                switch (w.EventArgs.Action)
                {
                    case NotifyCollectionChangedAction.Add:
                        temp = this._Accounts;
                        temp.Add(w.EventArgs.NewItems[0].ToString());
                        this._Accounts = new List<string>(temp);
                        break;

                    case NotifyCollectionChangedAction.Remove:
                        temp = this._Accounts;
                        temp.Remove(w.EventArgs.NewItems[0].ToString());
                        this._Accounts = new List<string>(temp);
                        break;

                    case NotifyCollectionChangedAction.Reset:
                        this._Accounts = new List<string>();
                        break;
                }
            });
        }
    }
}
{'fraction_non_alphanumeric': 0.0932952182952183, 'fraction_numerical': 0.0010395010395010396, 'mean_word_length': 1.685973482205164, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5923355', 'n_tokens_mistral': 956, 'n_tokens_neox': 906, 'n_words': 163}