Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

PluginLoadedAssemblyInfo.cs

namespace Nop.Services.Plugins;

/// 
/// Represents an information about assembly which loaded by plugins
/// 
public partial class PluginLoadedAssemblyInfo
{
    #region Ctor

    /// 
    /// Ctor
    /// 
    /// Assembly short name
    /// Assembly version
    public PluginLoadedAssemblyInfo(string shortName, Version assemblyInMemory)
    {
        ShortName = shortName;
        References = new List<(string PluginName, Version AssemblyVersion)>();
        AssemblyInMemory = assemblyInMemory;
    }

    #endregion

    #region Properties

    /// 
    /// Assembly in memory
    /// 
    public Version AssemblyInMemory { get; }

    /// 
    /// Gets the short assembly name
    /// 
    public string ShortName { get; }

    /// 
    /// Gets a list of all mentioned plugin-assembly pairs
    /// 
    public List<(string PluginName, Version AssemblyVersion)> References { get; }

    /// 
    /// Gets a list of plugins that conflict with the loaded assembly version
    /// 
    public IList<(string PluginName, Version AssemblyVersion)> Collisions =>
        References.Where(reference => !reference.AssemblyVersion.Equals(AssemblyInMemory)).ToList();

    #endregion
}