Removing unused material from Orchard.dll project folder

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4044418
This commit is contained in:
loudej
2009-12-21 22:54:01 +00:00
parent 75984135a9
commit 7d4bd5f47e
6 changed files with 0 additions and 213 deletions

View File

@@ -147,9 +147,6 @@
<Content Include="Themes\Views\menu.ascx" /> <Content Include="Themes\Views\menu.ascx" />
<Content Include="Themes\Views\Web.config" /> <Content Include="Themes\Views\Web.config" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Themes\Views\Shared\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -1,8 +0,0 @@
using Orchard.Localization;
namespace Orchard.ContentManagement.Handlers {
public interface IUpdateModel {
bool TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) where TModel : class;
void AddModelError(string key, LocalizedString errorMessage);
}
}

View File

@@ -1,9 +0,0 @@
using System.Web.Routing;
namespace Orchard.ContentManagement {
//public interface IContentDisplayInfo : IContent {
// string DisplayText { get; }
// RouteValueDictionary DisplayRouteValues();
// RouteValueDictionary EditRouteValues();
//}
}

View File

@@ -1,177 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using Orchard.ContentManagement.Handlers;
using Orchard.ContentManagement.ViewModels;
using Orchard.Logging;
namespace Orchard.ContentManagement {
public interface IPartDriver : IEvents {
DriverResult BuildDisplayModel(BuildDisplayModelContext context);
DriverResult BuildEditorModel(BuildEditorModelContext context);
DriverResult UpdateEditorModel(UpdateEditorModelContext context);
}
public abstract class PartDriver<TPart> : IPartDriver where TPart : class, IContent {
DriverResult IPartDriver.BuildDisplayModel(BuildDisplayModelContext context) {
var part = context.ContentItem.As<TPart>();
return part == null ? null : Display(part, context.DisplayType);
}
DriverResult IPartDriver.BuildEditorModel(BuildEditorModelContext context) {
var part = context.ContentItem.As<TPart>();
return part == null ? null : Editor(part);
}
DriverResult IPartDriver.UpdateEditorModel(UpdateEditorModelContext context) {
var part = context.ContentItem.As<TPart>();
return part == null ? null : Editor(part, context.Updater);
}
protected virtual DriverResult Display(TPart part, string displayType) {
return null;
}
protected virtual DriverResult Editor(TPart part) {
return null;
}
protected virtual DriverResult Editor(TPart part, IUpdateModel updater) {
return null;
}
protected virtual string Prefix { get { return ""; } }
protected virtual string Zone { get { return "body"; } }
public TemplateResult PartialView(object model) {
return new TemplateResult(model, null, Prefix).Location(Zone);
}
public TemplateResult PartialView(object model, string template) {
return new TemplateResult(model, template, Prefix).Location(Zone);
}
public TemplateResult PartialView(object model, string template, string prefix) {
return new TemplateResult(model, template, prefix).Location(Zone);
}
}
public abstract class AutomaticPartDriver<TPart> : PartDriver<TPart> where TPart : class, IContent {
protected override string Prefix {
get {
return (typeof (TPart).Name);
}
}
protected override DriverResult Display(TPart part, string displayType) {
return PartialView(part);
}
protected override DriverResult Editor(TPart part) {
return PartialView(part);
}
protected override DriverResult Editor(TPart part, IUpdateModel updater) {
updater.TryUpdateModel(part, Prefix, null, null);
return PartialView(part);
}
}
public class DriverResult {
public virtual void Apply(BuildDisplayModelContext context) { }
public virtual void Apply(BuildEditorModelContext context) { }
}
public class TemplateResult : DriverResult {
public object Model { get; set; }
public string TemplateName { get; set; }
public string Prefix { get; set; }
public string Zone { get; set; }
public string Position { get; set; }
public TemplateResult(object model, string templateName, string prefix) {
Model = model;
TemplateName = templateName;
Prefix = prefix;
}
public override void Apply(BuildDisplayModelContext context) {
context.AddDisplay(new TemplateViewModel(Model, Prefix) {
TemplateName = TemplateName,
ZoneName = Zone,
Position = Position
});
}
public override void Apply(BuildEditorModelContext context) {
context.AddEditor(new TemplateViewModel(Model, Prefix) {
TemplateName = TemplateName,
ZoneName = Zone,
Position = Position
});
}
public TemplateResult Location(string zone) {
Zone = zone;
return this;
}
public TemplateResult Location(string zone, string position) {
Zone = zone;
Position = position;
return this;
}
}
[UsedImplicitly]
public class PartDriverHandler : IContentHandler {
private readonly IEnumerable<IPartDriver> _drivers;
public PartDriverHandler(IEnumerable<IPartDriver> drivers) {
_drivers = drivers;
Logger = NullLogger.Instance;
}
public ILogger Logger { get; set; }
System.Collections.Generic.IEnumerable<ContentType> IContentHandler.GetContentTypes() {
return Enumerable.Empty<ContentType>();
}
void IContentHandler.Activating(ActivatingContentContext context) { }
void IContentHandler.Activated(ActivatedContentContext context) { }
void IContentHandler.Creating(CreateContentContext context) { }
void IContentHandler.Created(CreateContentContext context) { }
void IContentHandler.Loading(LoadContentContext context) { }
void IContentHandler.Loaded(LoadContentContext context) { }
void IContentHandler.GetItemMetadata(GetItemMetadataContext context) { }
void IContentHandler.BuildDisplayModel(BuildDisplayModelContext context) {
_drivers.Invoke(driver => {
var result = driver.BuildDisplayModel(context);
if (result != null)
result.Apply(context);
}, Logger);
}
void IContentHandler.BuildEditorModel(BuildEditorModelContext context) {
_drivers.Invoke(driver => {
var result = driver.BuildEditorModel(context);
if (result != null)
result.Apply(context);
}, Logger);
}
void IContentHandler.UpdateEditorModel(UpdateEditorModelContext context) {
_drivers.Invoke(driver => {
var result = driver.UpdateEditorModel(context);
if (result != null)
result.Apply(context);
}, Logger);
}
}
}

View File

@@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Orchard.Data {
public interface IDataManager {
}
public class DataManager : IDataManager {
}
}

View File

@@ -303,9 +303,6 @@
<ItemGroup> <ItemGroup>
<None Include="ContentManagement\Diagram.cd" /> <None Include="ContentManagement\Diagram.cd" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="UI\Models\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.