public override void TemplateRegistryComponentCheckAssignment(RegistryComponent component) { if (MainRegistryFile.Default.OutputFileCreators[Header.Id][component.ReferencePosition] == component.Header.Id) throw new Exception("The component is still assigned to another one"); }
private void CheckAssignment(RegistryComponent component) { if (component == null) return; if (component.ReferencePosition == -1) return; foreach (var moduleComponent in Modules.Cast<RegistryComposite>().SelectMany(module => module.Cast<Module>())) moduleComponent.TemplateRegistryComponentCheckAssignment(component); }
public abstract void RemoveComponent(RegistryComponent component);
public override void RemoveComponent(RegistryComponent component) { foreach (var modulesComposite in Modules.Cast<RegistryComposite>().Where(modulesComposite => modulesComposite.Cast<object>().Any(module => component == module))) { CheckAssignment(component); Logger.Log("ID: " + component.Header.Id + " Component " + component.Header.Name + " has been removed"); var module = (Module)component; module.Deinitialize(); modulesComposite.Children.Remove(component); } UpdateRegistry(); }
public override void TemplateRegistryComponentCheckAssignment(RegistryComponent component) { }
public abstract void TemplateRegistryComponentCheckAssignment(RegistryComponent component);
public void Add(RegistryComponent component) { _children.Add(component); }
public void Remove(RegistryComponent component) { _children.Remove(component); }