<commit_before>﻿using System;
using System.Collections.Generic;
using xFunc.Maths;
using xFunc.Maths.Expressions;
using xFunc.Views;

namespace xFunc.Presenters
{

    public class GraphsTabPresenter
    {

        private IMainView view;

        private MathParser parser;
        private List<IMathExpression> listOfGraphs;

        public GraphsTabPresenter(IMainView view)
        {
            this.view = view;

            parser = new MathParser { AngleMeasurement = AngleMeasurement.Radian };
            listOfGraphs = new List<IMathExpression>();
        }

        public void Add(string strExp)
        {
            listOfGraphs.Add(parser.Parse(strExp));

            view.Graphs = listOfGraphs.AsReadOnly();
        }

        public void Remove(IMathExpression exp)
        {
            listOfGraphs.Remove(exp);<commit_msg>Added max count of graph<commit_after>﻿using System;
using System.Collections.Generic;
using xFunc.Maths;
using xFunc.Maths.Expressions;
using xFunc.Properties;
using xFunc.Views;

namespace xFunc.Presenters
{

    public class GraphsTabPresenter
    {

        private IMainView view;

        private MathParser parser;
        private int countOfGraphs;
        private List<IMathExpression> listOfGraphs;

        public GraphsTabPresenter(IMainView view)
        {
            this.view = view;

            parser = new MathParser { AngleMeasurement = AngleMeasurement.Radian };
            countOfGraphs = Settings.Default.MaxCountOfExpressions;
            listOfGraphs = new List<IMathExpression>(countOfGraphs);
        }

        public void Add(string strExp)
        {
            listOfGraphs.Add(parser.Parse(strExp));

            while (listOfGraphs.Count + 1 > countOfGraphs)
                listOfGraphs.RemoveAt(0);

            view.Graphs = listOfGraphs.AsReadOnly();
        }

        public void Remove(IMathExpression exp)
        {
            listOfGraphs.Remove(exp);
{'fraction_non_alphanumeric': 0.07632800412583807, 'fraction_numerical': 0.0010314595152140279, 'mean_word_length': 2.3448275862068964, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '5700556', 'n_tokens_mistral': 556, 'n_tokens_neox': 538, 'n_words': 113}