<commit_before>using GalaSoft.MvvmLight.Messaging;
using CodeHub.Helpers;
using CodeHub.Services;
using Octokit;
using System;
using System.Threading;
using System.Threading.Tasks;
using Windows.UI;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
using CodeHub.Services.Hilite_me;
using MarkdownSharp;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Ioc;
using CodeHub.Views;

namespace CodeHub.ViewModels
{
    public class FileContentViewmodel : AppViewmodel
    {
        public Repository _repository;
        public Repository Repository
        {
            get
            {
                return _repository;
            }
            set
            {
                Set(() => Repository, ref _repository, value);

            }
        }

        public bool _isSupportedFile;
        public bool IsSupportedFile
        {
            get
            {
                return _isSupportedFile;
            }
            set
            {
                Set(() => IsSupportedFile, ref _isSupportedFile, value);

            }
        }

        public bool _isImage;
        public bool IsImage
        {
            get
            {
                return _isImage;
            }
            set
            {
                Set(() => IsImage, ref _isImage, value);

            }
        }

        public ImageSource _imageFile;
        public ImageSource ImageFile
        {
            get
            {
                return _imageFile;
            }
            set
            {
                Set(() => ImageFile, ref _imageFile, value);

            }
        }

        public string _path;
        public string Path
        {
            get
            {
                return _path;
            }
            set
            {
                Set(() => Path, ref _path, value);

            }
        }

        // HTMLContent
        public string _HTMLContent;
        public string HTMLContent
        {
            get
            {
                return _HTMLContent;
            }
            set
            {
                Set(() => HTMLContent, ref _HTMLContent, value);

            }
        }


        public string _selectedBranch;
        public string SelectedBranch
        {
            get
            {
                return _selectedBranch;
            }
            set
            {
                Set(() => SelectedBranch, ref _selectedBranch, value);

            }
        }

        public Color _HTMLBackgroundColor = SettingsService.Get<bool>(SettingsKeys.AppLightThemeEnabled) ? Colors.White : Colors.Black;

        /// <summary>
        /// Gets the base background color for the HTML content
        /// </summary>
        public Color HTMLBackgroundColor
        {
            get { return _HTMLBackgroundColor; }
            private set
            { 
                Set(() => HTMLBackgroundColor, ref _HTMLBackgroundColor, value);
            }
        }

        public async Task Load(Tuple<Repository, string, string> repoPath)  //This page recieves RepositoryId and name of the file
        {
            IsSupportedFile = true;
            Repository = repoPath.Item1;
            Path = repoPath.Item2;

            if (string.IsNullOrWhiteSpace(repoPath.Item3))
            {
                SelectedBranch = await RepositoryUtility.GetDefaultBranch(Repository.Id);
            }
            else
            {
                SelectedBranch = repoPath.Item3;
            }


            MarkdownOptions options = new MarkdownOptions
            {
                AsteriskIntraWordEmphasis = true,
                AutoNewlines = true,
                StrictBoldItalic = true,
                AutoHyperlink = false,
                LinkEmails = true
            };
            Markdown markDown = new Markdown(options);

            if (!GlobalHelper.IsInternet())
            {
                //Sending NoInternet message to all viewModels
                Messenger.Default.Send(new GlobalHelper.LocalNotificationMessageType { Message="No Internet", Glyph= "\uE704" });
            }
            else
            {
                Messenger.Default.Send(new GlobalHelper.HasInternetMessageType()); //Sending Internet available message to all viewModels
                isLoading = true;
                IsImage = false;

                if ((Path.ToLower().EndsWith(".exe")) ||
                   (Path.ToLower().EndsWith(".pdf")) ||<commit_msg>Minor fix<commit_after>using GalaSoft.MvvmLight.Messaging;
using CodeHub.Helpers;
using CodeHub.Services;
using Octokit;
using System;
using System.Threading;
using System.Threading.Tasks;
using Windows.UI;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
using CodeHub.Services.Hilite_me;
using MarkdownSharp;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Ioc;
using CodeHub.Views;

namespace CodeHub.ViewModels
{
    public class FileContentViewmodel : AppViewmodel
    {
        public Repository _repository;
        public Repository Repository
        {
            get
            {
                return _repository;
            }
            set
            {
                Set(() => Repository, ref _repository, value);

            }
        }

        public bool _isSupportedFile;
        public bool IsSupportedFile
        {
            get
            {
                return _isSupportedFile;
            }
            set
            {
                Set(() => IsSupportedFile, ref _isSupportedFile, value);

            }
        }

        public bool _isImage;
        public bool IsImage
        {
            get
            {
                return _isImage;
            }
            set
            {
                Set(() => IsImage, ref _isImage, value);

            }
        }

        public ImageSource _imageFile;
        public ImageSource ImageFile
        {
            get
            {
                return _imageFile;
            }
            set
            {
                Set(() => ImageFile, ref _imageFile, value);

            }
        }

        public string _path;
        public string Path
        {
            get
            {
                return _path;
            }
            set
            {
                Set(() => Path, ref _path, value);

            }
        }

        // HTMLContent
        public string _HTMLContent;
        public string HTMLContent
        {
            get
            {
                return _HTMLContent;
            }
            set
            {
                Set(() => HTMLContent, ref _HTMLContent, value);

            }
        }


        public string _selectedBranch;
        public string SelectedBranch
        {
            get
            {
                return _selectedBranch;
            }
            set
            {
                Set(() => SelectedBranch, ref _selectedBranch, value);

            }
        }

        public Color _HTMLBackgroundColor = SettingsService.Get<bool>(SettingsKeys.AppLightThemeEnabled) ? Colors.White : Colors.Black;

        /// <summary>
        /// Gets the base background color for the HTML content
        /// </summary>
        public Color HTMLBackgroundColor
        {
            get { return _HTMLBackgroundColor; }
            private set
            { 
                Set(() => HTMLBackgroundColor, ref _HTMLBackgroundColor, value);
            }
        }

        public async Task Load(Tuple<Repository, string, string> repoPath)  //This page recieves RepositoryId and name of the file
        {
            IsSupportedFile = true;
            Repository = repoPath.Item1;
            Path = repoPath.Item2;

            MarkdownOptions options = new MarkdownOptions
            {
                AsteriskIntraWordEmphasis = true,
                AutoNewlines = true,
                StrictBoldItalic = true,
                AutoHyperlink = false,
                LinkEmails = true
            };
            Markdown markDown = new Markdown(options);

            if (!GlobalHelper.IsInternet())
            {
                //Sending NoInternet message to all viewModels
                Messenger.Default.Send(new GlobalHelper.LocalNotificationMessageType { Message="No Internet", Glyph= "\uE704" });
            }
            else
            {
                Messenger.Default.Send(new GlobalHelper.HasInternetMessageType()); //Sending Internet available message to all viewModels
                isLoading = true;

                if (string.IsNullOrWhiteSpace(repoPath.Item3))
                {
                    SelectedBranch = await RepositoryUtility.GetDefaultBranch(Repository.Id);
                }
                else
                {
                    SelectedBranch = repoPath.Item3;
                }

                IsImage = false;

                if ((Path.ToLower().EndsWith(".exe")) ||
                   (Path.ToLower().EndsWith(".pdf")) ||
{'fraction_non_alphanumeric': 0.07336166405725789, 'fraction_numerical': 0.00156564526951465, 'mean_word_length': 1.2368684342171086, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4643180', 'n_tokens_mistral': 2231, 'n_tokens_neox': 2116, 'n_words': 503}