mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Adding more overloads for getting/setting infoset fields
--HG-- branch : 1.x
This commit is contained in:
parent
a27fc43e74
commit
aa1d0ec590
@ -11,6 +11,19 @@ namespace Orchard.ContentManagement.FieldStorage.InfosetStorage {
|
||||
public Infoset Infoset { get; set; }
|
||||
public Infoset VersionInfoset { get; set; }
|
||||
|
||||
|
||||
public string Get<TPart>(string fieldName) {
|
||||
return Get<TPart>(fieldName, null);
|
||||
}
|
||||
|
||||
public string Get<TPart>(string fieldName, string valueName) {
|
||||
return Get(typeof(TPart).Name, fieldName, valueName);
|
||||
}
|
||||
|
||||
public string Get(string partName, string fieldName) {
|
||||
return Get(partName, fieldName, null);
|
||||
}
|
||||
|
||||
public string Get(string partName, string fieldName, string valueName) {
|
||||
var partElement = Infoset.Element.Element(partName);
|
||||
if (partElement == null) {
|
||||
@ -30,6 +43,18 @@ namespace Orchard.ContentManagement.FieldStorage.InfosetStorage {
|
||||
return valueAttribute.Value;
|
||||
}
|
||||
|
||||
public void Set<TPart>(string fieldName, string valueName, string value) {
|
||||
Set<TPart>(fieldName, value);
|
||||
}
|
||||
|
||||
public void Set<TPart>(string fieldName, string value) {
|
||||
Set(typeof(TPart).Name, fieldName, null, value);
|
||||
}
|
||||
|
||||
public void Set(string partName, string fieldName, string value) {
|
||||
Set(partName, fieldName, null, value);
|
||||
}
|
||||
|
||||
public void Set(string partName, string fieldName, string valueName, string value) {
|
||||
var partElement = Infoset.Element.Element(partName);
|
||||
if (partElement == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user