Я решил это!
Эта статья помогла мне http://www.shazwazza.com/post/Dynamically-registering-custom-trees-without-writing-to-UmbracoAppTree.aspx
Кроме того, я не мог найти помощь где-либо еще, надеюсь, это кому-нибудь поможет.
static object _locker = new object();
/// <summary>
/// Adds a custom tree to a custom section in Umbraco
/// </summary>
/// <param name="customTreeType">Your custom tree that is inherited from BaseTree</param>
/// <param name="alias">Your custom section alias</param>
public static void RenderCustomTree(Type customTreeType, string alias)
{
// Check if customTree is already registered
if (TreeDefinitionCollection.Instance.Count(x => x.TreeType == customTreeType) == 0)
{
lock (_locker)
{
// Double check
if (TreeDefinitionCollection.Instance.Count(x => x.TreeType == customTreeType) == 0)
{
Application customApp = new Application(alias, alias, ".traycontent");
// Create the tree definition
var myCustomTree = new TreeDefinition(customTreeType,
new umbraco.BusinessLogic.ApplicationTree(true, true, 0,
alias, //applicationAlias,
alias, //alias
alias, //title
".sprTreeFolder", //iconClosed
".sprTreeFolder_o", //iconOpened
"uComponents.Core", //assemblyName
customTreeType.ToString(), //type
null), //action
customApp);
// Add our tree definition to the collection at runtime
TreeDefinitionCollection.Instance.Add(myCustomTree);
}
}
}
}
И в вашем собственном классе, унаследованном от IHttpModule:
public void Init(HttpApplication application)
{
RenderCustomTree(typeof(YourCustomTree), "yourCustomSection");
}