Skip to content

Instantly share code, notes, and snippets.

@robgha01
robgha01 / DocumentTypeRouteConstraint.cs
Created January 14, 2017 13:12
Umbraco 7 Custom route with UmbracoVirtualNodeRouteHandler
public class DocumentTypeRouteConstraint : IRouteConstraint
{
private readonly MatchFunc match;
public DocumentTypeRouteConstraint(string documentTypeAlias, MatchFunc match = null)
{
this.match = match;
DocumentTypeAlias = documentTypeAlias;
}
@robgha01
robgha01 / FileUploadApiController.cs
Created February 6, 2017 14:11 — forked from cssquirrel/FileUploadApiController.cs
Using AngularJS API service and Umbraco API controller to permit users to upload files to the server
// Use whatever namespacing works for your project.
namespace YourSite.Web.Controllers.Api
{
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
@robgha01
robgha01 / ContentExtensions.cs
Created February 11, 2017 15:06 — forked from jbreuer/ContentExtensions.cs
An extension method to convert an IContent to an IPublishedContent.
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ContentExtensions.cs" company="Colours B.V.">
// © Colours B.V. 2015
// </copyright>
// <summary>
// The content extensions.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Project.Web.Core.Extensions
<template #DefaultTemplate>
<inline-editor-group [openInModal]="true" (onSave)="this.doSave()" (onCancel)="this.doCancel()" [(disableSave)]="this?.profileForm.invalid || !this?.profileForm.dirty">
<form class="form-horizontal" [formGroup]="profileForm">
<inline-text-editor formControlName="name" [focusThis]="true" type="text" name="Namn">
<presentation-state>
<template let-editor>
<div>
<i class="fa fa-user" aria-hidden="true"></i> namn
</div>
<p>{{ editor?.value }}</p>
Preparing to run build script...
Running build script...
Module directory does not exist.
Analyzing build script...
Analyzing D:/Workspaces/BlueLeet/Websites/ReproProject/Build/ReproProject.UI.cake...
Processing build script...
Creating script session...
Using prerelease build of Roslyn.
Adding reference to mscorlib.dll...
Adding reference to System.Core.dll...
@robgha01
robgha01 / AssemblyInfo.cs
Last active October 1, 2019 09:26
Cake AssemblyInfo Code
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Cake.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Reflection;
using System.Runtime.InteropServices;
using System;
using BlueLeet.Core.Attributes;