修复转义符号引起的bug

This commit is contained in:
Zhuangkh 2023-05-12 15:38:23 +08:00
parent 3dcbe4a0eb
commit 7826b3a3f4
2 changed files with 58 additions and 40 deletions

View File

@ -5,8 +5,8 @@ using System.IO;
namespace IDTF.Net
{
// References:
// http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol/src/org/jmol/export/_IdtfExporter.java?revision=HEAD&view=markup
// http://www2.iaas.msu.ru/tmp/u3d/
// http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol/src/org/jmol/export/_IdtfExporter.java?revision=HEAD&view=markup
// http://www2.iaas.msu.ru/tmp/u3d/
public abstract class Node
{
@ -15,11 +15,20 @@ namespace IDTF.Net
this.MetaData = new MetaData();
}
public string Name { get; set; }
public string Name
{
get => name;
set
{
name = value.Replace("\"","\\\"");
}
}
public NodeType Type { get; protected set; }
private List<Parent> _parents;
private string name;
public List<Parent> Parents
{
get

View File

@ -24,7 +24,16 @@ namespace IDTF.Net
public abstract class Resource
{
public string Name { get; set; }
private string name;
public string Name
{
get => name;
set
{
name = value.Replace("\"", "\\\"");
}
}
public abstract ResourceListType ResourceType { get; }
public abstract void Export(StreamWriter toStream);
}