private void json() { JSONserialized.jsonFormatter.JCompany = CompanyList; JSONserialized.jsonFormatter.Jowner = OwnerList; JSONserialized.jsonFormatter.JCleaner = CleanerList; JSONserialized.jsonFormatter.JEngineer = EngineerList; JSONserialized.jsonFormatter.JManager = ManagerList; JSONserialized.Savejson("people.json"); }
private void Dejson() { JSONserialized.Loadjson("people.json"); CompanyList = JSONserialized.jsonFormatter.JCompany; OwnerList = JSONserialized.jsonFormatter.Jowner; CleanerList = JSONserialized.jsonFormatter.JCleaner; EngineerList = JSONserialized.jsonFormatter.JEngineer; ManagerList = JSONserialized.jsonFormatter.JManager; UpdateGrid(); }
private void Form1_Load(object sender, EventArgs e) { BinarySerializer.CreateInstance(); JSONserialized.CreateJson(); Companydata.DataSource = CompanyList; Ownerdata.DataSource = OwnerList; Managerdata.DataSource = ManagerList; Engineerdata.DataSource = EngineerList; Cleanerdata.DataSource = CleanerList; LoadPlugins(); }
public static void Loadjson(string fileName) { using (var st = File.OpenRead(fileName)) jsonFormatter = (JSONserialized) new DataContractJsonSerializer(typeof(JSONserialized)).ReadObject(st); }
public static void CreateJson() { jsonFormatter = new JSONserialized(); }