protected RmlSlidePanel(LoadInfo info) : base(info) { if (info.Version < 2) { InlineRmlUpgradeCache.setRml(this, info.GetString("rml", null)); rmlFile = Guid.NewGuid().ToString("D") + ".rml"; } }
public override object restoreObject(LoadInfo info) { Slide slide = (Slide)base.restoreObject(info); //Scan the loadInfo and see if there is anything we need to upgrade. if (info.hasValue("rml")) { RmlSlidePanel panel = new RmlSlidePanel(); InlineRmlUpgradeCache.setRml(panel, info.GetString("rml")); panel.ElementName = new BorderLayoutElementName(GUILocationNames.ContentArea, BorderLayoutLocations.Left); panel.Size = 480; slide.addPanel(panel); } if (info.hasValue("layers")) { slide.StartupAction = new SetupSceneAction("Show", info.GetValue <CameraPosition>("cameraPosition", null), info.GetValue <LayerState>("layers", null), info.GetValue <MusclePosition>("musclePosition", null), info.GetValue <PresetState>("medicalState", null), true, false); } return(slide); }
protected internal override void updateToVersion(int fromVersion, int toVersion, Slide slide, ResourceProvider slideshowResources) { if (toVersion >= 2 && fromVersion < toVersion) { String rml; if (InlineRmlUpgradeCache.tryGetValue(this, out rml)) { rml = rml.Replace(Version1TemplateLink, Version2TemplateLinkReplacement); InlineRmlUpgradeCache.setRml(this, rml); } using (Stream stream = slideshowResources.openWriteStream(Path.Combine(slide.UniqueName, Slide.StyleSheetName))) { } } if (toVersion >= 3 && fromVersion < toVersion) { String rml; if (InlineRmlUpgradeCache.tryGetValue(this, out rml)) { using (StreamWriter writer = new StreamWriter(slideshowResources.openWriteStream(getRmlFilePath(slide)), Encoding.UTF8)) { writer.Write(rml); } } } }