Skip to content

Instantly share code, notes, and snippets.

protected async Task<PurchaseResult> WasItemPurchased(string productId, ItemType type)
{
var billing = CrossInAppBilling.Current;
try
{
var connected = await billing.ConnectAsync(type);
if (!connected)
{
@mikeedwards83
mikeedwards83 / 068043B1-1111-4A8C-ADB2-F7EEAF53872B.xml
Created October 11, 2018 12:07
068043B1-1111-4A8C-ADB2-F7EEAF53872B
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<glassMapper.getGlassLoaders>
<processor type="MyProject.Feature.FeatureGlassLoader , MyProject.Feature" />
</glassMapper.getGlassLoaders>
</pipelines>
</sitecore>
</configuration>
public class Demo
{
public virtual Guid Id { get; set; }
public virtual string Title { get; set; }
public virtual DateTime Date { get; set; }
public virtual string Url { get; set; }
}
public class CodeQuiz1
{
public virtual IEnumerable<CodeQuiz1> Children { get; set; }
public virtual string Title { get; set; }
public virtual ParentModel Parent { get; set; }
public string Name { get; }
var options = new GetItemByPathOptions
{
Path = "/sitecore/content/home"
};
var model = sitecoreService.GetItem(options);
<div>
@Html.Sitecore().Placeholder("main");
</div>
@mikeedwards83
mikeedwards83 / Example.cs
Last active August 5, 2016 13:25
Inheritance + Composition
public void DoWork()
{
var service = new SitecoreService("master");
var model = service.GetItem<ITitles>("/sitecore/content/home/page", InferType:true);
var title = model.Titles.Title;
if (model is Page)
public class PageContentItemsService
{
public readonly ID PageContentItemFolder =
new ID(ItemTree.Templates.Site.PageContentItems.Id);
public bool IsPageContentItemsFolder(Item item)
{
return item.TemplateID == PageContentItemFolder;
}
public class PageContentItemsView : BucketDataView
{
public const string HomePath = "/sitecore/content/MySite3/Home";
private const string XmlControlKey = "xmlcontrol";
private const string SelectRenderingDatasource = "Sitecore.Shell.Applications.Dialogs.SelectRenderingDatasource";
protected PageContentItemsService ContentItemService
{
get; set;
public class Glass1
{
public virtual string Title { get; set; }
}
[TemplateMapping("{76036F5E-CBCE-46D1-AF0A-4143F9B557AA}", "InterfaceMap")]
public partial interface IFortis1 : IItemWrapper
{
ITextFieldWrapper Title { get; }
}