<commit_before>﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TeamCitySharp;

namespace StatusMonitor.Model
{
    public class TeamCityWatcher
    {
        private string _serverPath = null;
        private string _serverUsername = null;
        private string _serverPassword = null;

        private static TeamCityWatcher _instance = null;
        public static TeamCityWatcher Instance
        {
            get
            {
                if (_instance == null)
                    _instance = new TeamCityWatcher();
                return _instance;
            }
        }

        private bool _isGuest = false;
        public bool IsGuest => _isGuest;

        private TeamCityWatcher()
        {
            Initialize();
        }

        private void Initialize()
        {
            _serverPath = AppSettingsHelper.Instance.Settings.TeamCityServerPath;
            _serverUsername = AppSettingsHelper.Instance.Settings.TeamCityUserName;
            _serverPassword = AppSettingsHelper.Instance.Settings.TeamCityPassword;

            TeamCityClient client = new TeamCityClient(_serverPath);

            if (!string.IsNullOrEmpty(_serverUsername) && !string.IsNullOrEmpty(_serverPassword))
            {
                client.Connect(_serverUsername, _serverPassword);
                _isGuest = false;
            }
            else
            {
                client.ConnectAsGuest();
                _isGuest = true;
            }

        }

        public void Start()
        {

        }
    }
}<commit_msg>TeamCityWatcher: Get Projects<commit_after>﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TeamCitySharp;
using TeamCitySharp.DomainEntities;

namespace StatusMonitor.Model
{
    public class TeamCityWatcher
    {
        private string _serverPath = null;
        private string _serverUsername = null;
        private string _serverPassword = null;

        private List<Project> _projects = null;
        public List<Project> Projects { get { return _projects; } }

        private TeamCityClient _client = null;

        private static TeamCityWatcher _instance = null;
        public static TeamCityWatcher Instance
        {
            get
            {
                if (_instance == null)
                    _instance = new TeamCityWatcher();
                return _instance;
            }
        }

        private bool _isGuest = false;
        public bool IsGuest => _isGuest;

        private TeamCityWatcher()
        {
            Initialize();
        }

        private void Initialize()
        {
            _serverPath = AppSettingsHelper.Instance.Settings.TeamCityServerPath;
            _serverUsername = AppSettingsHelper.Instance.Settings.TeamCityUserName;
            _serverPassword = AppSettingsHelper.Instance.Settings.TeamCityPassword;

            _client = new TeamCityClient(_serverPath);

            if (!string.IsNullOrEmpty(_serverUsername) && !string.IsNullOrEmpty(_serverPassword))
            {
                _client.Connect(_serverUsername, _serverPassword);
                _isGuest = false;
            }
            else
            {
                _client.ConnectAsGuest();
                _isGuest = true;
            }
        }

        public void Start()
        {
            _projects = _client.Projects.All();
        }
    }
}
{'fraction_non_alphanumeric': 0.06966864910790145, 'fraction_numerical': 0.0, 'mean_word_length': 1.8346709470304976, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3439184', 'n_tokens_mistral': 876, 'n_tokens_neox': 838, 'n_words': 193}