<commit_before>// Copyright (c) MarinAtanasov. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the project root for license information.
//
using AppBrix.Application;
using AppBrix.Lifecycle;
using System;
using System.Linq;

namespace AppBrix.Modules
{
    /// <summary>
    /// Base interface for application modules.
    /// </summary>
    public abstract class ModuleBase : IModule
    {
        #region Properties
        /// <summary>
        /// Gets the current module's app.
        /// </summary>
        protected IApp App { get; private set; }
        #endregion

        #region Public methods
        /// <summary>
        /// Initializes the common module logic and calls the implemented InitializeModule method.
        /// </summary>
        /// <param name="context">The current initialization context.</param>
        public void Initialize(IInitializeContext context)
        {
            this.App = context.App;
            this.InitializeModule(context);
        }

        /// <summary>
        /// Calls the implemented UninitializeModule method and uninitializes the common module logic.
        /// </summary>
        public void Uninitialize()
        {
            this.UninitializeModule();
            this.App = null;
        }

        protected abstract void InitializeModule(IInitializeContext context);

        protected abstract void UninitializeModule();
        #endregion<commit_msg>Improved documentation for ModuleBase.<commit_after>// Copyright (c) MarinAtanasov. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the project root for license information.
//
using AppBrix.Application;
using AppBrix.Lifecycle;
using System;
using System.Linq;

namespace AppBrix.Modules
{
    /// <summary>
    /// Base class for application modules.
    /// This class will set <see cref="App"/> before calling the overriden methods.
    /// </summary>
    public abstract class ModuleBase : IModule
    {
        #region Properties
        /// <summary>
        /// Gets the current module's app.
        /// </summary>
        protected IApp App { get; private set; }
        #endregion

        #region Public methods
        /// <summary>
        /// Initializes the common module logic and calls the implemented InitializeModule method.
        /// </summary>
        /// <param name="context">The current initialization context.</param>
        public void Initialize(IInitializeContext context)
        {
            this.App = context.App;
            this.InitializeModule(context);
        }

        /// <summary>
        /// Calls the implemented UninitializeModule method and uninitializes the common module logic.
        /// </summary>
        public void Uninitialize()
        {
            this.UninitializeModule();
            this.App = null;
        }

        /// <summary>
        /// Called after <see cref="ModuleBase"/>'s <see cref="Initialize(IInitializeContext)"/>.
        /// </summary>
        /// <param name="context"></param>
        protected abstract void InitializeModule(IInitializeContext context);

        /// <summary>
        /// Called after <see cref="ModuleBase"/>'s <see cref="Uninitialize"/>
        /// </summary>
        protected abstract void UninitializeModule();
        #endregion
{'fraction_non_alphanumeric': 0.10723941123460498, 'fraction_numerical': 0.0, 'mean_word_length': 2.1063432835820897, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 34, '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': '3802681', 'n_tokens_mistral': 794, 'n_tokens_neox': 794, 'n_words': 265}