Ejemplo n.º 1
0
 /// <summary>Add the specified model to the parent.</summary>
 /// <param name="parent">The parent model</param>
 /// <param name="modelToAdd">The child model.</param>
 public static void Add(IModel parent, IModel modelToAdd)
 {
     modelToAdd.Parent = parent;
     Apsim.ParentAllChildren(modelToAdd);
     parent.Children.Add(modelToAdd as Model);
     Apsim.ClearScopeCache(modelToAdd);
 }
Ejemplo n.º 2
0
 /// <summary>Deletes the specified model.</summary>
 /// <param name="model">The model.</param>
 public static bool Delete(IModel model)
 {
     Locator(model.Parent).Clear();
     Apsim.ClearScopeCache(model);
     return(model.Parent.Children.Remove(model as Model));
 }