-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
support
committed
Dec 23, 2023
1 parent
10499ff
commit fd10f5a
Showing
449 changed files
with
536 additions
and
28,796 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using Grand.SharedKernel; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using System.Reflection; | ||
|
||
namespace Grand.Infrastructure.Themes | ||
{ | ||
public sealed class ThemeInfo | ||
{ | ||
public ThemeInfo( | ||
FileInfo originalAssemblyFile, | ||
Assembly referencedAssembly) | ||
: this() | ||
{ | ||
ReferencedAssembly = referencedAssembly; | ||
OriginalAssemblyFile = originalAssemblyFile; | ||
} | ||
public ThemeInfo() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// The assembly that has been shadow copied that is active in the application | ||
/// </summary> | ||
public Assembly ReferencedAssembly { get; internal set; } | ||
|
||
/// <summary> | ||
/// The original assembly file that a shadow copy was made from it | ||
/// </summary> | ||
public FileInfo OriginalAssemblyFile { get; internal set; } | ||
|
||
public string ThemeFileName { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the theme system name | ||
/// </summary> | ||
public string SystemName { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the theme friendly name | ||
/// </summary> | ||
public string FriendlyName { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the author of theme | ||
/// </summary> | ||
public string Author { get; set; } | ||
|
||
public string SupportedVersion { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the theme system name | ||
/// </summary> | ||
public string Version { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the theme supports RTL (right-to-left) | ||
/// </summary> | ||
public bool SupportRtl { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the path to the preview image of the theme | ||
/// </summary> | ||
public string PreviewImageUrl { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the preview text of the theme | ||
/// </summary> | ||
public string PreviewText { get; set; } | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/Core/Grand.Infrastructure/Themes/ThemeInfoAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Reflection; | ||
|
||
namespace Grand.Infrastructure.Themes | ||
{ | ||
[AttributeUsage(AttributeTargets.Assembly)] | ||
public class ThemeInfoAttribute : Attribute | ||
{ | ||
public ThemeInfoAttribute() | ||
{ | ||
Assembly assembly = Assembly.GetExecutingAssembly(); | ||
Version fullVersion = assembly.GetName().Version; | ||
SupportedVersion = $"{fullVersion?.Minor}.{fullVersion?.Major}"; | ||
|
||
} | ||
public string FriendlyName { get; set; } = string.Empty; | ||
public string SystemName { get; set; } = string.Empty; | ||
public string Author { get; set; } = string.Empty; | ||
|
||
public string SupportedVersion { get; set; } | ||
|
||
public string Version { get; set; } | ||
|
||
public bool SupportRtl { get; set; } | ||
public string PreviewImageUrl { get; set; }= string.Empty; | ||
public string PreviewText { get; set; }= string.Empty; | ||
} | ||
} |
Oops, something went wrong.