public static string ReadPrventsvo() { InfoZaPostavke postavke = ReadInfo(); if (postavke == null) { return(null); } return(postavke.Prvenstvo); }
public static string ReadJezik() { InfoZaPostavke postavke = ReadInfo(); if (postavke == null) { return(null); } return(postavke.Jezik); }
public static void WritePrvenstvo(string prvenstvo) { InfoZaPostavke postavke = ReadInfo(); if (postavke == null) { postavke = new InfoZaPostavke(); } postavke.Prvenstvo = prvenstvo; WriteInfo(postavke); }
public static void WriteJezik(string jezik) { InfoZaPostavke postavke = ReadInfo(); if (postavke == null) { postavke = new InfoZaPostavke(); } postavke.Jezik = jezik; WriteInfo(postavke); }
private static InfoZaPostavke ReadInfo() { try { using (StreamReader r = new StreamReader(dokument1)) { string json = r.ReadToEnd(); InfoZaPostavke item = JsonConvert.DeserializeObject <InfoZaPostavke>(json); return(item); } } catch (Exception e) { Directory.CreateDirectory(folderPath); File.Create(dokument1).Close(); return(null); } }
private static void WriteInfo(InfoZaPostavke info) { string json = JsonConvert.SerializeObject(info); System.IO.File.WriteAllText(dokument1, json); }