void BymlEditor(object sender, EventArgs e) { OpenFileDialog openFile = new OpenFileDialog(); openFile.Filter = "byaml file |*.byml;*.byaml| every file | *.*"; if (openFile.ShowDialog() != DialogResult.OK) { return; } ByamlViewer.OpenByml(openFile.FileName); }
void XmlImport(object sender, EventArgs e) { OpenFileDialog openFile = new OpenFileDialog(); openFile.Filter = "xml file |*.xml| every file | *.*"; if (openFile.ShowDialog() != DialogResult.OK) { return; } StreamReader t = new StreamReader(new FileStream(openFile.FileName, FileMode.Open), UnicodeEncoding.Unicode); ByamlViewer.OpenByml(Byaml.XmlConverter.ToByml(t.ReadToEnd()), Path.GetFileName(openFile.FileName)); }
public void OpenFileEdit(string filename, Stream file, Stream saveStream) => ByamlViewer.OpenByml(file, filename, saveStream, true);
public void OpenFile(string filename, Stream file) => ByamlViewer.OpenByml(file, filename);
public void OpenFile(string filename, Stream file) { StreamReader t = new StreamReader(file, Encoding.GetEncoding(932)); ByamlViewer.OpenByml(Byaml.XmlConverter.ToByml(t.ReadToEnd()), filename); }