This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Umbraco.Web; | |
using Umbraco.Web.WebApi; | |
namespace Olympic.Web.Controllers.Api | |
{ | |
public class DictionaryController : UmbracoApiController | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model TextOverImage.Models.ImageWithText | |
@{ | |
// Use this code to render this partial in your template. Replace "banner" with whatever your property name is | |
// Make sure to include @using TextOverImage.Models at the top of your template | |
//@if(Model.Content.HasProperty("banner") && Model.Content.HasValue("banner")) | |
//{ | |
// @Html.Partial("TextOverImagePartial", Model.Content.GetPropertyValue<ImageWithText>("banner") | |
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@helper RenderFolders(string dirPath, bool displaySubDirs = false) | |
{ | |
try | |
{ | |
List<string> dirs = new List<string>(Directory.EnumerateDirectories(dirPath)); | |
<h4>@string.Format("Directory: {0}", dirPath.Substring(dirPath.LastIndexOf("\\") + 1))</h4> | |
<p>@(string.Format("{0} directories found.", dirs.Count))</p> | |
<ul> | |
@foreach (var dir in dirs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Helpers = { | |
/** | |
* @function formatMoney | |
* @param {number} n - The number to be formatted | |
* @param {string} d - The character to be used for the decimal. Defaults to ".". | |
* @param {string} t - the character to be used for the thousands separator. Defaults to ",". | |
* @param {int} c - the number of decimal places. Defaults to 2. | |
* @returns {string} | |
* @description Formats a number to a price | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CacheService : ICacheService | |
{ | |
private readonly MemoryCache _memoryCache = new MemoryCache("Cache.Key"); | |
public void Add<T>(T cacheObject, string key) | |
{ | |
var cacheItemPolicy = new CacheItemPolicy | |
{ | |
AbsoluteExpiration = DateTimeOffset.Now.AddHours(24) | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Client.Web | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
using Models; | |
using Newtonsoft.Json; | |
using Umbraco.Core.Models; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web.Mvc; | |
using Umbraco.Core.Models; | |
using Umbraco.Web; | |
namespace Forms.Web.Models | |
{ | |
public class ContactForm | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Umbraco.Core.Models; | |
@{ | |
var mediaService = ApplicationContext.Current.Services.MediaService; | |
SaveMedias(mediaService.GetRootMedia().ToList()); | |
} | |
@functions | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Client.Web.Models | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Buzz.Hybrid; | |
using Buzz.Hybrid.Models; |