<commit_before>﻿using System;
using System.Threading;

namespace Theraot.Core
{
    [Serializable]
    public class NewOperationCanceledException : OperationCanceledException
    {
        [NonSerialized]
        private CancellationToken? _token;

        public NewOperationCanceledException(CancellationToken token)
            : base()
        {
            _token = token;
        }

        public NewOperationCanceledException(string message, CancellationToken token)
            : base(message)
        {
            _token = token;
        }

        public NewOperationCanceledException(string message, Exception innerException, CancellationToken token)
            : base(message, innerException)
        {
            _token = token;
        }

        public CancellationToken CancellationToken
        {
            get
            {
                if (object.ReferenceEquals(_token, null))
                {
                    return CancellationToken.None;
                }
                else
                {
                    return _token.Value;
                }
            }
        }
    }
}<commit_msg>Fixed warning in NET 4.0 y 4.5<commit_after>﻿using System;
using System.Threading;

namespace Theraot.Core
{
    [Serializable]
    public class NewOperationCanceledException : OperationCanceledException
    {
#if NET20 || NET30 || NET35
        [NonSerialized]
        private CancellationToken? _token;

        public NewOperationCanceledException(CancellationToken token)
            : base()
        {
            _token = token;
        }

        public NewOperationCanceledException(string message, CancellationToken token)
            : base(message)
        {
            _token = token;
        }

        public NewOperationCanceledException(string message, Exception innerException, CancellationToken token)
            : base(message, innerException)
        {
            _token = token;
        }

        public CancellationToken CancellationToken
        {
            get
            {
                if (object.ReferenceEquals(_token, null))
                {
                    return CancellationToken.None;
                }
                else
                {
                    return _token.Value;
                }
            }
        }
#endif
    }
}
{'fraction_non_alphanumeric': 0.06206896551724138, 'fraction_numerical': 0.004310344827586207, 'mean_word_length': 1.490343347639485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2268287', 'n_tokens_mistral': 550, 'n_tokens_neox': 559, 'n_words': 115}