src/EasyFrameWork/ViewPort/jsTree/Tree.cs
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/* http://www.zkea.net/
* Copyright (c) ZKEASOFT. All rights reserved.
* http://www.zkea.net/licenses */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Easy.Extend;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Routing;
using Easy.Serializer;
namespace Easy.ViewPort.jsTree
{
public class Tree<T> where T : class
{
IEnumerable<T> DataSource;
string _sourceUrl = "";
Func<T, string> valueProperty;
Func<T, string> parentProperty;
Func<T, string> textProperty;
bool _expandAll;
Dictionary<string, string> _events = new Dictionary<string, string>();
List<string> _plugins = new List<string>();
Contextmenu contextMenu = new Contextmenu();
List<Node> nodes;
string _rootId;
string _name;
string _check_callback;
private readonly ViewContext _viewContext;
private IUrlHelper _urlHelper;
public Tree()
{
this._name = Guid.NewGuid().ToString("N");
}
public Tree(ViewContext viewContex)
{
this._name = Guid.NewGuid().ToString("N");
_viewContext = viewContex;
IUrlHelperFactory _urlHelperFactory = viewContex.HttpContext.RequestServices.GetService(typeof(IUrlHelperFactory)) as IUrlHelperFactory;
_urlHelper = _urlHelperFactory.GetUrlHelper(viewContex);
}
public Tree<T> Name(string name)
{
this._name = name;
return this;
}
#region 公用方法
public Tree<T> Source(IEnumerable<T> source)
{
this.DataSource = source;
return this;
}
后面还有 156 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。