Skip to content

Commit ca0383f

Browse files
committed
Introduced new "MntpItemConverterBase" class as an alternative to "MntpGenericItemConverter"
1 parent ba46d7c commit ca0383f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using Umbraco.Cms.Core.Models.PublishedContent;
3+
4+
namespace Skybrud.Umbraco.MultiNodeTreePicker.Converters {
5+
6+
public abstract class MntpItemConverterBase<T> : IMntpItemConverter {
7+
8+
public string Name { get; }
9+
10+
protected MntpItemConverterBase(string name) {
11+
Name = name;
12+
}
13+
14+
public abstract object Convert(IPublishedPropertyType propertyType, IPublishedContent source);
15+
16+
public virtual Type GetType(IPublishedPropertyType propertyType) {
17+
return typeof(T);
18+
}
19+
20+
}
21+
22+
}

0 commit comments

Comments
 (0)