<commit_before>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;

namespace KaomojiTray
{
  class KaomojiTrayApplicationContext : SystemTrayApplicationContext
  {
    public KaomojiLibrary Library { get; private set; }

    public KaomojiTrayApplicationContext() : base()
    {
      SetIconImage(KaomojiTray.Properties.Resources.Close_16);

      var Assembly = System.Reflection.Assembly.GetExecutingAssembly();

      using (var StreamReader = new StreamReader(Assembly.GetManifestResourceStream(Assembly.GetName().Name + ".kaomoji.json")))
      {
        this.Library = Newtonsoft.Json.JsonConvert.DeserializeObject<KaomojiLibrary>(StreamReader.ReadToEnd());
      }

      this.IconClickEvent += KaomojiTrayApplicationContext_IconClickEvent;
      
      AddMenuItem("Exit", null, ExitMenuItemClick);
    }

    void KaomojiTrayApplicationContext_IconClickEvent()
    {
      ShowPicker();
    }

    private void ShowPicker()
    {
      var Window = new MainWindow();
      Window.Title = "Kaomoji Library";
      Window.LoadLibrary(Library);
      Window.Show();
    }

    private void ExitMenuItemClick(object sender, EventArgs e)
    {
      ExitApplication();
    }
  }

  public class KaomojiLibrary
  {
    public List<KaomojiCategory> category { get; set; }
  }

  public class KaomojiCategory
  {
    public string id { get; set; }
    public List<KaomojiSection> sections { get; set; }
  }

  public class KaomojiSection
  {
    public string id { get; set; }
    public List<string> kaomoji { get; set; }
  }
}<commit_msg>Move from implicit to explicit serialisation of object members<commit_after>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.Serialization;

namespace KaomojiTray
{
  class KaomojiTrayApplicationContext : SystemTrayApplicationContext
  {
    public KaomojiLibrary Library { get; private set; }

    public KaomojiTrayApplicationContext() : base()
    {
      SetIconImage(KaomojiTray.Properties.Resources.Close_16);

      var Assembly = System.Reflection.Assembly.GetExecutingAssembly();

      using (var StreamReader = new StreamReader(Assembly.GetManifestResourceStream(Assembly.GetName().Name + ".kaomoji.json")))
      {
        this.Library = Newtonsoft.Json.JsonConvert.DeserializeObject<KaomojiLibrary>(StreamReader.ReadToEnd());
      }

      this.IconClickEvent += KaomojiTrayApplicationContext_IconClickEvent;
      
      AddMenuItem("Exit", null, ExitMenuItemClick);
    }

    void KaomojiTrayApplicationContext_IconClickEvent()
    {
      ShowPicker();
    }

    private void ShowPicker()
    {
      var Window = new MainWindow();
      Window.Title = "Kaomoji Library";
      Window.LoadLibrary(Library);
      Window.Show();
    }

    private void ExitMenuItemClick(object sender, EventArgs e)
    {
      ExitApplication();
    }
  }

  [DataContract]
  public class KaomojiLibrary
  {
    [DataMember]
    public List<KaomojiCategory> category { get; set; }
  }

  [DataContract]
  public class KaomojiCategory
  {
    [DataMember]
    public string id { get; set; }
    [DataMember]
    public List<KaomojiSection> sections { get; set; }
  }

  [DataContract]
  public class KaomojiSection
  {
    [DataMember]
    public string id { get; set; }
    [DataMember]
    public List<string> kaomoji { get; set; }
  }
}
{'fraction_non_alphanumeric': 0.09554678692220969, 'fraction_numerical': 0.0011273957158962795, 'mean_word_length': 3.509529860228717, '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': '6950190', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1028, 'n_words': 220}