Adding Fields dynamic accessibility in the model

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2011-03-25 11:06:13 -07:00
parent 67cd1671c8
commit a84ee52105
2 changed files with 12 additions and 6 deletions

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Web;
using System.IO;
using System.Web.Mvc;
using Orchard.FileSystems.WebSite;
using Orchard.Localization;

View File

@@ -126,11 +126,21 @@ namespace Orchard.DesignerTools.Services {
}
continue;
}
// process ContentPart.Fields specifically
if (o is ContentPart && member.Name == "Fields") {
foreach (var field in ((ContentPart)o).Fields) {
Dump(field, field.Name);
}
continue;
}
try {
DumpMember(o, member);
}
catch {
// ignore members which can't be rendered
}
}
@@ -244,7 +254,7 @@ namespace Orchard.DesignerTools.Services {
var genericArguments = String.Join(", ", type.GetGenericArguments().Select(t => FormatType((Type)t)).ToArray());
return String.Format("{0}<{1}>", type.Name.Substring(0, type.Name.IndexOf('`')), genericArguments);
}
return type.Name;
}
}