public override SlidePanel clone(Slide originalSlide, Slide destinationSlide, bool asTemplate, EditorResourceProvider resourceProvider) { RmlSlidePanel clone; if (asTemplate) { String rml; try { using (StreamReader sr = new StreamReader(resourceProvider.openFile(this.getRmlFilePath(originalSlide)))) { rml = sr.ReadToEnd(); } } catch (Exception ex) { rml = "An error occured"; Logging.Log.Warning("{0} when trying to load the rml for slide '{1}'. Message: {2}. Rml not templated", ex.GetType().Name, originalSlide.UniqueName, ex.Message); } clone = new RmlSlidePanelTemplate() { Rml = rml }; } else { clone = new RmlSlidePanel(); } applyToExisting(destinationSlide, clone, true, resourceProvider); return(clone); }
internal static void removePanel(RmlSlidePanel panel) { if (panel != null) { oldInlineRml.Remove(panel); } }
internal static void setRml(RmlSlidePanel panel, String rml) { if (oldInlineRml.ContainsKey(panel)) { oldInlineRml[panel] = rml; } else { oldInlineRml.Add(panel, 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); }
internal static bool tryGetValue(RmlSlidePanel panel, out String value) { return(oldInlineRml.TryGetValue(panel, out value)); }