<commit_before>﻿// Copyright (c) <NAME>. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Perspex;
using Perspex.Controls;
using Perspex.Diagnostics;
using Perspex.Markup.Xaml;
using Perspex.Themes.Default;
using Perspex.Markup;
using Perspex.Media;

namespace Core2D.UI.Perspex.Desktop
{
    /// <summary>
    /// 
    /// </summary>
    public class App : Application
    {
        /// <summary>
        /// 
        /// </summary>
        public App()
        {
            RegisterServices();
            InitializeSubsystems((int)Environment.OSVersion.Platform);
            Styles = new DefaultTheme();
            InitializeComponent();
        }

        /// <summary>
        /// 
        /// </summary>
        private void InitializeComponent()
        {
            var loader = new PerspexXamlLoader();
            loader.Load(typeof(App), this);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="window"></param>
        public static void AttachDevTools(Window window)
        {
#if DEBUG
            DevTools.Attach(window);
#endif
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        [STAThread]
        private static void Main(string[] args)
        {
            try
            {
                var app = new App();
                var window = new Windows.MainWindow();
                window.Show();
                app.Run(window);
            }
            catch (Exception ex)
            {
                Print(ex);
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="ex"></param>
        private static void Print(Exception ex)
        {
            System.Diagnostics.Debug.Print(ex.GetType().ToString());
            System.Diagnostics.Debug.Print(ex.Message);
            System.Diagnostics.Debug.Print(ex.StackTrace);
            if (ex.InnerException != null)
            {
                System.Diagnostics.Debug.Print("Inner exception:");
                Print(ex.InnerException);
            }
        }
    }

    /// <summary>
    /// Object model Xaml value converters.
    /// </summary>
    public static class CoreConverters
    {
        /// <summary>
        /// Convert ArgbColor to Color.
        /// </summary>
        /// <param name="color">The ArgbColor object.</param>
        /// <returns>The converted Color object.</returns>
        public static Color ToColor(ArgbColor color)
        {
            return Color.FromArgb(
                (byte)color.A,
                (byte)color.R,
                (byte)color.G,
                (byte)color.B);
        }

        /// <summary>
        /// Convert ArgbColor to SolidColorBrush.
        /// </summary>
        /// <param name="color">The ArgbColor object.</param>
        /// <returns>The converted SolidColorBrush object.</returns>
        public static SolidColorBrush ToSolidBrush(ArgbColor color)
        {
            return new SolidColorBrush(ToColor(color));
        }

        /// <summary>
        /// Convert ArgbColor to SolidColorBrush.
        /// </summary>
        public static readonly IValueConverter ArgbColorToBrush =
            new FuncValueConverter<ArgbColor, SolidColorBrush>(x => ToSolidBrush(x));

        /// <summary>
        /// 
        /// </summary>
        public static readonly IValueConverter IntToInt =
            new FuncValueConverter<int, int>(x => x);

        /// <summary>
        /// Convert ArgbColor individual properties A, R, G, B to SolidColorBrush.
        /// </summary>
        public static readonly IMultiValueConverter ArgbColorsToBrush = 
            new FuncMultiValueConverter<int, SolidColorBrush>(x =>
            {
                var values = x.ToList();
                System.Diagnostics.Debug.Print(values.Count.ToString());
                if (values.Count() == 4)
                {<commit_msg>Removed debug code<commit_after>﻿// Copyright (c) <NAME>. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Perspex;
using Perspex.Controls;
using Perspex.Diagnostics;
using Perspex.Markup.Xaml;
using Perspex.Themes.Default;
using Perspex.Markup;
using Perspex.Media;

namespace Core2D.UI.Perspex.Desktop
{
    /// <summary>
    /// 
    /// </summary>
    public class App : Application
    {
        /// <summary>
        /// 
        /// </summary>
        public App()
        {
            RegisterServices();
            InitializeSubsystems((int)Environment.OSVersion.Platform);
            Styles = new DefaultTheme();
            InitializeComponent();
        }

        /// <summary>
        /// 
        /// </summary>
        private void InitializeComponent()
        {
            var loader = new PerspexXamlLoader();
            loader.Load(typeof(App), this);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="window"></param>
        public static void AttachDevTools(Window window)
        {
#if DEBUG
            DevTools.Attach(window);
#endif
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        [STAThread]
        private static void Main(string[] args)
        {
            try
            {
                var app = new App();
                var window = new Windows.MainWindow();
                window.Show();
                app.Run(window);
            }
            catch (Exception ex)
            {
                Print(ex);
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="ex"></param>
        private static void Print(Exception ex)
        {
            System.Diagnostics.Debug.Print(ex.GetType().ToString());
            System.Diagnostics.Debug.Print(ex.Message);
            System.Diagnostics.Debug.Print(ex.StackTrace);
            if (ex.InnerException != null)
            {
                System.Diagnostics.Debug.Print("Inner exception:");
                Print(ex.InnerException);
            }
        }
    }

    /// <summary>
    /// Object model Xaml value converters.
    /// </summary>
    public static class CoreConverters
    {
        /// <summary>
        /// Convert ArgbColor to Color.
        /// </summary>
        /// <param name="color">The ArgbColor object.</param>
        /// <returns>The converted Color object.</returns>
        public static Color ToColor(ArgbColor color)
        {
            return Color.FromArgb(
                (byte)color.A,
                (byte)color.R,
                (byte)color.G,
                (byte)color.B);
        }

        /// <summary>
        /// Convert ArgbColor to SolidColorBrush.
        /// </summary>
        /// <param name="color">The ArgbColor object.</param>
        /// <returns>The converted SolidColorBrush object.</returns>
        public static SolidColorBrush ToSolidBrush(ArgbColor color)
        {
            return new SolidColorBrush(ToColor(color));
        }

        /// <summary>
        /// Convert ArgbColor to SolidColorBrush.
        /// </summary>
        public static readonly IValueConverter ArgbColorToBrush =
            new FuncValueConverter<ArgbColor, SolidColorBrush>(x => ToSolidBrush(x));

        /// <summary>
        /// 
        /// </summary>
        public static readonly IValueConverter IntToInt =
            new FuncValueConverter<int, int>(x => x);

        /// <summary>
        /// Convert ArgbColor individual properties A, R, G, B to SolidColorBrush.
        /// </summary>
        public static readonly IMultiValueConverter ArgbColorsToBrush = 
            new FuncMultiValueConverter<int, SolidColorBrush>(x =>
            {
                var values = x.ToList();
                if (values.Count() == 4)
                {
{'fraction_non_alphanumeric': 0.12420693020985847, 'fraction_numerical': 0.0004880429477794046, 'mean_word_length': 1.5090296908478726, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 93, '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': '958187', 'n_tokens_mistral': 2195, 'n_tokens_neox': 2084, 'n_words': 487}