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
[ContentType( | |
DisplayName = "Fixed Image", | |
GUID = "[YOUR GUID HERE]")] | |
public class FixedImageFileMediaType : ImagePlaceholderMediaType | |
{ | |
[Ignore] | |
public override int Height { get { return 400; } set { throw new NotSupportedException(); } } | |
[Ignore] | |
public override int Width { get { return 400; } set { throw new NotSupportedException(); } } |
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
[ContentType( | |
DisplayName = "Flexible Image", | |
GUID = "[YOUR GUID HERE]")] | |
public class FlexibleImageFileMediaType : ImagePlaceholderMediaType | |
{ | |
[Display(Name = "Height")] | |
[Range(10, 1000)] | |
[Required] | |
public override int Height { 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 IsEditingCommerceRole : VirtualRoleProviderBase | |
{ | |
public const string Name = "IsEditingCommerceRole"; | |
private readonly IContentRepository _contentRepository; | |
public IsEditingCommerceRole() | |
{ | |
this._contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>(); | |
} |
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
[ContentType(GUID = "EEB1904D-AC67-47E6-A825-D4E6464DC64C", | |
DisplayName = "Checkout Page Type", | |
GroupName = "Checkout", | |
Description = "Checkout Page Type")] | |
[Access(Access = AccessLevel.Create, Roles = IsEditingCommerceRole.Name)] | |
public class CheckoutPageType : PageData | |
{ | |
//Properties goes here | |
} |
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
[AdministrationSettings( | |
CodeOnly = true)] | |
[ContentType( | |
GUID = "[GUID]", | |
AvailableInEditMode = true, | |
DisplayName = "Custom Type")] | |
public class CustomContentType : ContentBase, ILocalizable | |
{ | |
//Other properties goes here | |
} |
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
[ModuleDependency(typeof(EPiServer.Web.InitializationModule))] | |
public class CustomContentProviderInitialization : IInitializableModule | |
{ | |
private bool _isInitialized; | |
public void Initialize(InitializationEngine context) | |
{ | |
if (!this._isInitialized) | |
{ | |
var contentProvider = context.Locate.Advanced.GetInstance<CustomContentProvider>(); |
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 CustomContentType : ContentBase, ILocalizable | |
{ | |
//Other properties goes here | |
public virtual CultureInfo Language { get; set; } | |
public IEnumerable<CultureInfo> ExistingLanguages { get; set; } | |
public CultureInfo MasterLanguage { 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
class JobNotificationManager : IJobNotificationManager | |
{ | |
public bool TryGet(ScheduledJob job, bool success, string message, out INotification notification) | |
{ | |
notification = default(INotification); | |
if (success) | |
return false; | |
notification = new Notification() |
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 interface IJobNotificationManager | |
{ | |
bool TryGet(ScheduledJob job, bool success, string message, out INotification notification); | |
} |
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
[InitializableModule] | |
[ModuleDependency(typeof(EPiServer.Commerce.Initialization.InitializationModule))] | |
public class CommerceDependencyResolverInitialization : IConfigurableModule | |
{ | |
public void ConfigureContainer(ServiceConfigurationContext context) | |
{ | |
context.Container.Configure(ConfigureContainer); | |
} | |
private static void ConfigureContainer(ConfigurationExpression container) |