Beispiel #1
0
 /// <summary>
 /// 使用指定的 XML 文件初始化一个 <see cref="XmlFileOfVS"/> 对象。
 /// </summary>
 /// <param name="file"></param>
 public XmlFileOfVS(string file)
 {
     IsFile   = true;
     FullPath = Path.GetFullPath(file);
     using FileStream stream = new FileStream(FullPath, FileMode.OpenOrCreate, FileAccess.Read);
     xml.Load(stream);
     fileSize = (FileSize)stream.Length;
     //Load(stream);
     TempNodes = new TempNodeCollection(this);
 }
Beispiel #2
0
 /// <summary>
 /// 使用指定的 XML 文件初始化一个 <see cref="XmlFileOfVS"/> 对象。
 /// </summary>
 /// <param name="file"></param>
 /// <param name="path"></param>
 /// <param name="isFile"></param>
 public XmlFileOfVS(XmlDocument file, string path, bool isFile = false)
 {
     IsFile = isFile;
     if (IsFile)
     {
         FullPath = Path.GetFullPath(path);
     }
     else
     {
         FullPath = path;
     }
     xml = file;
     using MemoryStream stream = new MemoryStream();
     xml.Save(stream);
     fileSize = (FileSize)stream.Length;
     //Load(stream);
     TempNodes = new TempNodeCollection(this);
 }
Beispiel #3
0
 /// <summary>
 /// 从指定的流的当前位置加载一个 <see cref="XmlFileOfVS"/> 对象。
 /// </summary>
 /// <param name="stream"></param>
 private XmlFileOfVS(Stream stream)
 {
     Load(stream);
     TempNodes = new TempNodeCollection(this);
 }