<commit_before>﻿using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Xml;
using System.Xml.Serialization;

using Catel.Data;
using UUM.Api.Models;

namespace UUM.Engine.Models
{
    /// <summary>
    ///     UserPool: Pool containing the users from different plugins (i.e different sources).
    /// </summary>
    [Serializable]
    public class UserPoolModel : SavableModelBase<UserPoolModel>
    	
    {
        public UserPoolModel()
        {
        }

        protected UserPoolModel(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }

        #region Property: Users

        public static readonly PropertyData UserProperty =
            RegisterProperty("Users", typeof(ObservableCollection<UserModel>), new ObservableCollection<UserModel>());

        public ObservableCollection<UserModel> Users
        {
            get { return GetValue<ObservableCollection<UserModel>>(UserProperty); }
            set { SetValue(UserProperty, value); }
        }

        #endregion

        #region Property: UsersInSources

        public static readonly PropertyData UsersInSourcesProperty =
            RegisterProperty("UsersInSources", typeof(ObservableCollection<UserModel>));

        public ObservableCollection<UserInSourceBase> UsersInSources
        {
            get { return GetValue<ObservableCollection<UserInSourceBase>>(UsersInSourcesProperty); }
            set { SetValue(UsersInSourcesProperty, value); }
        }

        #endregion

        #region Methods

        public void Add(UserModel user)
        {
            Users.Add(user);
        }

        public void Remove(UserModel user)
        {
            Users.Remove(user);
        }

        public UserModel FindUserInSourceById(Guid id)
        {
            return Users.SingleOrDefault(x => x.Id == id);
        }
        
		 #region Load/Save
         public static UserPoolModel Load(String _configfile)
		{
			XmlSerializer serializer = new XmlSerializer(typeof(UserPoolModel));
			using (var xmlReader = XmlReader.Create(_configfile))
			{
				return serializer.Deserialize(xmlReader) as UserPoolModel;
			}
		}
         
		public void Save(String _configfile)
		{
            XmlSerializer serializer = new XmlSerializer(typeof(UserPoolModel));
            XmlWriterSettings settings = new XmlWriterSettings();
			settings.Indent = true;
			using (var xmlWriter = XmlWriter.Create(_configfile, settings))
			{
				serializer.Serialize(xmlWriter, this);
			}
		}
		
        #endregion
         #endregion
    }
}<commit_msg>Cleanup: Fix indentation and naming convention for parameter names<commit_after>﻿using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Xml;
using System.Xml.Serialization;

using Catel.Data;
using UUM.Api.Models;

namespace UUM.Engine.Models
{
	/// <summary>
	///     UserPool: Pool containing the users from different plugins (i.e different sources).
	/// </summary>
	[Serializable]
	public class UserPoolModel : SavableModelBase<UserPoolModel>
		
	{
		public UserPoolModel()
		{
		}

		protected UserPoolModel(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
		}

		#region Property: Users

		public static readonly PropertyData UserProperty =
			RegisterProperty("Users", typeof(ObservableCollection<UserModel>), new ObservableCollection<UserModel>());

		public ObservableCollection<UserModel> Users
		{
			get { return GetValue<ObservableCollection<UserModel>>(UserProperty); }
			set { SetValue(UserProperty, value); }
		}

		#endregion

		#region Property: UsersInSources

		public static readonly PropertyData UsersInSourcesProperty =
			RegisterProperty("UsersInSources", typeof(ObservableCollection<UserModel>));

		public ObservableCollection<UserInSourceBase> UsersInSources
		{
			get { return GetValue<ObservableCollection<UserInSourceBase>>(UsersInSourcesProperty); }
			set { SetValue(UsersInSourcesProperty, value); }
		}

		#endregion

		#region Methods

		public void Add(UserModel user)
		{
			Users.Add(user);
		}

		public void Remove(UserModel user)
		{
			Users.Remove(user);
		}

		public UserModel FindUserInSourceById(Guid id)
		{
			return Users.SingleOrDefault(x => x.Id == id);
		}
		
		#region Load/Save
		
		public static UserPoolModel Load(String filePath)
		{
			XmlSerializer serializer = new XmlSerializer(typeof(UserPoolModel));
			using (var xmlReader = XmlReader.Create(filePath))
			{
				return serializer.Deserialize(xmlReader) as UserPoolModel;
			}
		}
		
		public new void Save(String filePath)
		{
			XmlSerializer serializer = new XmlSerializer(typeof(UserPoolModel));
			XmlWriterSettings settings = new XmlWriterSettings();
			settings.Indent = true;
			using (var xmlWriter = XmlWriter.Create(filePath, settings))
			{
				serializer.Serialize(xmlWriter, this);
			}
		}
		
		#endregion
		#endregion
	}
}
{'fraction_non_alphanumeric': 0.0867297662739038, 'fraction_numerical': 0.0, 'mean_word_length': 2.801762114537445, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '5893495', 'n_tokens_mistral': 1565, 'n_tokens_neox': 1365, 'n_words': 307}