private void findDependencies() { CleanupInfo resourceInfo = new CleanupInfo(); resourceInfo.defineObjectClass(ShowPropAction.PropClass); foreach (String file in editorController.ResourceProvider.listFiles("*.tl", "", true)) { Timeline timeline; using (Stream fileStream = editorController.ResourceProvider.openFile(file)) { timeline = SharedXmlSaver.Load <Timeline>(fileStream); } timeline.cleanup(resourceInfo); } plugin.setDependencyIds(resourceInfo.getObjects <String>(ShowPropAction.PropClass) .Select(n => standaloneController.PropFactory.getDependencyIdForProp(n)) .Where(id => id.HasValue) .Select(id => id.Value)); }
public virtual void cleanup(CleanupInfo info, ResourceProvider resourceProvider) { String timelinePath = Path.Combine(UniqueName, "Timeline.tl"); info.claimFile(timelinePath); if (resourceProvider.exists(timelinePath)) { using (Stream stream = resourceProvider.openFile(timelinePath)) { Timeline timeline = SharedXmlSaver.Load <Timeline>(stream); timeline.cleanup(info); } } info.claimFile(Path.Combine(UniqueName, "Thumb.png")); info.claimFile(Path.Combine(UniqueName, StyleSheetName)); info.claimFile(SceneThumbName); info.claimFile(SceneThumbInfoName); layoutStrategy.claimFiles(info, resourceProvider, this); //Clean up actions List <String> removeActions = new List <String>(triggerActions.Keys); foreach (String action in info.getObjects <String>(Slide.SlideActionClass)) { removeActions.Remove(action); } foreach (String action in removeActions) { triggerActions.Remove(action); } info.clearObjects(Slide.SlideActionClass); foreach (var action in triggerActions.Values) { action.cleanup(this, info, resourceProvider); } }