public static void UpdateDialPlan(Type type, ADialPlan.sUpdateConfigurationsCall call)
 {
     lock (_plans){
         for (int x = 0; x < _plans.Count; x++)
         {
             if (_plans[x].GetType().FullName == type.FullName)
             {
                 _plans[x].UpdateConfiguration(call);
                 _controller.DialplanUpdated(_plans[x]);
                 List <string> contexts = _plans[x].ContextsUsed;
                 CoreGenerator.RegenerateContexts(contexts.ToArray());
                 break;
             }
         }
     }
 }
 public static void UnDeployPlan(ADialPlan plan)
 {
     lock (_plans)
     {
         _controller.DialplanUnDeployed(plan);
         _plans.Remove(plan);
         _plans.Sort();
         List <string> planNames = new List <string>();
         foreach (ADialPlan p in _plans)
         {
             planNames.Add(p.GetType().FullName);
         }
         Settings.Current[_MODULE_NAME, _PLANS_LIST_ID] = planNames;
         List <string> contexts = plan.ContextsUsed;
         CoreGenerator.RegenerateContexts(contexts.ToArray());
     }
 }
 public static void DeployDialPlan(ADialPlan plan)
 {
     lock (_plans){
         if (!_plans.Contains(plan))
         {
             plan.LoadInitialConfiguration();
             _plans.Add(plan);
             _plans.Sort();
             List <string> planNames = new List <string>();
             foreach (ADialPlan p in _plans)
             {
                 planNames.Add(p.GetType().FullName);
             }
             Settings.Current[_MODULE_NAME, _PLANS_LIST_ID] = planNames;
             _controller.DialplanDeployed(plan, _plans.IndexOf(plan));
             List <string> contexts = plan.ContextsUsed;
             CoreGenerator.RegenerateContexts(contexts.ToArray());
         }
     }
 }
 public static void UnDeployPlan(Type type)
 {
     lock (_plans)
     {
         for (int x = 0; x < _plans.Count; x++)
         {
             if (_plans[x].GetType().FullName == type.FullName)
             {
                 _controller.DialplanUnDeployed(_plans[x]);
                 List <string> contexts = _plans[x].ContextsUsed;
                 _plans.RemoveAt(x);
                 _plans.Sort();
                 List <string> planNames = new List <string>();
                 foreach (ADialPlan p in _plans)
                 {
                     planNames.Add(p.GetType().FullName);
                 }
                 Settings.Current[_MODULE_NAME, _PLANS_LIST_ID] = planNames;
                 CoreGenerator.RegenerateContexts(contexts.ToArray());
                 break;
             }
         }
     }
 }