private string ReplacePlaceholder(string text) { /* * for the "2. get the special part"-Step: * possible placeholder: #Farbgestaltung#, #AnzahlLevel1Punkte# */ if (SInter.GetCountMainPoints() > 1) { text = text.Replace("#AnzahlHauptpunke#", SInter.GetCountMainPoints().ToString() + " Oberbegiffe"); } else { text = text.Replace("#AnzahlHauptpunke#", SInter.GetCountMainPoints().ToString() + " Oberbegiff"); } return(text); }
private string ReplacePlaceholder(string text) { /* * for the "2. get the special part"-Step: * possible placeholder: #AnzahlHauptpunkte# */ text = text.Replace("#AnzahlHauptpunkte#", SInter.GetCountMainPoints().ToString()); return(text); }
private string TranclateAndReplacePlaceholder(string text) { /* * the method tranclate and replace the Placeholder: * #Kategorie#, #Unterkategorie#, #AnzahlHauptpunkte#, #mit/ohneUP# * "textCategory" ist importen to save the german word and to add it to the text */ string textCategory = XMLHelper.getInstance.TranslateCategory(SInter.GetCategory()); text = text.Replace("#Kategorie#", textCategory); text = text.Replace("#Unterkategorie#", SInter.GetSubCategory()); text = text.Replace("#AnzahlHauptpunkte#", SInter.GetCountMainPoints().ToString()); if (existingSubPoints) { text = text.Replace("#mit/ohneUP#", "mit"); } else { text = text.Replace("#mit/ohneUP#", "ohne"); } return(text); }
private string GetDescrForEachPoint(PowerPoint.Shape smartArt) { /* * Creat the description for each node * 1. get node level * 2. has Text? * 3. get node content * 4. get node color */ //TODO: Bilder behandeln int subPointNr = 0; int mainPointNr = 0; string description = ""; Office.SmartArtNodes allNodes = smartArt.SmartArt.AllNodes; foreach (Office.SmartArtNode node in allNodes) { string text = ""; switch (node.Level) { case 1: //MainPoint if (node.TextFrame2.HasText == Office.MsoTriState.msoTrue) { mainPointNr++; text = GetMainPointDesc(); text = text.Replace("#InhaltHauptpunkt#", node.TextFrame2.TextRange.Text); if (text.Contains("#XYposition#") && SInter.GetCountMainPoints() == 4) { switch (mainPointNr) { case 1: text = text.Replace("#XYposition#", "oben links"); break; case 2: text = text.Replace("#XYposition#", "oben rechts"); break; case 3: text = text.Replace("#XYposition#", "unten links"); break; case 4: text = text.Replace("#XYposition#", "unten links"); break; } } // #Farbe# ---- text = GetColorStyleOfNode(node, text); } break; case 2: if (node.TextFrame2.HasText == Office.MsoTriState.msoTrue) { subPointNr++; text = GetSubPointDesc(); text = text.Replace("#Level#", "2"); if (text.Contains("#XYposition#") && SInter.GetCountMainPoints() == 1) { //switch to get the right position switch (subPointNr) { case 1: text = text.Replace("#XYposition#", "oben links"); break; case 2: text = text.Replace("#XYposition#", "oben rechts"); break; case 3: text = text.Replace("#XYposition#", "unten links"); break; case 4: text = text.Replace("#XYposition#", "unten links"); break; } } text = text.Replace("#InhaltUnterpunkt#", node.TextFrame2.TextRange.Text); } break; default: text = GetSubPointDesc(); text = text.Replace("#Level#", node.Level.ToString()); text = text.Replace("#XYposition#", ""); text = text.Replace("#InhaltUnterpunkt#", node.TextFrame2.TextRange.Text); break; } text = System.Text.RegularExpressions.Regex.Replace(text, "\r\n", ""); description += text + "\n"; } return(description); }