Exemple #1
0
        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);
        }
Exemple #2
0
 internal static void removePanel(RmlSlidePanel panel)
 {
     if (panel != null)
     {
         oldInlineRml.Remove(panel);
     }
 }
Exemple #3
0
 internal static void setRml(RmlSlidePanel panel, String rml)
 {
     if (oldInlineRml.ContainsKey(panel))
     {
         oldInlineRml[panel] = rml;
     }
     else
     {
         oldInlineRml.Add(panel, rml);
     }
 }
Exemple #4
0
        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);
        }
Exemple #5
0
 internal static bool tryGetValue(RmlSlidePanel panel, out String value)
 {
     return(oldInlineRml.TryGetValue(panel, out value));
 }