Exemplo n.º 1
0
        public TableFile(string fileFullPath, Encoding encoding)
        {
            // 不会锁死, 允许其它程序打开
            using (FileStream fileStream = new FileStream(fileFullPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            {
                var config = new TableFileConfig()
                {
                    ContentStreams = new Stream[] { fileStream },
                };

                if (encoding != null)
                {
                    config.Encoding = encoding;
                }

                _config = config;

                ParseAll(_config);
            }
        }
Exemplo n.º 2
0
 private void ParseAll(TableFileConfig config)
 {
     ParseStringsArray(config.Contents);
     ParseStreamsArray(config.ContentStreams);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 表文件
 /// </summary>
 /// <param name="config">需求读取的数据</param>
 public TableFile(TableFileConfig config)
 {
     _config = config;
     ParseAll(config);
 }