public override void cleanup(CleanupInfo cleanupInfo)
 {
     if (cleanupInfo.hasObjectClass(PropClass))
     {
         cleanupInfo.claimObject(PropClass, propType);
     }
 }
示例#2
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);
        }