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.Linq; | |
| using Epi9Site.PageMoveApproval.Models; | |
| using EPiServer; | |
| using EPiServer.Core; | |
| using EPiServer.DataAccess; | |
| using EPiServer.Framework; | |
| using EPiServer.Framework.Initialization; | |
| using EPiServer.Framework.Localization; | |
| using EPiServer.Security; |
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
| .epi-forms-icon.epi-forms-constrainedtextboxelementblock__icon { | |
| background-image: url(constrainedtextboxelementblock16x16.png); | |
| } |
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.Web.InitializationModule))] | |
| public class AddTimeStampToImages : IInitializableModule | |
| { | |
| public void Initialize(InitializationEngine context) | |
| { | |
| ContentRoute.CreatedVirtualPath += CreatedVirtualPath; | |
| } | |
| private void CreatedVirtualPath(object sender, UrlBuilderEventArgs urlBuilderEventArgs) |
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.Linq; | |
| using EPiServer.Core; | |
| using EPiServer.Framework; | |
| using EPiServer.Framework.Initialization; | |
| using EPiServer.Framework.Localization; | |
| using EPiServer.ServiceLocation; | |
| using InitializationModule = EPiServer.Web.InitializationModule; | |
| namespace EPiServer.Templates.Alloy.ValidateItemsInFolder | |
| { |
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
| /// <summary> | |
| /// Removing items from a project | |
| /// </summary> | |
| /// <param name="repo">The ProjectRepository instance</param> | |
| /// <param name="projectItem">The project item(s) to remove</param> | |
| public void RemoveItemsFromProject(ProjectRepository repo, IList<ProjectItem> projectItem) | |
| { | |
| repo.DeleteItems(projectItem.Select(x => x.ID)); | |
| } |
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
| /// <summary> | |
| /// Add items to a project | |
| /// </summary> | |
| /// <param name="repo">The ProjectRepository instance</param> | |
| /// <param name="project">The project to save the items against</param> | |
| /// <param name="contentReferences">A list of ContentReferences to add to the project. *Note!* the item to add should be the draft version number, not the current published version number</param> | |
| /// <returns>A list of the saved project items</returns> | |
| public IList<ProjectItem> AddItemsToProject(ProjectRepository repo, Project project, | |
| IList<ContentReference> contentReferences) | |
| { |
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
| /// <summary> | |
| /// Create a project programmatically | |
| /// </summary> | |
| /// <param name="projectName">The name of the project, e.g. "Weekly article updates"</param> | |
| /// <param name="userName">The username of the person creating the project</param> | |
| /// <returns>The newly created project, null if a project with that name already exists</returns> | |
| public Project CreateNewProject(string projectName, string userName) | |
| { | |
| var repo = ServiceLocator.Current.GetInstance<ProjectRepository>(); | |
| var newProject = new Project(); |
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(ServiceContainerInitialization))] | |
| public class OverrideIDatabaseFactoryImpl : IConfigurableModule | |
| { | |
| public void ConfigureContainer(ServiceConfigurationContext context) | |
| { | |
| context.Container.Configure(x => { x.For<IDatabaseFactory>().Use<CustomIDatabaseFactory>(); }); | |
| } | |
| public void Initialize(InitializationEngine context) { } |
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 CustomIDatabaseFactory : SqlDatabaseFactory, IDatabaseFactory | |
| { | |
| public new IDatabaseHandler CreateDefaultHandler() | |
| { | |
| SiteDataSettingsElement currentSiteSettings = this.GetCurrentSiteSettings(); | |
| ConnectionStringSettings connectionStringSettings = EPiServerDataStoreSection.ConfigurationInstance.ConnectionStrings.ConnectionStrings[currentSiteSettings.ConnectionStringName]; | |
| if (connectionStringSettings == null) | |
| { | |
| throw new ConfigurationErrorsException(string.Format(CultureInfo.InvariantCulture, "No connection string found with the configured name '{0}'.", new object[] { currentSiteSettings.ConnectionStringName })); | |
| } |
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 DebugAwareContentOutputCacheAttribute : ContentOutputCacheAttribute | |
| { | |
| public override bool Disable | |
| { | |
| get | |
| { | |
| if (System.Diagnostics.Debugger.IsAttached) | |
| { | |
| return true; | |
| } |