private void CopyClipboard_Click(object sender, RoutedEventArgs e) { try { Clipboard.SetText(FlameSerializer.SerializeFlame(FLVM.ToFlameModels(new List <FLVM>() { flamebrowser_main.vm.SelectedFlame })[0]).ToString()); StatusMessageVM.Instance.Show("Flame copied to clipboard"); } catch { StatusMessageVM.Instance.Show("Error while copying flame"); } }
private void LaunchProc(ref Process proc, string exepath) { /*if (proc!=null) * {//mar fut a process -> beillesztjuk a flamet * if (!proc.HasExited) * { * //proc.Handle * //win api: setforeground és sendkeys: * //ctrl+v vel atadas * return; * } * }*///elvetve //else: nem fut a process -> elinditjuk tmp fajllal Directory.CreateDirectory(System.IO.Path.GetTempPath() + @"Node Editor\"); string path = System.IO.Path.GetTempPath() + @"Node Editor\" + "tmp.flame";//Guid.NewGuid().ToString() FlameCollectionSerializer.SaveFile(flamebrowser_main.vm.FlameCollectionName, FLVM.ToFlameModels(flamebrowser_main.GetFlames()), path); proc = new Process(); proc.StartInfo.FileName = exepath; proc.StartInfo.WorkingDirectory = System.IO.Path.GetTempPath() + @"Node Editor\"; proc.StartInfo.Arguments = "tmp.flame"; //proc.StartInfo.UseShellExecute = false; //proc.StartInfo.RedirectStandardInput = true; proc.Start(); }
private void SaveAll_Click(object sender, RoutedEventArgs e) { Microsoft.Win32.SaveFileDialog sfd = new Microsoft.Win32.SaveFileDialog { Title = "Save flame collection", FileName = flamebrowser_main.vm.FlameCollectionName, DefaultExt = ".flame", Filter = "Flame files (.flame)|*.flame" }; if (sfd.ShowDialog() == true) { try { FlameCollectionSerializer.SaveFile(flamebrowser_main.vm.FlameCollectionName, FLVM.ToFlameModels(flamebrowser_main.GetFlames()), sfd.FileName); foreach (FLVM f in flamebrowser_main.GetFlames()) {//ezt ide tettem, mert szerializálóba nem lehetett a temporary fájl írások miatt f.Saved = true; } StatusMessageVM.Instance.Show("Flame collection saved successfully"); StatusMessageVM.Instance.SetPath(sfd.FileName); } catch { StatusMessageVM.Instance.Show("Error while saving flame: " + sfd.FileName); } } }
private void Save_Click(object sender, RoutedEventArgs e) { Microsoft.Win32.SaveFileDialog sfd = new Microsoft.Win32.SaveFileDialog { Title = "Save current flame", FileName = flamebrowser_main.vm.FlameCollectionName, DefaultExt = ".flame", Filter = "Flame files (.flame)|*.flame" }; if (sfd.ShowDialog() == true) { try { FlameCollectionSerializer.SaveFile(flamebrowser_main.vm.FlameCollectionName, FLVM.ToFlameModels(new List <FLVM>() { nodemap_main.Flame }), sfd.FileName); //ezt ide tettem, mert szerializálóba nem lehetett a temporary fájl írások miatt nodemap_main.Flame.Saved = true; StatusMessageVM.Instance.Show("Flame saved successfully"); } catch { StatusMessageVM.Instance.Show("Error while saving flame: " + sfd.FileName); } } }