<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Yaml.Serialization;

namespace SparseApp.Plugins
{
    public class Manager
    {
        protected string folder;

        protected Dictionary<String, Plugin> plugins = new Dictionary<String, Plugin>();

        public Dictionary<String, Plugin> Plugins
        {
            get
            {
                return this.plugins;
            }
        }

        public Manager(string folder)
        {
            this.folder = folder;
        }

        public virtual void LoadAvailablePlugins()
        {
            plugins = new Dictionary<String, Plugin>();
            var serializer = new YamlSerializer();
            foreach (string file in Directory.EnumerateFiles(folder, "*.yml"))
            {
                var plugin = serializer.DeserializeFromFile(file, typeof(Plugin))[0];
                plugins.Add(Path.GetFileNameWithoutExtension(file), (Plugin)plugin);
            }
        }
    }
}<commit_msg>updated plugins manager to use IsolatedStorage<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.IO.IsolatedStorage;
using System.Yaml.Serialization;

namespace SparseApp.Plugins
{
    public class Manager
    {
        protected string folder;

        protected Dictionary<String, Plugin> plugins = new Dictionary<String, Plugin>();

        public Dictionary<String, Plugin> Plugins
        {
            get
            {
                return this.plugins;
            }
        }

        public Manager(string folder)
        {
            this.folder = folder;
        }

        public virtual void LoadAvailablePlugins()
        {
            using (IsolatedStorageFile store = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null))
            {
                plugins = new Dictionary<String, Plugin>();
                var serializer = new YamlSerializer();
                foreach (string file in store.GetFileNames("*.yml"))
                {
                    using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream(file, FileMode.Open, FileAccess.Read))
                    {
                        var plugin = serializer.Deserialize(stream, typeof(Plugin))[0];
                        plugins.Add(Path.GetFileNameWithoutExtension(file), (Plugin)plugin);
                    }
                }
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.08552373479795998, 'fraction_numerical': 0.0007846214201647705, 'mean_word_length': 1.8944381384790012, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '787854', 'n_tokens_mistral': 642, 'n_tokens_neox': 603, 'n_words': 146}