Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/Geta.Optimizely.ContentTypeIcons.EnumGenerator/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
Expand Down Expand Up @@ -49,7 +49,7 @@ static async Task Main()
foreach (var item in styles)
{
var styleName = item.ToTitleCase();
var enumName = $"FontAwesome5{styleName}";
var enumName = $"FontAwesome7{styleName}";
var localPath = $@"{enumBasePath}\{enumName}.cs";

Console.WriteLine("\nGenerating {0}.cs...", enumName);
Expand All @@ -67,7 +67,9 @@ static async Task Main()

private static void CopyFontFiles(ZipArchive archive, string enumBasePath)
{
var destination = $@"{enumBasePath}\module\ClientResources\fa5\webfonts\";
var destination = $@"{enumBasePath}\module\ClientResources\fa7\webfonts\";
Directory.CreateDirectory(destination);

var rootEntry = archive.Entries[0];
var fontEntries = archive.Entries.Where(x =>
x.FullName.StartsWith(rootEntry + "webfonts") &&
Expand All @@ -82,7 +84,9 @@ private static void CopyFontFiles(ZipArchive archive, string enumBasePath)

private static void CopyCssFiles(ZipArchive archive, string enumBasePath)
{
var destination = $@"{enumBasePath}\module\ClientResources\fa5\css\";
var destination = $@"{enumBasePath}\module\ClientResources\fa7\css\";
Directory.CreateDirectory(destination);

var rootEntry = archive.Entries[0];
var cssFile = archive.Entries.Single(x => x.FullName.Contains(rootEntry + "css/all.min.css"));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using EPiServer.DataAnnotations;

namespace Geta.Optimizely.ContentTypeIcons.Attributes
Expand Down Expand Up @@ -111,6 +111,74 @@ public ContentTypeIconAttribute(
FontSize = fontSize;
}

/// <summary>
/// Initializes a new instance of the <see cref="T:Geta.Optimizely.ContentTypeIcons.Attributes.ContentTypeIconAttribute" /> class.
/// </summary>
/// <param name="icon">The FontAwesome7Brands icon to be used</param>
/// <param name="rotate">The rotation to be used, defaults to None</param>
/// <param name="backgroundColor">The backgroundColor to be used when rendering the image (specified in hexadecimal, for example #000000)</param>
/// <param name="foregroundColor">The foregroundColor to be used when rendering the image (specified in hexadecimal, for example #ffffff) </param>
/// <param name="fontSize">The fontSize to be used, default value is 40</param>
public ContentTypeIconAttribute(
FontAwesome7Brands icon,
Rotations rotate = Rotations.None,
string backgroundColor = "",
string foregroundColor = "",
int fontSize = -1)
: base(string.Empty)
{
Icon = icon;
Rotate = rotate;
BackgroundColor = backgroundColor;
ForegroundColor = foregroundColor;
FontSize = fontSize;
}

/// <summary>
/// Initializes a new instance of the <see cref="T:Geta.Optimizely.ContentTypeIcons.Attributes.ContentTypeIconAttribute" /> class.
/// </summary>
/// <param name="icon">The FontAwesome7Regular icon to be used</param>
/// <param name="rotate">The rotation to be used, defaults to None</param>
/// <param name="backgroundColor">The backgroundColor to be used when rendering the image (specified in hexadecimal, for example #000000)</param>
/// <param name="foregroundColor">The foregroundColor to be used when rendering the image (specified in hexadecimal, for example #ffffff) </param>
/// <param name="fontSize">The fontSize to be used, default value is 40</param>
public ContentTypeIconAttribute(
FontAwesome7Regular icon,
Rotations rotate = Rotations.None,
string backgroundColor = "",
string foregroundColor = "",
int fontSize = -1)
: base(string.Empty)
{
Icon = icon;
Rotate = rotate;
BackgroundColor = backgroundColor;
ForegroundColor = foregroundColor;
FontSize = fontSize;
}

/// <summary>
/// Initializes a new instance of the <see cref="T:Geta.Optimizely.ContentTypeIcons.Attributes.ContentTypeIconAttribute" /> class.
/// </summary>
/// <param name="icon">The FontAwesome7Solid icon to be used</param>
/// <param name="rotate">The rotation to be used, defaults to None</param>
/// <param name="backgroundColor">The backgroundColor to be used when rendering the image (specified in hexadecimal, for example #000000)</param>
/// <param name="foregroundColor">The foregroundColor to be used when rendering the image (specified in hexadecimal, for example #ffffff) </param>
/// <param name="fontSize">The fontSize to be used, default value is 40</param>
public ContentTypeIconAttribute(
FontAwesome7Solid icon,
Rotations rotate = Rotations.None,
string backgroundColor = "",
string foregroundColor = "",
int fontSize = -1)
: base(string.Empty)
{
Icon = icon;
Rotate = rotate;
BackgroundColor = backgroundColor;
ForegroundColor = foregroundColor;
FontSize = fontSize;
}

/// <summary>
/// Initializes a new instance of the <see cref="T:Geta.Optimizely.ContentTypeIcons.Attributes.ContentTypeIconAttribute" /> class.
Expand Down
Loading
Loading