public string DoubleDataString(ResxData leftData, ResxData rightData) { var sb = new StringBuilder(); sb.Append("keys = "); sb.AppendLine(leftData.Name); sb.Append("lval = "); sb.AppendLine(leftData.Value); sb.Append("rval = "); sb.AppendLine(rightData.Value); if (FullData) { sb.Append("lcom = "); sb.AppendLine(leftData.Comment); sb.Append("rcom = "); sb.AppendLine(rightData.Comment); sb.Append("ltyp = "); sb.AppendLine(leftData.Type); sb.Append("rtyp = "); sb.AppendLine(rightData.Type); sb.Append("lspc = "); sb.AppendLine(leftData.Space); sb.Append("rspc = "); sb.AppendLine(rightData.Space); } return(sb.ToString()); }
public void ResxDataToXml() { var data = new ResxData { Name = "A_key", Value = "A key", Space = "preserve" }; var elem = data.ToXml(); Assert.AreEqual("data", elem.Name.ToString()); Assert.AreEqual("A_key", elem.Attribute("name").Value); Assert.AreEqual("preserve", elem.Attribute(XNamespace.Xml + "space").Value); Assert.AreEqual("A key", elem.Element("value").Value); }
public string SingleDataString(ResxData data) { var sb = new StringBuilder(); sb.Append("key = "); sb.AppendLine(data.Name); sb.Append("val = "); sb.AppendLine(data.Value); if (FullData) { sb.Append("com = "); sb.AppendLine(data.Comment); sb.Append("typ = "); sb.AppendLine(data.Type); sb.Append("spc = "); sb.AppendLine(data.Space); } return(sb.ToString()); }