Пример #1
0
        /// <summary>
        /// 插件单元构造函数
        /// </summary>
        /// <param name="exPath">插件路径</param>
        /// <param name="configuration">插件单元配置项</param>
        /// <param name="conditions">条件项</param>
        public AddInElement(ExtensionPath exPath, IConfiguration configuration, List<ICondition> conditions)
        {
            this.addIn = exPath.AddIn;
            this.workItem = exPath.AddIn.WorkItem;
            this.path = exPath.Name;
            this.configuration = configuration;
            this.conditions = conditions;
            this.logger = workItem.Services.Get<ILog>();

            this.id = configuration.Attributes["id"];
            this.name = configuration.Attributes["name"];
            this.label = configuration.Attributes["label"];
            this.className = configuration.Attributes["classname"].ToLower(); // 小写
            this.command = configuration.Attributes["command"];
            this.conditions.Add(new AuthorizationCondition(this)); // 加入默认的权限管理条件表达式
        }
Пример #2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="addIn">插件</param>
 /// <param name="name">路径</param>
 internal ExtensionPath(AddIn addIn, string name)
 {
     this.addIn = addIn;
     this.name = name;
 }