private void btnexport_Click(object sender, EventArgs e) { FileSkimmerBackend.GetFile(new[] { ".wid" }, FileOpenerStyle.Save, (path) => { Utils.WriteAllText(path, JsonConvert.SerializeObject(temp_details)); }); }
private void moveToolStripMenuItem_Click(object sender, EventArgs e) { try { string path = currentdir + "/" + lvitems.SelectedItems[0].Tag.ToString(); if (DirectoryExists(path)) { FileSkimmerBackend.GetFile(new[] { "Directory" }, FileOpenerStyle.Save, (newPath) => { Utils.Move(path, newPath); ResetList(); }); } else if (FileExists(path)) { string[] psplit = path.Split('.'); string ext = psplit[psplit.Length - 1]; FileSkimmerBackend.GetFile(new[] { ext }, FileOpenerStyle.Save, (newPath) => { Utils.Move(path, newPath); ResetList(); }); } } catch { } }
private void btnimport_Click(object sender, EventArgs e) { FileSkimmerBackend.GetFile(new[] { ".nme" }, FileOpenerStyle.Open, new Action <string>((path) => { names = JsonConvert.DeserializeObject <Dictionary <string, string> >(Utils.ReadAllText(path)); })); }
private void btnexport_Click(object sender, EventArgs e) { FileSkimmerBackend.GetFile(new[] { ".nme" }, FileOpenerStyle.Save, new Action <string>((path) => { Utils.WriteAllText(path, JsonConvert.SerializeObject(names)); })); }
private void btnscanfile_Click(object sender, EventArgs e) { FileSkimmerBackend.GetFile(new[] { "" }, FileOpenerStyle.Open, (path) => { ScanFile(path); SetupSummary(); }); }
private void saveToolStripMenuItem_Click(object sender, EventArgs e) { var txt = new List <string>(); txt.Add(".rtf"); txt.Add(".txt"); FileSkimmerBackend.GetFile(txt.ToArray(), FileOpenerStyle.Save, (path) => SaveFile(path)); }
private void btnimport_Click(object sender, EventArgs e) { FileSkimmerBackend.GetFile(new[] { ".wid" }, FileOpenerStyle.Open, (path) => { temp_details = JsonConvert.DeserializeObject <Dictionary <string, WidgetDetails> >(Utils.ReadAllText(path)); SetupUI(); }); }
private void btnbrowse_Click(object sender, EventArgs e) { FileSkimmerBackend.GetFile(new[] { ".stp" }, FileOpenerStyle.Open, (file) => { txtfilepath.Text = file; btnstart.Show(); }); }
private void btnsendfile_Click(object sender, EventArgs e) { FileSkimmerBackend.GetFile(new[] { "" }, FileOpenerStyle.Open, (file) => { var finf = ShiftOS.Objects.ShiftFS.Utils.GetFileInfo(file); PostMessage($"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}", ChatID, "<user sent a file: " + finf.Name + ">"); FileSent?.Invoke(finf); }); }
private void openBinaryToolStripMenuItem_Click(object sender, EventArgs e) { FileSkimmerBackend.GetFile(new[] { ".svm" }, FileOpenerStyle.Open, new Action <string>((program) => { memory = Utils.ReadAllBytes(program); programCounter = 0; stack = new Stack <int>(); registers = new int[64000]; currentRegister = 0; Start(); })); }
private void addSongToolStripMenuItem_Click(object sender, EventArgs e) { FileSkimmerBackend.GetFile(new[] { ".mp4", ".wmv" }, FileOpenerStyle.Open, (result) => { var finf = ShiftOS.Objects.ShiftFS.Utils.GetFileInfo(result); File.WriteAllBytes(finf.Name, ShiftOS.Objects.ShiftFS.Utils.ReadAllBytes(result)); filePath = finf.Name; wpaudio.URL = filePath; wpaudio.Ctlcontrols.play(); btnplay.Text = "Pause"; }); }
private void addSongToolStripMenuItem_Click(object sender, EventArgs e) { FileSkimmerBackend.GetFile(new[] { ".mp3", ".wav" }, FileOpenerStyle.Open, (path) => { if (!lbtracks.Items.Contains(path)) { lbtracks.Items.Add(path); } else { Infobox.Show("Song already added!", "That song is already added to the Audio Player playlist."); } }); }
private void btnopen_Click(object sender, RoutedEventArgs e) { string filters = ".txt"; if (Shiftorium.UpgradeInstalled("textpad_lua_support")) { filters += ";.lua"; } if (Shiftorium.UpgradeInstalled("textpad_python_support")) { filters += ";.py"; } FileSkimmerBackend.GetFile(filters.Split(';'), FileOpenerStyle.Open, new Action <string>((file) => LoadFile(file))); }
private void lnkdownload_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { var attrib = typeof(Applications.WidgetManagerFrontend).GetCustomAttributes(false).FirstOrDefault(x => x is StpContents) as StpContents; if (attrib != null) { FileSkimmerBackend.GetFile(new[] { ".stp" }, FileOpenerStyle.Save, (file) => { WriteAllText(file, JsonConvert.SerializeObject(attrib)); }); } else { Infobox.Show("Service not available.", "The Shiftnet service you requested is not available."); } }
public static void DevXProgressReport() { Applications.Chat chat = null; Desktop.InvokeOnWorkerThread(() => { chat = OpenChat(); }); while (chat == null) { Thread.Sleep(10); } CurrentChat = chat; chat.ChatID = "devx@system"; chat.ShowChat(); SendChatMessage("devx", "Greetings, " + SaveSystem.CurrentUser.Username); SendChatMessage("devx", "I guess it is time to assess your system."); SendChatMessage("devx", "After all, you've gotten " + SaveSystem.CurrentSave.CountUpgrades() + " Shiftorium Upgrades since I've last contacted you."); SendChatMessage("devx", "And you have a Codepoint balance of " + SaveSystem.CurrentSave.Codepoints + "."); SendChatMessage("devx", "And...oh wait... what!? You found the... How did you find the Shiftnet!?"); SendChatMessage("devx", "Naughty, naughty user. You're not supposed to be on there."); SendChatMessage("devx", "Whatever. I've got a task for you."); SendChatMessage("devx", "Your logs show me you're in contact with Maureen Fenn."); SendChatMessage("devx", "I have a document to send her. You're my messanger."); SendChatMessage("devx", "Though, like any good messanger, I urge you not to open it."); SendChatMessage("devx", "<sent a file: unknown>"); SendChatMessage("devx", "When you get it, just send it to her. Do not delete it."); bool fileWritten = false; Desktop.InvokeOnWorkerThread(() => { FileSkimmerBackend.GetFile(new[] { ".rtf" }, FileOpenerStyle.Save, (loc) => { var bytes = Convert.FromBase64String(Properties.Resources.DevXMaureenLetter); Objects.ShiftFS.Utils.WriteAllBytes(loc, bytes); fileWritten = true; }); }); while (fileWritten == false) { Thread.Sleep(10); } }
/// <summary> /// Opens a File Skimmer "Save File" dialog. /// </summary> /// <param name="extensions">Semicolon-separated list of file extensions that the opener should let through the filter.</param> /// <param name="callback">Function to be called when the user chooses a file. The string value is the file's path.</param> public void saveFile(string extensions, Action <string> callback) { FileSkimmerBackend.GetFile(extensions.Split(new[] { ";" }, StringSplitOptions.RemoveEmptyEntries), FileOpenerStyle.Save, callback); }