/// <summary> /// Remove a shape group. /// </summary> /// <param name="name">The name of the group to remove.</param> public void removeGroup(String name) { if (shapeGroups.ContainsKey(name)) { ShapeGroup localGroup = declareGroup(name); localGroup.unloadShapes(shapeRepository); shapeGroups.Remove(name); Log.Info("Destroyed shape resource group {0}.", name); } else { Log.Default.sendMessage("Attempted to remove group {0} that does not exist. No changes made.", LogLevel.Warning, "ShapeLoading", name); } }
/// <summary> /// Constructor. /// </summary> /// <param name="locName">The name of the location (the path).</param> /// <param name="type">The type of the location.</param> /// <param name="recursive">If this is true and the location is a directory it will be scanned for all valid files.</param> public ShapeLocation(String locName, bool recursive, ShapeGroup parentGroup) { this.LocName = locName; this.Recursive = recursive; this.Loaded = false; }
/// <summary> /// Called when a resource is removed. /// </summary> /// <param name="group">The group the resource belongs to.</param> /// <param name="resource">The resource that was added.</param> public void resourceRemoved(ResourceGroup group, Resource resource) { ShapeGroup localGroup = declareGroup(group.FullName); localGroup.destroyShapeLocation(resource.LocName, shapeRepository); }
/// <summary> /// Handler for when resources are added to the SubsystemResources in control. /// </summary> /// <param name="group">The group the resource was added to.</param> /// <param name="resource">The resource that was added.</param> public void resourceAdded(ResourceGroup group, Resource resource) { ShapeGroup localGroup = declareGroup(group.FullName); localGroup.addShapeLocation(new ShapeLocation(resource.LocName, resource.Recursive, localGroup), loader, builder); }