示例#1
0
        private static void CreateDependee(DomainController instance, Type controllerType)
        {
            var types = TypeHelper.GetHierarchy(controllerType, typeof(DomainController));

            foreach (var type in types)
            {
                List <Type> dependeeList = null;
                if (_dependency.TryGetValue(type, out dependeeList))
                {
                    foreach (var dependeeType in dependeeList)
                    {
                        var dependee = Create(dependeeType);
                        dependee.InnerDependon(instance);
                    }
                }
            }
        }
示例#2
0
 /// <summary>
 /// 如果使用了 Depend().On() 方法创建了监听关系,则需要重写此方法来建立确切的事件监听程序。
 /// </summary>
 /// <param name="controller"></param>
 protected virtual void OnAlwaysDependon(DomainController controller)
 {
     throw new NotImplementedException("使用了 Dependency 方法创建了监听关系,则需要重写此方法来建立确切的事件监听程序。");
 }
示例#3
0
 internal void InnerDependon(DomainController controller)
 {
     this.OnAlwaysDependon(controller);
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ControllerCreatedEventArgs"/> class.
 /// </summary>
 /// <param name="controller">The controller.</param>
 public ControllerCreatedEventArgs(DomainController controller)
 {
     this.Controller = controller;
 }