//With every ezSlide instance new sid will be created public ezSlide(Slide slide) { if (Globals.Ribbons.PowerPointStudioRibbon.ediBxExerKey.Text != "") { sid = Globals.Ribbons.PowerPointStudioRibbon.ediBxExerKey.Text + "_S" + slide.SlideIndex.ToString("000");//String.Format("{0:0.00}", width) } //Create background and convert that to ezshape to assign that to shape //As slide background belongs to shape ezBackGround backGround = new ezBackGround(slide); ezShape backgroundShape = new ezShape(backGround.id, backGround.image, null, "temp"); shapes.Add(backgroundShape); //Assigning ezShape to shapes foreach (Shape shape in slide.Shapes) { //Qulify shape Name ezPlacement placement = new ezPlacement(); string placementText; //Handle placement if (shape.AlternativeText.Contains("$Placement$")) { //find placement text placementText = getPacementText(shape); placementText = "{" + placementText + "}"; placement = Newtonsoft.Json.JsonConvert.DeserializeObject <ezPlacement>(placementText); handlePlacement(shape, placement); } if (!(placement.onSlide == ezOnSlide.exceptFirst && slide.SlideIndex == 1)) { ezShape shp = new ezShape(shape); shapes.Add(shp); } //To get dnds if (shape.AlternativeText.Contains("$dnd$")) { dnds dn = new dnds(shape); dnd.Add(dn); } } slideCount++; }
public dnds(Shape shape) { if (shape.AlternativeText.Contains("$dnd$")) { string dnd = "{" + Regex.Replace(dndFinder(shape.AlternativeText).Trim(), @"\t|\n|\r", "") + "}"; try { dnds parsedDnd = Newtonsoft.Json.JsonConvert.DeserializeObject <dnds>(dnd); this.dragitem = parsedDnd.dragitem; this.droptarget = parsedDnd.droptarget; this.audioondrop = parsedDnd.audioondrop; this.pictureondrop = parsedDnd.pictureondrop; this.shapeondrop = parsedDnd.shapeondrop; } catch (Exception err) { MessageBox.Show("dnd is not in JSON format. Couldn't deserialize/n" + err.ToString()); } } }