internal void Register(Controller controller)
		{
			controllers.Add(controller);
		}
 public Controller(Binding binding, Controller source)
 {
     type = source.type;
     this.binding = binding;
 }
		internal void Unregister(Controller controller)
		{
			controllers.Remove(controller);
		}
        public void Validate(string url, Controller controller)
        {
            Assert.AreEqual(type, controller.Type.Name, "Method " + url + ": Controller Type mismatch");
//            Assert.AreEqual(seq, controller.SeqNumber, "Method " + url + " controller " + type + ": Controller sequence mismatch");
        }
 internal void Validate(string url, Controller controller)
 {
 }
 public void Validate(string url, Controller controller)
 {
 }
Esempio n. 7
0
 internal void Unregister(Controller controller)
 {
     foreach (Resource resource in new List<Resource>(resources.Values))
         if (resource.IsEmpty)
             resources.Remove(resource.Name);
     controllers.Remove(controller);
     checkAndRemove();            
 }
Esempio n. 8
0
        //internal void Register(Controller controller)
        //{
        //    controllers.Add(controller);
        //    controller.Type.Register(controller);
        //    foreach (string resourceName in controller.Type.Provides)
        //        lookupResource(resourceName).AddProvider(controller.Type);
        //    foreach (string resourceName in controller.Type.Requires)
        //        lookupResource(resourceName).AddRequiredBy(controller.Type);
        //    foreach (string resourceName in controller.Type.DependsOn)
        //        lookupResource(resourceName).AddDependents(controller.Type);
        //}

        internal void Register(Binding binding,ControllerType ctrType, string methodUrl)
        {
            foreach (Controller ctr in controllers)
            {
                if (ctr.Type == ctrType)
                    return;
            }
            Controller controller = new Controller(binding, ctrType, methodUrl);
            controllers.Add(controller);
            ctrType.Register(controller);
            foreach (string resourceName in controller.Type.Provides)
                lookupResource(resourceName).AddProvider(controller.Type);
            foreach (string resourceName in controller.Type.Requires)
                lookupResource(resourceName).AddRequiredBy(controller.Type);
            foreach (string resourceName in controller.Type.DependsOn)
                lookupResource(resourceName).AddDependents(controller.Type);
        }