<commit_before>﻿#region auto-generated FILE INFORMATION

// ==============================================
// This file is distributed under the MIT License
// ==============================================
// 
// Filename: AssemblyInfo.cs
// Version:  2019-10-15 11:12
// 
// Copyright (c) 2019, Si13n7 Developments (r)
// All rights reserved.
// ______________________________________________

#endregion

namespace SilDev
{
    using System;
    using System.Diagnostics.CodeAnalysis;
    using System.Reflection;

    /// <summary>
    ///     Provides information for the current assembly.
    /// </summary>
    public static class AssemblyInfo
    {
        /// <summary>
        ///     Gets company name information.
        /// </summary>
        public static string Company => GetAssembly<AssemblyCompanyAttribute>()?.Company;

        /// <summary>
        ///     Gets configuration information.
        /// </summary>
        public static string Configuration => GetAssembly<AssemblyDescriptionAttribute>()?.Description;

        /// <summary>
        ///     Gets copyright information.
        /// </summary>
        public static string Copyright => GetAssembly<AssemblyCopyrightAttribute>()?.Copyright;

        /// <summary>
        ///     Gets description information.
        /// </summary>
        public static string Description => GetAssembly<AssemblyDescriptionAttribute>()?.Description;

        /// <summary>
        ///     Gets file version information.
        /// </summary>
        public static string FileVersion => GetAssembly<AssemblyFileVersionAttribute>()?.Version;

        /// <summary>
        ///     Gets product information.
        /// </summary>
        public static string Product => GetAssembly<AssemblyProductAttribute>()?.Product;

        /// <summary>
        ///     Gets title information.
        /// </summary>
        public static string Title => GetAssembly<AssemblyTitleAttribute>()?.Title;

        /// <summary>
        ///     Gets trademark information.
        /// </summary>
        public static string Trademark => GetAssembly<AssemblyTrademarkAttribute>()?.Trademark;

        /// <summary>
        ///     Gets version information.
        /// </summary>
        public static string Version => Assembly.GetEntryAssembly()?.GetName().Version?.ToString();

        [SuppressMessage("ReSharper", "AssignNullToNotNullAttribute")]
        private static TSource GetAssembly<TSource>() where TSource : Attribute
        {
            try
            {
                var assembly = Attribute.GetCustomAttribute(Assembly.GetEntryAssembly(), typeof(TSource));
                return (TSource)assembly;
            }
            catch (Exception ex) when (ex.IsCaught())
            {
                return default;
            }
        }
    }
}<commit_msg>Fix possible ArgumentNullException.<commit_after>﻿#region auto-generated FILE INFORMATION

// ==============================================
// This file is distributed under the MIT License
// ==============================================
// 
// Filename: AssemblyInfo.cs
// Version:  2019-12-15 14:56
// 
// Copyright (c) 2019, Si13n7 Developments (r)
// All rights reserved.
// ______________________________________________

#endregion

namespace SilDev
{
    using System;
    using System.Reflection;

    /// <summary>
    ///     Provides information for the current assembly.
    /// </summary>
    public static class AssemblyInfo
    {
        /// <summary>
        ///     Gets company name information.
        /// </summary>
        public static string Company => GetAssembly<AssemblyCompanyAttribute>()?.Company;

        /// <summary>
        ///     Gets configuration information.
        /// </summary>
        public static string Configuration => GetAssembly<AssemblyDescriptionAttribute>()?.Description;

        /// <summary>
        ///     Gets copyright information.
        /// </summary>
        public static string Copyright => GetAssembly<AssemblyCopyrightAttribute>()?.Copyright;

        /// <summary>
        ///     Gets description information.
        /// </summary>
        public static string Description => GetAssembly<AssemblyDescriptionAttribute>()?.Description;

        /// <summary>
        ///     Gets file version information.
        /// </summary>
        public static string FileVersion => GetAssembly<AssemblyFileVersionAttribute>()?.Version;

        /// <summary>
        ///     Gets product information.
        /// </summary>
        public static string Product => GetAssembly<AssemblyProductAttribute>()?.Product;

        /// <summary>
        ///     Gets title information.
        /// </summary>
        public static string Title => GetAssembly<AssemblyTitleAttribute>()?.Title;

        /// <summary>
        ///     Gets trademark information.
        /// </summary>
        public static string Trademark => GetAssembly<AssemblyTrademarkAttribute>()?.Trademark;

        /// <summary>
        ///     Gets version information.
        /// </summary>
        public static string Version => Assembly.GetEntryAssembly()?.GetName().Version?.ToString();

        private static TSource GetAssembly<TSource>() where TSource : Attribute
        {
            try
            {
                var element = Assembly.GetEntryAssembly();
                if (element == null)
                    return default;
                var assembly = Attribute.GetCustomAttribute(element, typeof(TSource));
                return (TSource)assembly;
            }
            catch (Exception ex) when (ex.IsCaught())
            {
                return default;
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.14728682170542637, 'fraction_numerical': 0.0066948555320648345, 'mean_word_length': 2.0390792291220556, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3596538', 'n_tokens_mistral': 1300, 'n_tokens_neox': 1253, 'n_words': 330}