Пример #1
0
        protected internal override void claimFiles(CleanupInfo info, ResourceProvider resourceProvider, Slide slide)
        {
            String rml         = null;
            String rmlFullPath = getRmlFilePath(slide);

            if (resourceProvider.fileExists(rmlFullPath))
            {
                using (StreamReader stringReader = new StreamReader(resourceProvider.openFile(rmlFullPath)))
                {
                    rml = stringReader.ReadToEnd();
                }
            }

            if (String.IsNullOrEmpty(rml))
            {
                Logging.Log.Warning("Could not claim files for slide '{0}', cannot find rml file '{1}' for panel '{2}'", slide.UniqueName, rmlFullPath, ElementName);
                return; //Break if we cannot load the rml
            }

            info.claimFile(rmlFullPath);

            XDocument rmlDoc = XDocument.Parse(rml);
            var       images = from query in rmlDoc.Descendants("img")
                               where query.Attribute("src") != null
                               select query.Attribute("src").Value;

            foreach (String image in images)
            {
                info.claimFile(Path.Combine(slide.UniqueName, image));
            }

            var triggers = from e in rmlDoc.Root.Descendants()
                           where e.Attribute("onclick") != null
                           select e;

            if (info.hasObjectClass(Slide.SlideActionClass))
            {
                foreach (var element in triggers)
                {
                    info.claimObject(Slide.SlideActionClass, element.Attribute("onclick").Value);
                }
            }

            base.claimFiles(info, resourceProvider, slide);
        }
Пример #2
0
        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);
            }
        }
 public override void cleanup(CleanupInfo cleanupInfo)
 {
     cleanupInfo.claimFile(Scene);
 }
Пример #4
0
 public override void cleanup(CleanupInfo cleanupInfo)
 {
     cleanupInfo.claimFile(ImageFile);
 }
Пример #5
0
 public override void cleanup(CleanupInfo cleanupInfo)
 {
     cleanupInfo.claimFile(TargetTimeline);
 }