Skip to content

Commit

Permalink
Merge pull request #64 from Mijo-Software/mjohne-patch-1
Browse files Browse the repository at this point in the history
Add files via upload
  • Loading branch information
mjohne authored Dec 30, 2020
2 parents 2982257 + e20f6e2 commit 3971ffa
Show file tree
Hide file tree
Showing 7 changed files with 355 additions and 386 deletions.
87 changes: 7 additions & 80 deletions EmojiLib/AboutBoxForm.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ο»Ώusing System.IO;
using System.Reflection;
using System.Windows.Forms;
using MijoSoftware.AssemblyInformation;

namespace EmojiLib
{
Expand All @@ -9,86 +10,12 @@ internal partial class AboutBoxForm : Form
public AboutBoxForm()
{
InitializeComponent();
Text = $"Info ΓΌber {AssemblyTitle}";
labelProductName.Text = AssemblyProduct;
labelVersion.Text = $"Version {AssemblyVersion}";
labelCopyright.Text = AssemblyCopyright;
labelCompanyName.Text = AssemblyCompany;
textBoxDescription.Text = AssemblyDescription;
Text = $"About {AssemblyInfo.AssemblyTitle}";
labelProductName.Text = AssemblyInfo.AssemblyProduct;
labelVersion.Text = $"Version {AssemblyInfo.AssemblyVersion}";
labelCopyright.Text = AssemblyInfo.AssemblyCopyright;
labelCompanyName.Text = AssemblyInfo.AssemblyCompany;
textBoxDescription.Text = AssemblyInfo.AssemblyDescription;
}

#region Assemblyattributaccessoren

public static string AssemblyTitle
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyTitleAttribute), inherit: false);
if (attributes.Length > 0)
{
AssemblyTitleAttribute titleAttribute = attributes[0] as AssemblyTitleAttribute;
if (!string.IsNullOrEmpty(value: titleAttribute.Title))
{
return titleAttribute.Title;
}
}
return Path.GetFileNameWithoutExtension(path: Assembly.GetExecutingAssembly().CodeBase);
}
}

public static string AssemblyVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();

public static string AssemblyDescription
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyDescriptionAttribute), inherit: false);
if (attributes.Length == 0)
{
return "";
}
return (attributes[0] as AssemblyDescriptionAttribute)?.Description;
}
}

public static string AssemblyProduct
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyProductAttribute), inherit: false);
if (attributes.Length == 0)
{
return "";
}
return (attributes[0] as AssemblyProductAttribute)?.Product;
}
}

public static string AssemblyCopyright
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyCopyrightAttribute), inherit: false);
if (attributes.Length == 0)
{
return "";
}
return (attributes[0] as AssemblyCopyrightAttribute)?.Copyright;
}
}

public static string AssemblyCompany
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyCompanyAttribute), inherit: false);
if (attributes.Length == 0)
{
return "";
}
return (attributes[0] as AssemblyCompanyAttribute)?.Company;
}
}
#endregion
}
}
87 changes: 87 additions & 0 deletions EmojiLib/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
using System.Reflection;

namespace MijoSoftware.AssemblyInformation
{
/// <summary>
/// Provide some assembly information
/// </summary>
public static class AssemblyInfo
{
#region Assembly attribute accessors

/// <summary>
/// Return the title of the assembly
/// </summary>
public static string AssemblyTitle
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyTitleAttribute), inherit: false);
if (attributes.Length > 0)
{
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
if (!string.IsNullOrEmpty(value: titleAttribute.Title))
{
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(path: Assembly.GetExecutingAssembly().CodeBase);
}
}

/// <summary>
/// Return the version of the assembly
/// </summary>
public static string AssemblyVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();

/// <summary>
/// Return the description of the assembly
/// </summary>
public static string AssemblyDescription
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyDescriptionAttribute), inherit: false);
return attributes.Length == 0 ? string.Empty : ((AssemblyDescriptionAttribute)attributes[0]).Description;
}
}

/// <summary>
/// Return the product name of the assembly
/// </summary>
public static string AssemblyProduct
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyProductAttribute), inherit: false);
return attributes.Length == 0 ? string.Empty : ((AssemblyProductAttribute)attributes[0]).Product;
}
}

