mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Renaming that which cannot be renamed
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4044815
This commit is contained in:
6
src/Orchard.Tests/ContentManagement/Models/Alpha.cs
Normal file
6
src/Orchard.Tests/ContentManagement/Models/Alpha.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using Orchard.ContentManagement;
|
||||
|
||||
namespace Orchard.Tests.ContentManagement.Models {
|
||||
public class Alpha : ContentPart {
|
||||
}
|
||||
}
|
20
src/Orchard.Tests/ContentManagement/Models/AlphaHandler.cs
Normal file
20
src/Orchard.Tests/ContentManagement/Models/AlphaHandler.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.ContentManagement.ViewModels;
|
||||
|
||||
namespace Orchard.Tests.ContentManagement.Models {
|
||||
public class AlphaHandler : ContentHandler {
|
||||
public AlphaHandler() {
|
||||
OnGetDisplayViewModel<Alpha>((ctx, part) => ctx.AddDisplay(new TemplateViewModel(part) { Position = "3" }));
|
||||
}
|
||||
public override IEnumerable<ContentType> GetContentTypes() {
|
||||
return new[] { new ContentType { Name = "alpha" } };
|
||||
}
|
||||
protected override void Activating(ActivatingContentContext context) {
|
||||
if (context.ContentType == "alpha") {
|
||||
context.Builder.Weld<Alpha>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
6
src/Orchard.Tests/ContentManagement/Models/Beta.cs
Normal file
6
src/Orchard.Tests/ContentManagement/Models/Beta.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using Orchard.ContentManagement;
|
||||
|
||||
namespace Orchard.Tests.ContentManagement.Models {
|
||||
public class Beta : ContentPart {
|
||||
}
|
||||
}
|
20
src/Orchard.Tests/ContentManagement/Models/BetaHandler.cs
Normal file
20
src/Orchard.Tests/ContentManagement/Models/BetaHandler.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
|
||||
namespace Orchard.Tests.ContentManagement.Models {
|
||||
public class BetaHandler : ContentHandler {
|
||||
public override System.Collections.Generic.IEnumerable<Orchard.ContentManagement.ContentType> GetContentTypes() {
|
||||
return new[] { new ContentType { Name = "beta" } };
|
||||
}
|
||||
|
||||
protected override void Activating(ActivatingContentContext context) {
|
||||
if (context.ContentType == "beta") {
|
||||
context.Builder.Weld<Beta>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
25
src/Orchard.Tests/ContentManagement/Models/Delta.cs
Normal file
25
src/Orchard.Tests/ContentManagement/Models/Delta.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Orchard.Data;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Tests.ContentManagement.Records;
|
||||
|
||||
namespace Orchard.Tests.ContentManagement.Models {
|
||||
public class Delta : ContentPart<DeltaRecord> {
|
||||
}
|
||||
|
||||
|
||||
public class DeltaHandler : ContentHandler {
|
||||
public override System.Collections.Generic.IEnumerable<Orchard.ContentManagement.ContentType> GetContentTypes() {
|
||||
return new[] { new ContentType { Name = "delta" } };
|
||||
}
|
||||
|
||||
public DeltaHandler(IRepository<DeltaRecord> repository) {
|
||||
Filters.Add(new ActivatingFilter<Delta>(x => x == "delta"));
|
||||
Filters.Add(new StorageFilter<DeltaRecord>(repository));
|
||||
}
|
||||
}
|
||||
}
|
23
src/Orchard.Tests/ContentManagement/Models/Epsilon.cs
Normal file
23
src/Orchard.Tests/ContentManagement/Models/Epsilon.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Data;
|
||||
using Orchard.Tests.ContentManagement.Records;
|
||||
|
||||
namespace Orchard.Tests.ContentManagement.Models {
|
||||
|
||||
|
||||
public class Epsilon : ContentPart<EpsilonRecord> {
|
||||
}
|
||||
|
||||
public class EpsilonHandler : ContentHandler {
|
||||
|
||||
public EpsilonHandler(IRepository<EpsilonRecord> repository) {
|
||||
Filters.Add(new ActivatingFilter<Epsilon>(x => x == "gamma"));
|
||||
Filters.Add(new StorageVersionFilter<EpsilonRecord>(repository));
|
||||
}
|
||||
}
|
||||
}
|
10
src/Orchard.Tests/ContentManagement/Models/Flavored.cs
Normal file
10
src/Orchard.Tests/ContentManagement/Models/Flavored.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Orchard.ContentManagement;
|
||||
|
||||
namespace Orchard.Tests.ContentManagement.Models {
|
||||
class Flavored : ContentPart {
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.ContentManagement.ViewModels;
|
||||
|
||||
namespace Orchard.Tests.ContentManagement.Models {
|
||||
public class FlavoredHandler : ContentHandler {
|
||||
public FlavoredHandler() {
|
||||
OnGetDisplayViewModel<Flavored>((ctx, part) => ctx.AddDisplay(new TemplateViewModel(part)));
|
||||
}
|
||||
protected override void Activating(ActivatingContentContext context) {
|
||||
if (context.ContentType == "beta" || context.ContentType == "alpha") {
|
||||
context.Builder.Weld<Flavored>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
23
src/Orchard.Tests/ContentManagement/Models/Gamma.cs
Normal file
23
src/Orchard.Tests/ContentManagement/Models/Gamma.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Orchard.Data;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Tests.ContentManagement.Records;
|
||||
|
||||
namespace Orchard.Tests.ContentManagement.Models {
|
||||
public class Gamma : ContentPart<GammaRecord> {
|
||||
}
|
||||
|
||||
|
||||
public class GammaHandler : ContentHandler {
|
||||
public override System.Collections.Generic.IEnumerable<ContentType> GetContentTypes() {
|
||||
return new[] { new ContentType { Name = "gamma" } };
|
||||
}
|
||||
|
||||
public GammaHandler(IRepository<GammaRecord> repository) {
|
||||
Filters.Add(new ActivatingFilter<Gamma>(x => x == "gamma"));
|
||||
Filters.Add(new StorageFilter<GammaRecord>(repository));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
10
src/Orchard.Tests/ContentManagement/Models/Styled.cs
Normal file
10
src/Orchard.Tests/ContentManagement/Models/Styled.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Orchard.ContentManagement;
|
||||
|
||||
namespace Orchard.Tests.ContentManagement.Models {
|
||||
public class Styled : ContentPart {
|
||||
}
|
||||
}
|
16
src/Orchard.Tests/ContentManagement/Models/StyledHandler.cs
Normal file
16
src/Orchard.Tests/ContentManagement/Models/StyledHandler.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.ContentManagement.ViewModels;
|
||||
|
||||
namespace Orchard.Tests.ContentManagement.Models {
|
||||
public class StyledHandler : ContentHandler {
|
||||
public StyledHandler() {
|
||||
OnGetDisplayViewModel<Styled>((ctx, part) => ctx.AddDisplay(new TemplateViewModel(part) { Position = "10" }));
|
||||
}
|
||||
|
||||
protected override void Activating(ActivatingContentContext context) {
|
||||
if (context.ContentType == "alpha") {
|
||||
context.Builder.Weld<Styled>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user