<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Pulsar4X.Entities;
using Pulsar4X.UI.Helpers;
using System.ComponentModel;
using System.Collections.ObjectModel;
using System.Windows.Forms;
using System.Linq.Expressions;

namespace Pulsar4X.UI.ViewModels
{
    public class StarSystemViewModel : INotifyPropertyChanged
    {
        private StarSystem _currentstarsystem;
        public StarSystem CurrentStarSystem
        {
            get { return _currentstarsystem; }
            set
            {
                _currentstarsystem = value;

                // safty check
                if (_currentstarsystem == null)
                {
                    return;
                }

                OnPropertyChanged(() => CurrentStarSystem);
                CurrentStarSystemAge = _currentstarsystem.Stars[0].Age.ToString();
                Seed = _currentstarsystem.Seed.ToString();
                Stars = new BindingList<Star>(_currentstarsystem.Stars);
                StarsSource.DataSource = Stars;
                OnPropertyChanged(() => Stars);
            }
        }
        public BindingList<StarSystem> StarSystems { get; set; }

        private string _currentstarsystemage;
        public string CurrentStarSystemAge
        {
            get { return _currentstarsystemage; }
            set
            {
                // safty check:
                //if (_currentstarsystemage == null)
                //{
                //    return;
                //}

                _currentstarsystemage = value;
                //NotifyPropertyChanged("CurrentStarSystemAge");
                OnPropertyChanged(() => CurrentStarSystemAge);<commit_msg>Quick Crash fix.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Pulsar4X.Entities;
using Pulsar4X.UI.Helpers;
using System.ComponentModel;
using System.Collections.ObjectModel;
using System.Windows.Forms;
using System.Linq.Expressions;

namespace Pulsar4X.UI.ViewModels
{
    public class StarSystemViewModel : INotifyPropertyChanged
    {
        private StarSystem _currentstarsystem;
        public StarSystem CurrentStarSystem
        {
            get { return _currentstarsystem; }
            set
            {
                _currentstarsystem = value;

                // safty check
                if (_currentstarsystem == null)
                {
                    return;
                }

                OnPropertyChanged(() => CurrentStarSystem);

                if (_currentstarsystem.Stars != null && _currentstarsystem.Stars.Count > 0)
                    CurrentStarSystemAge = _currentstarsystem.Stars[0].Age.ToString();
                else
                    CurrentStarSystemAge = "N/A";
                Seed = _currentstarsystem.Seed.ToString();
                Stars = new BindingList<Star>(_currentstarsystem.Stars);
                StarsSource.DataSource = Stars;
                OnPropertyChanged(() => Stars);
            }
        }
        public BindingList<StarSystem> StarSystems { get; set; }

        private string _currentstarsystemage;
        public string CurrentStarSystemAge
        {
            get { return _currentstarsystemage; }
            set
            {
                // safty check:
                //if (_currentstarsystemage == null)
                //{
                //    return;
                //}

                _currentstarsystemage = value;
                //NotifyPropertyChanged("CurrentStarSystemAge");
                OnPropertyChanged(() => CurrentStarSystemAge);
{'fraction_non_alphanumeric': 0.07973604619191642, 'fraction_numerical': 0.002474566950783613, 'mean_word_length': 1.6809137803979366, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 14, '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': '4362546', 'n_tokens_mistral': 942, 'n_tokens_neox': 863, 'n_words': 175}