private void AddIgnoreFunction(FunctionComponent component)
 {
     if (!IgnoreDict.ContainsKey(component.FunctionKey))
     {
         IgnoreDict.Add(component.FunctionKey, component);
     }
 }
Beispiel #2
0
 public override void Remove(FunctionComponent function)
 {
     if (ChildFunctionItems != null)
     {
         ChildFunctionItems.Remove(function);
     }
 }
Beispiel #3
0
 public override void Add(FunctionComponent function)
 {
     if (ChildFunctionItems == null)
     {
         ChildFunctionItems = new List <FunctionComponent>();
     }
     ChildFunctionItems.Add(function);
 }
        /// <summary>
        /// 注册功能到字典中
        /// </summary>
        /// <param name="component"></param>
        /// <exception cref="ArgumentException">不能注册重复的功能项</exception>
        private void RegisterFunctionDict(FunctionComponent component)
        {
            if (!string.IsNullOrEmpty(component.FunctionKey))
            {
                if (FunctionDict.ContainsKey(component.FunctionKey))
                {
                    throw new ArgumentException("不能注册重复的功能项");
                }

                FunctionDict.Add(component.FunctionKey, component);
            }

            if (component.ChildFunctionItems != null)
            {
                foreach (var childFunction in component.ChildFunctionItems)
                {
                    RegisterFunctionDict(childFunction);
                }
            }
        }
 public abstract void Remove(FunctionComponent function);
 public abstract void Add(FunctionComponent function);