public void Execute(object parameter) { //MessageBox.Show("HelloWorld"); string writePath = LHregistry.GetFile(FileManager.currentFileId); AdvancedMode.inst.textEditor.Save(writePath); AdvancedMode.UnChangedFile(AdvancedMode.Listbox); }
public AdvancedMode() { InitializeComponent(); LuaFileView.SelectionChanged += LuaFileView_SelectionChanged; FileManager.LoadAllFiles(); inst = this; Focusable = true; StartupValues val = LHregistry.GetStartupValues(); //SimpleMode.LastFileOpened = val.LastSimpleFileSelected; textEditor.FontSize = val.StartFontSize; textEditor.Text = "function Start()\n print(\"preview\")\nend\n\n\n\n\n\n\n\n"; LoadFileFromId(val.StartupFileId); textEditor.InputBindings.Add( new InputBinding(new SaveCommand(), new KeyGesture(Key.S, ModifierKeys.Control) )); textEditor.InputBindings.Add( new InputBinding(new LineToggleCommand(), new KeyGesture(Key.L, ModifierKeys.Control) )); textEditor.ShowLineNumbers = Convert.ToBoolean(val.ShowLineNumbers); //set file view to the listbox Listbox = LuaFileView; StyleLuaListbox(); //get all the filenames from registry int len = LHregistry.GetAllFilenames().Length; for (int i = 0; i < len; i++) { Label txtbox = new Label(); string wholePath = LHregistry.GetAllFilenames()[i]; txtbox.Content = LHregistry.getSimpleName(wholePath); styleLabel(txtbox); txtbox.Foreground = white; txtbox.Background = transparent; LuaFileView.Items.Add(txtbox); } BypassTextChangedEvent = true; //Alle icoontjes PlusIcon.Source = ImageSourceFromBitmap(LeHandUI.Properties.Resources.PALE_GREEN_AddIcon64x64); DeleteIcon.Source = ImageSourceFromBitmap(LeHandUI.Properties.Resources.WASHED_OUT_RED_DeleteIcon64x64); //RefreshIcon.Source = ImageSourceFromBitmap(LeHandUI.Properties.Resources.AQUA_RefreshIcon64x64); //AddReferenceIcon.Source = ImageSourceFromBitmap(LeHandUI.Properties.Resources.AddReference16x16); SaveIcon.Source = ImageSourceFromBitmap(LeHandUI.Properties.Resources.SaveScript64x64); RunPrgmIcon.Source = ImageSourceFromBitmap(LeHandUI.Properties.Resources.StartScript64x64); }
public static void RemoveFile(int id) { //HIER ALREADYREMOVEDID INGEVOERD OM BUG TE VOORKOMEN, namelijk als je twee keer achter elkaar op - klikt in advanced mode, //dan probeert hij een id te verwijderen met een registrykey die niet meer bestaat if (id != -1) //als de id valide is, als er een file geselecteerd is { RegistryKey rk = Registry.CurrentUser.OpenSubKey("Software\\LeHand\\Filenames", true); string[] names = rk.GetValueNames(); if (names.Length >= id) { rk.DeleteValue(names[id]); } } AdvancedMode.Removeluasc(id); }