protected void OnNvOutKeyPressEvent(object o, KeyPressEventArgs args) { Gtk.NodeView selection = (Gtk.NodeView)o; MyTreeNode node = (MyTreeNode)selection.NodeSelection.SelectedNode; if ((args.Event.Key == Gdk.Key.Delete) || (args.Event.Key == Gdk.Key.s) || (args.Event.Key == Gdk.Key.d)) // Efface { String msgTxt = "Comfirmer l'effacage de\n" + node.CNom; MessageDialog msgConf = new MessageDialog(this, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo, msgTxt); ResponseType rtD = (Gtk.ResponseType)msgConf.Run(); msgConf.Destroy(); if (rtD == ResponseType.Yes) //efface { String sTrash = Environment.GetEnvironmentVariable("HOME") + "/PNMail/Trash/" + node.CNom; String sProc = Environment.GetEnvironmentVariable("HOME") + "/PNMail/OutBox/" + node.CNom; try { File.Copy(sProc, sTrash); // Move marche pas ???? File.Delete(sProc); } catch (IOException e) { Console.WriteLine("PB: {0}", e.Message); } nvOut.NodeStore = StoreOut; nvOut.ShowAll(); } } else // Raffraichit { nvIn.NodeStore = StoreIn; nvOut.NodeStore = StoreOut; nvIn.ShowAll(); nvOut.ShowAll(); } }
protected void OnNvOutRowActivated(object o, RowActivatedArgs args) { MyTreeNode item = (MyTreeNode)nvOut.NodeStore.GetNode(args.Path); String sFileName = Environment.GetEnvironmentVariable("HOME") + "/PNMail/OutBox/" + item.CNom; StreamReader srMsg = new StreamReader(sFileName); String sTxt = srMsg.ReadToEnd(); LecDlg msgRdMsg = new LecDlg(item.CNom, sTxt); msgRdMsg.Run(); msgRdMsg.Destroy(); }