public static void ParseStartBaseHypermediaSerializationString(List <string> stringList, out string path, out Encoding encoding, out string name)
 {
     path = new string(stringList[0].Skip(14).TakeWhile(x => x != ',').ToArray());
     try
     {
         encoding = Encoding.GetEncoding(new string(stringList[3].Skip(20).TakeWhile(x => x != ',').ToArray()));
     }
     catch
     {
         encoding = Encoding.GetEncoding("utf-8");
     }
     name = EncodingTools.DecodeString(new string(stringList[1].Skip(14).TakeWhile(x => x != ',').ToArray()), encoding);
 }
Exemple #2
0
 public static void InitStartBaseHypermediaSerializationStrings(ref StringBuilder builder, Hypermedia hypermedia, string outerTabulationBuilder, string innerTabulationBuilder)
 {
     InitStartBaseSerializationStrings(ref builder, hypermedia, outerTabulationBuilder, innerTabulationBuilder);
     builder.AppendLine($"{innerTabulationBuilder}(string:name)={EncodingTools.EncodeString(hypermedia.Name, hypermedia.Encoding is null ? Encoding.UTF8 : hypermedia.Encoding)},");
 }
 public static void ParseStartBaseSystemEntitySerializationString(List <string> stringList, Encoding encoding, out string path, out string name)
 {
     path = new string(stringList[0].Skip(14).TakeWhile(x => x != ',').ToArray());
     name = EncodingTools.DecodeString(new string(stringList[1].Skip(14).TakeWhile(x => x != ',').ToArray()), encoding);
 }
Exemple #4
0
 public static void InitStartBaseSystemEntitySerializationStrings(ref StringBuilder builder, IEntity entity, Encoding encoding, string outerTabulationBuilder, string innerTabulationBuilder)
 {
     InitStartBaseSerializationStrings(ref builder, entity, outerTabulationBuilder, innerTabulationBuilder);
     builder.AppendLine($"{innerTabulationBuilder}(string:name)={EncodingTools.EncodeString(entity.Name, encoding)},");
 }