Exemplo n.º 1
0
 public void SetString(IValue encodingOrSettings = null)
 {
     ApplySettings(encodingOrSettings);
     _stringBuffer       = new StringBuilder();
     _internalTextWriter = new TextWriterWithSettings(_stringBuffer, _settings.GetClrSettings());
     _writer             = new XmlTextWriter(_internalTextWriter);
     SetDefaultOptions();
 }
Exemplo n.º 2
0
        public void OpenFile(string path, IValue encodingOrSettings = null, IValue addBOM = null)
        {
            ApplySettings(encodingOrSettings);
            var fs          = new FileStream(path, FileMode.Create, FileAccess.Write);
            var clrSettings = _settings.GetClrSettings(addBOM?.AsBoolean() ?? true);

            _internalTextWriter = new TextWriterWithSettings(fs, clrSettings);
            _writer             = new XmlTextWriter(_internalTextWriter);
            SetDefaultOptions();
        }