/// <summary>
/// Return the copyright of the assembly
/// </summary>
public static string AssemblyCopyright
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyCopyrightAttribute), inherit: false);
return attributes.Length == 0 ? string.Empty : ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}

/// <summary>
/// Return the company name of the assembly
/// </summary>
public static string AssemblyCompany
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyCompanyAttribute), inherit: false);
return attributes.Length == 0 ? string.Empty : ((AssemblyCompanyAttribute)attributes[0]).Company;
}
}

#endregion
}
}
2 changes: 2 additions & 0 deletions EmojiLib/EmojiLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
<Compile Include="AboutBoxForm.Designer.cs">
<DependentUpon>AboutBoxForm.cs</DependentUpon>
</Compile>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="EmojiInfoForm.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -290,6 +291,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="emoji-lib.ico" />
<None Include="Resources\SmilingFaceWithTearTwitter.png" />
<None Include="Resources\HearNoEvilMonkeyJoyPixels.png" />
<None Include="Resources\SpeakNoEvilMonkeyTwitter.png" />
<None Include="Resources\SpeakNoEvilMonkeySamsung.png" />
Expand Down
9 changes: 9 additions & 0 deletions EmojiLib/EmojiSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,14 @@ public static class EmojiSet
internal static readonly Emoji winkingFace = new Emoji(character: "πŸ˜‰", unicode: "U+1F609", group: Resources.smileysAndEmotion, subGroup: Resources.faceSmiling, shortName: "", fullName: "winking face", description: "", appleIcon: FaceSmiling.WinkingFaceApple, googleIcon: FaceSmiling.WinkingFaceGoogle, facebookIcon: FaceSmiling.WinkingFaceFacebook, windowsIcon: FaceSmiling.WinkingFaceWindows, twitterIcon: FaceSmiling.WinkingFaceTwitter, joypixelsIcon: FaceSmiling.WinkingFaceJoyPixels, samsungIcon: FaceSmiling.WinkingFaceSamsung, gmailIcon: FaceSmiling.WinkingFaceGmail, docomoIcon: FaceSmiling.WinkingFaceDocomo, kddiIcon: FaceSmiling.WinkingFaceKddi, softbankIcon: FaceSmiling.WinkingFaceSoftbank);
internal static readonly Emoji smilingFaceWithSmilingEyes = new Emoji(character: "😊", unicode: "U+1F60A", group: Resources.smileysAndEmotion, subGroup: Resources.faceSmiling, shortName: "", fullName: "smiling face with smiling eyes", description: "", appleIcon: FaceSmiling.SmilingFaceWithSmilingEyesApple, googleIcon: FaceSmiling.SmilingFaceWithSmilingEyesGoogle, facebookIcon: FaceSmiling.SmilingFaceWithSmilingEyesFacebook, windowsIcon: FaceSmiling.SmilingFaceWithSmilingEyesWindows, twitterIcon: FaceSmiling.SmilingFaceWithSmilingEyesTwitter, joypixelsIcon: FaceSmiling.SmilingFaceWithSmilingEyesJoyPixels, samsungIcon: FaceSmiling.SmilingFaceWithSmilingEyesSamsung, gmailIcon: FaceSmiling.SmilingFaceWithSmilingEyesGmail, docomoIcon: null, kddiIcon: FaceSmiling.SmilingFaceWithSmilingEyesKddi, softbankIcon: FaceSmiling.SmilingFaceWithSmilingEyesSoftbank);
internal static readonly Emoji smilingFaceWithHalo = new Emoji(character: "πŸ˜‡", unicode: "U+1F607", group: Resources.smileysAndEmotion, subGroup: Resources.faceSmiling, shortName: "", fullName: "smiling face with halo", description: "", appleIcon: FaceSmiling.SmilingFaceWithHaloApple, googleIcon: FaceSmiling.SmilingFaceWithHaloGoogle, facebookIcon: FaceSmiling.SmilingFaceWithHaloFacebook, windowsIcon: FaceSmiling.SmilingFaceWithHaloWindows, twitterIcon: FaceSmiling.SmilingFaceWithHaloTwitter, joypixelsIcon: FaceSmiling.SmilingFaceWithHaloJoyPixels, samsungIcon: FaceSmiling.SmilingFaceWithHaloSamsung, gmailIcon: null, docomoIcon: null, kddiIcon: null, softbankIcon: null);
internal static readonly Emoji smilingFaceWithHearts = new Emoji(character: "πŸ₯°", unicode: "U+1F970", group: Resources.smileysAndEmotion, subGroup: Resources.faceAffection, shortName: "", fullName: "smiling face with hearts", description: "", appleIcon: FaceAffection.SmilingFaceWithHeartsApple, googleIcon: FaceAffection.SmilingFaceWithHeartsGoogle, facebookIcon: FaceAffection.SmilingFaceWithHeartsFacebook, windowsIcon: FaceAffection.SmilingFaceWithHeartsWindows, twitterIcon: FaceAffection.SmilingFaceWithHeartsTwitter, joypixelsIcon: FaceAffection.SmilingFaceWithHeartsJoyPixels, samsungIcon: FaceAffection.SmilingFaceWithHeartsSamsung, gmailIcon: null, docomoIcon: null, kddiIcon: null, softbankIcon: null);
internal static readonly Emoji smilingFaceWithHeartEyes = new Emoji(character: "😍", unicode: "U+1F60D", group: Resources.smileysAndEmotion, subGroup: Resources.faceAffection, shortName: "", fullName: "smiling face with heart-eyes", description: "", appleIcon: FaceAffection.SmilingFaceWithHeartEyesApple, googleIcon: FaceAffection.SmilingFaceWithHeartEyesGoogle, facebookIcon: FaceAffection.SmilingFaceWithHeartEyesFacebook, windowsIcon: FaceAffection.SmilingFaceWithHeartEyesWindows, twitterIcon: FaceAffection.SmilingFaceWithHeartEyesTwitter, joypixelsIcon: FaceAffection.SmilingFaceWithHeartEyesJoyPixels, samsungIcon: FaceAffection.SmilingFaceWithHeartEyesSamsung, gmailIcon: FaceAffection.SmilingFaceWithHeartEyesGmail, docomoIcon: FaceAffection.SmilingFaceWithHeartEyesDocomo, kddiIcon: FaceAffection.SmilingFaceWithHeartEyesKddi, softbankIcon: FaceAffection.SmilingFaceWithHeartEyesSoftbank);
internal static readonly Emoji starStruck = new Emoji(character: "🀩", unicode: "U+1F929", group: Resources.smileysAndEmotion, subGroup: Resources.faceAffection, shortName: "", fullName: "star-struck", description: "", appleIcon: FaceAffection.StarStruckApple, googleIcon: FaceAffection.StarStruckGoogle, facebookIcon: FaceAffection.StarStruckFacebook, windowsIcon: FaceAffection.StarStruckWindows, twitterIcon: FaceAffection.StarStruckTwitter, joypixelsIcon: FaceAffection.StarStruckJoyPixels, samsungIcon: FaceAffection.StarStruckSamsung, gmailIcon: null, docomoIcon: null, kddiIcon: null, softbankIcon: null);
internal static readonly Emoji faceBlowingAKiss = new Emoji(character: "😘", unicode: "U+1F618", group: Resources.smileysAndEmotion, subGroup: Resources.faceAffection, shortName: "", fullName: "face blowing a kiss", description: "", appleIcon: FaceAffection.FaceBlowingAKissApple, googleIcon: FaceAffection.FaceBlowingAKissGoogle, facebookIcon: FaceAffection.FaceBlowingAKissFacebook, windowsIcon: FaceAffection.FaceBlowingAKissWindows, twitterIcon: FaceAffection.FaceBlowingAKissTwitter, joypixelsIcon: FaceAffection.FaceBlowingAKissJoyPixels, samsungIcon: FaceAffection.FaceBlowingAKissSamsung, gmailIcon: FaceAffection.FaceBlowingAKissGmail, docomoIcon: null, kddiIcon: FaceAffection.FaceBlowingAKissKddi, softbankIcon: FaceAffection.FaceBlowingAKissSoftbank);
internal static readonly Emoji kissingFace = new Emoji(character: "πŸ˜—", unicode: "U+1F617", group: Resources.smileysAndEmotion, subGroup: Resources.faceAffection, shortName: "", fullName: "kissing face", description: "", appleIcon: FaceAffection.KissingFaceApple, googleIcon: FaceAffection.KissingFaceGoogle, facebookIcon: FaceAffection.KissingFaceFacebook, windowsIcon: FaceAffection.KissingFaceWindows, twitterIcon: FaceAffection.KissingFaceTwitter, joypixelsIcon: FaceAffection.KissingFaceJoyPixels, samsungIcon: FaceAffection.KissingFaceSamsung, gmailIcon: null, docomoIcon: null, kddiIcon: null, softbankIcon: null);
internal static readonly Emoji smilingFace = new Emoji(character: "☺", unicode: "U+263A", group: Resources.smileysAndEmotion, subGroup: Resources.faceAffection, shortName: "", fullName: "smiling face", description: "", appleIcon: FaceAffection.SmilingFaceApple, googleIcon: FaceAffection.SmilingFaceGoogle, facebookIcon: FaceAffection.SmilingFaceFacebook, windowsIcon: FaceAffection.SmilingFaceWindows, twitterIcon: FaceAffection.SmilingFaceTwitter, joypixelsIcon: FaceAffection.SmilingFaceJoyPixels, samsungIcon: FaceAffection.SmilingFaceSamsung, gmailIcon: FaceAffection.SmilingFaceGmail, docomoIcon: null, kddiIcon: FaceAffection.SmilingFaceKddi, softbankIcon: FaceAffection.SmilingFaceSoftbank);
internal static readonly Emoji kissingFaceWithClosedEyes = new Emoji(character: "😚", unicode: "U+1F61A", group: Resources.smileysAndEmotion, subGroup: Resources.faceAffection, shortName: "", fullName: "kissing face with closed eyes", description: "", appleIcon: FaceAffection.KissingFaceWithClosedEyesApple, googleIcon: FaceAffection.KissingFaceWithClosedEyesGoogle, facebookIcon: FaceAffection.KissingFaceWithClosedEyesFacebook, windowsIcon: FaceAffection.KissingFaceWithClosedEyesWindows, twitterIcon: FaceAffection.KissingFaceWithClosedEyesTwitter, joypixelsIcon: FaceAffection.KissingFaceWithClosedEyesJoyPixels, samsungIcon: FaceAffection.KissingFaceWithClosedEyesSamsung, gmailIcon: FaceAffection.KissingFaceWithClosedEyesGmail, docomoIcon: null, kddiIcon: FaceAffection.KissingFaceWithClosedEyesKddi, softbankIcon: FaceAffection.KissingFaceWithClosedEyesSoftbank);
internal static readonly Emoji kissingFaceWithSmilingEyes = new Emoji(character: "πŸ˜™", unicode: "U+1F619", group: Resources.smileysAndEmotion, subGroup: Resources.faceAffection, shortName: "", fullName: "kissing face with smiling eyes", description: "", appleIcon: FaceAffection.KissingFaceWithSmilingEyesApple, googleIcon: FaceAffection.KissingFaceWithSmilingEyesGoogle, facebookIcon: FaceAffection.KissingFaceWithSmilingEyesFacebook, windowsIcon: FaceAffection.KissingFaceWithSmilingEyesWindows, twitterIcon: FaceAffection.KissingFaceWithSmilingEyesTwitter, joypixelsIcon: FaceAffection.KissingFaceWithSmilingEyesJoyPixels, samsungIcon: FaceAffection.KissingFaceWithSmilingEyesSamsung, gmailIcon: null, docomoIcon: null, kddiIcon: null, softbankIcon: null);
internal static readonly Emoji smilingFaceWithTear = new Emoji(character: "πŸ₯²", unicode: "U+1F972", group: Resources.smileysAndEmotion, subGroup: Resources.faceAffection, shortName: "", fullName: "smiling face with tear", description: "", appleIcon: null, googleIcon: FaceAffection.SmilingFaceWithTearGoogle, facebookIcon: null, windowsIcon: null, twitterIcon: FaceAffection.SmilingFaceWithTearTwitter, joypixelsIcon: FaceAffection.SmilingFaceJoyPixels, samsungIcon: null, gmailIcon: null, docomoIcon: null, kddiIcon: null, softbankIcon: null);
}
}
Loading

0 comments on commit 3971ffa

Please sign in to comment.