<commit_before>﻿// Copyright 2014 by PeopleWare n.v..
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
// http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System.Linq;

using NHibernate.Cfg;
using NHibernate.Event;

using PPWCode.Vernacular.NHibernate.I.Interfaces;
using PPWCode.Vernacular.Persistence.II;

namespace PPWCode.Vernacular.NHibernate.I.Utilities
{
    public class CivilizedEventListener :
        IRegisterEventListener,
        IPreUpdateEventListener,
        IPreInsertEventListener
    {
        /// <summary>
        ///     Return true if the operation should be vetoed.
        /// </summary>
        /// <param name="event">The given event.</param>
        /// <returns>A boolean indicating whether the operation should be vetoed.</returns>
        public bool OnPreInsert(PreInsertEvent @event)<commit_msg>Make class serializable, so the hibernate session factory can be serialized<commit_after>﻿// Copyright 2015 by PeopleWare n.v..
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
// http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.Linq;

using NHibernate.Cfg;
using NHibernate.Event;

using PPWCode.Vernacular.NHibernate.I.Interfaces;
using PPWCode.Vernacular.Persistence.II;

namespace PPWCode.Vernacular.NHibernate.I.Utilities
{
    [Serializable]
    public class CivilizedEventListener :
        IRegisterEventListener,
        IPreUpdateEventListener,
        IPreInsertEventListener
    {
        /// <summary>
        ///     Return true if the operation should be vetoed.
        /// </summary>
        /// <param name="event">The given event.</param>
        /// <returns>A boolean indicating whether the operation should be vetoed.</returns>
        public bool OnPreInsert(PreInsertEvent @event)
{'fraction_non_alphanumeric': 0.09101081685938082, 'fraction_numerical': 0.005967922417008579, 'mean_word_length': 3.138888888888889, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4628561', 'n_tokens_mistral': 719, 'n_tokens_neox': 686, 'n_words': 270}