using System; using System.Collections.Generic; using System.Linq; using System.Web; using Microsoft.WindowsAzure.ServiceRuntime; using System.Configuration; namespace HeuristicLab.Services.Optimization.Web.Helpers { public static class BillingComponent { public static bool Enabled { get { try { if (RoleEnvironment.IsAvailable) { return Convert.ToBoolean(RoleEnvironment.GetConfigurationSettingValue("BillingEnabled")); } else { return Convert.ToBoolean(ConfigurationManager.AppSettings["BillingEnabled"]); } } catch (Exception) { // simply disallow billing component if not set return false; } } } } }