internal bool ExportStrippedFile(string path) { if (path == string.Empty) { return(false); } string compiledText = FileCont.ToString(true); if (compiledText == string.Empty) { return(false); } File.WriteAllText(path, compiledText); return(true); }
internal bool SaveToFile(string path) { if (path == string.Empty) { return(false); } FileCont.Path = path; string compiledFileText = FileCont.ToString(); if (compiledFileText == string.Empty) { return(false); } File.WriteAllText(FileCont.Path, compiledFileText); return(true); }
internal bool LoadFromString(string content) { try { if (content.Contains("- " + nameof(FileContainer.Message.Page.SpokenLine))) { Deserializer yDeserializer = new DeserializerBuilder().WithTypeConverter(new ContainerTypeConverter()).Build(); FileCont = yDeserializer.Deserialize <FileContainer>(content); return(true); } string[] splitContent = content.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); return(FileCont.PopulateContainer(splitContent)); } catch { return(false); } }