This file contains hidden or 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 Ditto.Resolvers.Sample.Models.DocTypes | |
{ | |
public class Home : Page | |
{ | |
public Home(IPublishedContent content) : base(content) | |
{ | |
} | |
public string Title { get; set; } |
This file contains hidden or 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
/* Generating a proxy of a Type and overriding a virtual property with this method blows up in IIs Express, but works fine in unit tests (nunit, resharper) and | |
local IIS. This is using VS Community 2013 on Windows 8 */ | |
public override T OverrideProperty<T>(string propertyName, Type attribute = null, Type [] constructorParams = null, object [] constructorValues = null) | |
{ | |
// [ML] - Default to an empty instance | |
constructorParams = constructorParams ?? Type.EmptyTypes; | |
constructorValues = constructorValues ?? new object[] { null }; |
This file contains hidden or 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
/* Overriding makes sense when you look at the generated IL for overriden fields =) */ | |
public override T OverrideProperty<T>(string propertyName, Type attribute = null, Type [] constructorParams = null, object [] constructorValues = null) | |
{ | |
// [ML] - Default to an empty instance | |
constructorParams = constructorParams ?? Type.EmptyTypes; | |
constructorValues = constructorValues ?? new object[] { null }; | |
var type = typeof(T); |
This file contains hidden or 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 TextPage : Page | |
{ | |
public TextPage(IPublishedContent content) : base(content) | |
{ | |
} | |
public string Title { get; set; } | |
public HtmlString Body { get; set; } |
This file contains hidden or 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
[GridResolver("someOtherAlias")] | |
public GridModel Grid { get; set; } |
This file contains hidden or 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 Control | |
{ | |
public object value { get; set; } | |
public virtual object ConvertedValue { get; set; } | |
public Editor editor { get; set; } | |
} | |
public class Editor |
This file contains hidden or 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
protected override void OnApplicationStarting(object sender, EventArgs e) | |
{ | |
... | |
DittoResolverTypeLocator.Register<DittoHtmlStringConverter>("rte"); | |
DittoResolverTypeLocator.Register<DittoHtmlStringConverter>("embed"); | |
DittoResolverTypeLocator.Register<GridImageConverter>("media"); | |
} |
This file contains hidden or 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.Drawing; | |
using System.Drawing.Imaging; | |
using System.IO; | |
using System.Linq; | |
using System.Threading; | |
using System.Windows.Forms; | |
namespace ScreenGrab.Core.Helpers | |
{ |
This file contains hidden or 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
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION | |
Value Key: DWORD - YourApplication.exe |
This file contains hidden or 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.Drawing.Imaging; | |
using System.IO; | |
using System.Text.RegularExpressions; | |
using System.Web.Mvc; | |
using ScreenGrab.Core.Helpers; | |
namespace ScreenGrab.UI.Controllers | |
{ | |
public class HomeController : Controller |