public void WriteXML(XmlField xmlParent) { XmlField xml = xmlParent.GetDaughterXmlField(c_sTag, true); string s = xml.GetAttrString(c_sID, ID); s += xml.GetAttrString(c_sName, Name); if (!string.IsNullOrEmpty(FontName)) s += xml.GetAttrString(c_sFontName, FontName); if (0 != FontSize) s += xml.GetAttrString(c_sFontSize, FontSize.ToString()); xml.OneLiner(s, ""); }
public void WriteXML(XmlField xmlParent, string sLanguageID) { // Nothing to write if completely empty bool bHasValue = !string.IsNullOrEmpty(Value); bool bHasKey = !string.IsNullOrEmpty(ShortcutKey); bool bHasTip = !string.IsNullOrEmpty(ToolTip); if (!bHasValue && !bHasKey && !bHasTip) return; // Beginning tag <Item> contains the ID XmlField xml = xmlParent.GetDaughterXmlField(c_sTag, true); // The ID for the language, e.g., "sp", "inz" string s = xml.GetAttrString(c_sID, sLanguageID); // The value if (bHasValue) s += xml.GetAttrString(c_sValue, Value); // Shortcut if present if (bHasKey) s += xml.GetAttrString(c_sKey, ShortcutKey); // Tooltip if present if (bHasTip) s += xml.GetAttrString(c_sTip, ToolTip); // Write it out xml.OneLiner(s, ""); }
public void WriteLanguageData(XmlField xmlParent, LocLanguage lang) { XmlField xml = xmlParent.GetDaughterXmlField(c_sTag, true); string s = xml.GetAttrString(c_sID, ID); xml.Begin(s); foreach (LocItem item in Items) item.WriteLanguageData(xml, lang); foreach (LocGroup sub in Groups) sub.WriteLanguageData(xml, lang); xml.End(); }
public void WriteXML(XmlField xmlParent) { XmlField xml = xmlParent.GetDaughterXmlField(c_sTag, true); string s = xml.GetAttrString(c_sID, ID); s += xml.GetAttrString(c_sTitle, Title); if (!string.IsNullOrEmpty(Description)) s += xml.GetAttrString(c_sDescription, Description); s += xml.GetAttrString(c_sTranslatorAudience, (TranslatorAudience) ? "true" : "false"); xml.Begin(s); foreach (LocItem item in Items) item.WriteXML(xml); foreach (LocGroup sub in Groups) sub.WriteXML(xml); xml.End(); }
public void WriteLanguageData(XmlField xmlParent, LocLanguage lang) { // Initialize the Item field XmlField xml = xmlParent.GetDaughterXmlField(c_sTag, true); string s = xml.GetAttrString(c_sID, ID); xml.Begin(s); // Write the languge data LocAlternate alt = GetAlternate(lang.Index); if (null != alt) alt.WriteXML(xml, lang.ID); // Done xml.End(); }
public void WriteXML(XmlField xmlParent) { // Beginning tag <Item> contains the ID XmlField xml = xmlParent.GetDaughterXmlField(c_sTag, true); string s = xml.GetAttrString(c_sID, ID); if (CanHaveShortcutKey) s += xml.GetAttrString(c_sKey, "true"); if (CanHaveToolTip) s += xml.GetAttrString(c_sTip, "true"); xml.Begin(s); // Add the English xml.GetDaughterXmlField(c_sEnglish, true).OneLiner(English); // Add the Information, if any if (!string.IsNullOrEmpty(Information)) xml.GetDaughterXmlField(c_sInformation, true).OneLiner(Information); // Add the shortcut key, if any if (!string.IsNullOrEmpty(ShortcutKey)) xml.GetDaughterXmlField(c_sKey, true).OneLiner(ShortcutKey); // Add the Tooltip, if any if (!string.IsNullOrEmpty(ToolTip)) xml.GetDaughterXmlField(c_sTip, true).OneLiner(ToolTip); // End Tag </Item> xml.End(); }