<commit_before>/* Yet Another Forum.NET
 * Copyright (C) 2006-2010 <NAME>
 * http://www.yetanotherforum.net/
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
namespace YAF.Classes
{
  #region Using

  using System;

  using YAF.Classes.Interfaces;
  using YAF.Classes.Pattern;

  #endregion

  /// <summary>
  /// The yaf provider.
  /// </summary>
  public static class YafFactoryProvider
  {
    #region Constants and Fields

    /// <summary>
    /// The _builder factory.
    /// </summary>
    private static ITypeFactoryInstance<IUrlBuilder> _builderFactory = null;

    /// <summary>
    /// The _user display name factory.
    /// </summary>
    private static ITypeFactoryInstance<IUserDisplayName> _userDisplayNameFactory = null;

    #endregion

    #region Properties

    /// <summary>
    /// Gets UrlBuilder.
    /// </summary>
    public static IUrlBuilder UrlBuilder
    {
      get
      {
        if (_builderFactory == null)
        {
          _builderFactory = new TypeFactoryInstanceApplicationBoardScope<IUrlBuilder>(UrlBuilderType);
        }

        return _builderFactory.Get();
      }
    }

    /// <summary>
    /// Gets current <see cref="IUserDisplayName"/>.
    /// </summary>
    public static IUserDisplayName UserDisplayName
    {
      get
      {
        if (_userDisplayNameFactory == null)
        {
          _userDisplayNameFactory = new TypeFactoryInstanceApplicationBoardScope<IUserDisplayName>(UserDisplayNameType);
        }

        return _userDisplayNameFactory.Get();
      }
    }

    /// <summary>
    /// Gets UrlBuilderType.
    /// </summary>
    private static string UrlBuilderType
    {
      get
      {
        string urlAssembly;

        if (!String.IsNullOrEmpty(Config.GetProvider("UrlBuilder")))
        {
          urlAssembly = Config.GetProvider("UrlBuilder");
        }
        else if (Config.IsRainbow)
        {
          urlAssembly = "yaf_rainbow.RainbowUrlBuilder,yaf_rainbow";
        }
        else if (Config.IsDotNetNuke)
        {
            urlAssembly = "YAF.DotNetNuke.DotNetNukeUrlBuilder,YAF.DotNetNuke.Module";
        }
        else if (Config.IsMojoPortal)
        {
          urlAssembly = "yaf_mojo.MojoPortalUrlBuilder,yaf_mojo";
        }
        else if (Config.IsPortal)
        {<commit_msg>Setting YafFactoryProvider to the new MojoPortal URL Builder<commit_after>/* Yet Another Forum.NET
 * Copyright (C) 2006-2010 <NAME>
 * http://www.yetanotherforum.net/
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
namespace YAF.Classes
{
  #region Using

  using System;

  using YAF.Classes.Interfaces;
  using YAF.Classes.Pattern;

  #endregion

  /// <summary>
  /// The yaf provider.
  /// </summary>
  public static class YafFactoryProvider
  {
    #region Constants and Fields

    /// <summary>
    /// The _builder factory.
    /// </summary>
    private static ITypeFactoryInstance<IUrlBuilder> _builderFactory = null;

    /// <summary>
    /// The _user display name factory.
    /// </summary>
    private static ITypeFactoryInstance<IUserDisplayName> _userDisplayNameFactory = null;

    #endregion

    #region Properties

    /// <summary>
    /// Gets UrlBuilder.
    /// </summary>
    public static IUrlBuilder UrlBuilder
    {
      get
      {
        if (_builderFactory == null)
        {
          _builderFactory = new TypeFactoryInstanceApplicationBoardScope<IUrlBuilder>(UrlBuilderType);
        }

        return _builderFactory.Get();
      }
    }

    /// <summary>
    /// Gets current <see cref="IUserDisplayName"/>.
    /// </summary>
    public static IUserDisplayName UserDisplayName
    {
      get
      {
        if (_userDisplayNameFactory == null)
        {
          _userDisplayNameFactory = new TypeFactoryInstanceApplicationBoardScope<IUserDisplayName>(UserDisplayNameType);
        }

        return _userDisplayNameFactory.Get();
      }
    }

    /// <summary>
    /// Gets UrlBuilderType.
    /// </summary>
    private static string UrlBuilderType
    {
      get
      {
        string urlAssembly;

        if (!String.IsNullOrEmpty(Config.GetProvider("UrlBuilder")))
        {
          urlAssembly = Config.GetProvider("UrlBuilder");
        }
        else if (Config.IsRainbow)
        {
          urlAssembly = "yaf_rainbow.RainbowUrlBuilder,yaf_rainbow";
        }
        else if (Config.IsDotNetNuke)
        {
            urlAssembly = "YAF.DotNetNuke.DotNetNukeUrlBuilder,YAF.DotNetNuke.Module";
        }
        else if (Config.IsMojoPortal)
        {
            urlAssembly = "YAF.Mojo.MojoPortalUrlBuilder,YAF.Mojo";
        }
        else if (Config.IsPortal)
        {
{'fraction_non_alphanumeric': 0.09362982778799532, 'fraction_numerical': 0.007691021568299616, 'mean_word_length': 2.391156462585034, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, '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': '2273991', 'n_tokens_mistral': 1732, 'n_tokens_neox': 1643, 'n_words': 487}