private void add_Click(object sender, EventArgs e) { manageFile form = new manageFile(); GlobalVariable.selectedOwnObject = null; form.Show(); this.Dispose(); }
private void radListView1_DoubleClick(object sender, EventArgs e) { GlobalVariable.fromwhere = "sub"; GlobalVariable.selectedOwnObject = new ListOfAdds.Datum(); string allobject = ""; var directory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); string path = Path.Combine(directory, "Arvand", "objects.txt"); if (System.IO.File.Exists(path) == false) { Directory.CreateDirectory(Path.GetDirectoryName(path)); using (FileStream fs = new FileStream(path, FileMode.Create)) { } } using (StreamReader sr = new StreamReader(path, true)) { allobject = sr.ReadToEnd(); } List <ListOfAdds.Datum> list = new List <ListOfAdds.Datum>(); List <ListOfAdds.Datum> list2 = new List <ListOfAdds.Datum>(); ListOfAdds.Datum obj = new ListOfAdds.Datum(); try { list2 = JsonConvert.DeserializeObject <List <ListOfAdds.Datum> >(allobject); } catch (Exception) { obj = JsonConvert.DeserializeObject <ListOfAdds.Datum>(allobject); } if (list2 != null) { foreach (var item in list2) { list.Add(item); } } string selectedindex = radListView1.SelectedItem.Value.ToString(); ListOfAdds.Datum selected = list.Where(x => x.ID == selectedindex).FirstOrDefault(); GlobalVariable.selectedOwnObject = selected; manageFile form6 = new manageFile(); form6.Show(); }
private void addfileBotton_Click(object sender, EventArgs e) { manageFile managefile = new manageFile(); managefile.Show(); }