//----------------------------------------------------------------------- // // Copyright (c) Dominick Baier, Andrew Arnott. All rights reserved. // // New BSD License //----------------------------------------------------------------------- // embedded images [assembly: System.Web.UI.WebResource(DotNetOpenAuth.Util.DefaultNamespace + ".InfoCard.infocard_114x80.png", "image/png")] [assembly: System.Web.UI.WebResource(DotNetOpenAuth.Util.DefaultNamespace + ".InfoCard.infocard_14x10.png", "image/png")] [assembly: System.Web.UI.WebResource(DotNetOpenAuth.Util.DefaultNamespace + ".InfoCard.infocard_214x150.png", "image/png")] [assembly: System.Web.UI.WebResource(DotNetOpenAuth.Util.DefaultNamespace + ".InfoCard.infocard_23x16.png", "image/png")] [assembly: System.Web.UI.WebResource(DotNetOpenAuth.Util.DefaultNamespace + ".InfoCard.infocard_300x210.png", "image/png")] [assembly: System.Web.UI.WebResource(DotNetOpenAuth.Util.DefaultNamespace + ".InfoCard.infocard_34x24.png", "image/png")] [assembly: System.Web.UI.WebResource(DotNetOpenAuth.Util.DefaultNamespace + ".InfoCard.infocard_365x256.png", "image/png")] [assembly: System.Web.UI.WebResource(DotNetOpenAuth.Util.DefaultNamespace + ".InfoCard.infocard_41x29.png", "image/png")] [assembly: System.Web.UI.WebResource(DotNetOpenAuth.Util.DefaultNamespace + ".InfoCard.infocard_50x35.png", "image/png")] [assembly: System.Web.UI.WebResource(DotNetOpenAuth.Util.DefaultNamespace + ".InfoCard.infocard_60x42.png", "image/png")] [assembly: System.Web.UI.WebResource(DotNetOpenAuth.Util.DefaultNamespace + ".InfoCard.infocard_71x50.png", "image/png")] [assembly: System.Web.UI.WebResource(DotNetOpenAuth.Util.DefaultNamespace + ".InfoCard.infocard_81x57.png", "image/png")] [assembly: System.Web.UI.WebResource(DotNetOpenAuth.Util.DefaultNamespace + ".InfoCard.infocard_92x64.png", "image/png")] namespace DotNetOpenAuth.InfoCard { using System; using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; using System.Globalization; /// /// A set of sizes for which standard InfoCard icons are available. /// public enum InfoCardImageSize { /// /// A standard InfoCard icon with size 14x10 /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x", Justification = "By design")] Size14x10, /// /// A standard InfoCard icon with size 23x16 /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x", Justification = "By design")] Size23x16, /// /// A standard InfoCard icon with size 34x24 /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x", Justification = "By design")] Size34x24, /// /// A standard InfoCard icon with size 41x29 /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x", Justification = "By design")] Size41x29, /// /// A standard InfoCard icon with size 50x35 /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x", Justification = "By design")] Size50x35, /// /// A standard InfoCard icon with size 60x42 /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x", Justification = "By design")] Size60x42, /// /// A standard InfoCard icon with size 71x50 /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x", Justification = "By design")] Size71x50, /// /// A standard InfoCard icon with size 92x64 /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x", Justification = "By design")] Size92x64, /// /// A standard InfoCard icon with size 114x80 /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x", Justification = "By design")] Size114x80, /// /// A standard InfoCard icon with size 164x108 /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x", Justification = "By design")] Size164x108, /// /// A standard InfoCard icon with size 214x50 /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x", Justification = "By design")] Size214x50, /// /// A standard InfoCard icon with size 300x210 /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x", Justification = "By design")] Size300x210, /// /// A standard InfoCard icon with size 365x256 /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x", Justification = "By design")] Size365x256, } /// /// Assists in selecting the InfoCard image to display in the user agent. /// internal static class InfoCardImage { /// /// The default size of the InfoCard icon to use. /// internal const InfoCardImageSize DefaultImageSize = InfoCardImageSize.Size114x80; /// /// The format to use when generating the image manifest resource stream name. /// private const string UrlFormatString = Util.DefaultNamespace + ".InfoCard.infocard_{0}.png"; /// /// Gets the name of the image manifest resource stream for an InfoCard image of the given size. /// /// The size of the desired InfoCard image. /// The manifest resource stream name. internal static string GetImageManifestResourceStreamName(InfoCardImageSize size) { string imageSize = size.ToString(); Contract.Assume(imageSize.Length >= 6); imageSize = imageSize.Substring(4); return String.Format(CultureInfo.InvariantCulture, UrlFormatString, imageSize); } } }