yavsc/web/Helpers/ThanksHelper.cs
Paul Schneider ccc3b2ffff * Web.csproj:
* ThanksHelper.cs:
* YavscHelpers.cs:
* Period.cs:
* YaEvent.cs:
* OpenDay.cs:
* WeekDay.cs:
* Schedule.cs:
* Position.cs:
* EventPub.cs:
* Periodicity.cs:
* ProvidedEvent.cs:
* CalendarController.cs:
* FrontOfficeController.cs:
* PositionAndKeyphrase.cs:
* ProviderPublicInfo.cs: refactoring

* PaypalApiController.cs: adds a package reference to payPal buttons

* T.cs: xml doc

* App.master: yet another thanks giving

* style.css: Yet another impact on style sheet

* Web.config: adds a circle provider section

* packages.config: Adds PayPal Button manager package reference
2015-06-26 13:56:39 +02:00

60 lines
1.6 KiB
C#

using System;
using System.Configuration;
using System.Collections.Generic;
using System.Web.Mvc;
namespace Yavsc.Helpers
{
/// <summary>
/// Link.
/// </summary>
public class Link {
/// <summary>
/// Gets or sets the text.
/// </summary>
/// <value>The text.</value>
public string Text { get; set; }
/// <summary>
/// Gets or sets the URL.
/// </summary>
/// <value>The URL.</value>
public string Url { get; set; }
/// <summary>
/// Gets or sets the image.
/// </summary>
/// <value>The image.</value>
public string Image { get; set; }
}
/// <summary>
/// Thanks helper.
/// </summary>
public static class ThanksHelper {
static private ThanksConfigurationSection configurationSection=null;
/// <summary>
/// Gets the configuration section.
/// </summary>
/// <value>The configuration section.</value>
static public ThanksConfigurationSection ConfigurationSection {
get {
if (configurationSection==null)
configurationSection = (ThanksConfigurationSection) ConfigurationManager.GetSection ("system.web/thanks");
return configurationSection;
}
}
/// <summary>
/// Html code for each entry
/// </summary>
public static Link[] Thanks (this HtmlHelper helper)
{
List<Link> result = new List<Link>() ;
if (ConfigurationSection == null) return result.ToArray();
if (ConfigurationSection.To == null) return result.ToArray();
foreach (ThanksConfigurationElement e in ConfigurationSection.To)
result.Add( new Link { Url = e.Url, Image=e.Image, Text = e.Name });
return result.ToArray();
}
}
}