public void OnOption() { pluginServer.ExecuteCommand(Commands.SetModalState, true); try { using (MigemoOptionForm mof = new MigemoOptionForm(pathDLL, pathDic, fPartialMatch)) { if (DialogResult.OK == mof.ShowDialog()) { pathDLL = mof.pathDLL; pathDic = mof.pathDic; fPartialMatch = mof.fPartialMatch; using (RegistryKey rkMigemo = Registry.CurrentUser.CreateSubKey(CONSTANTS.REGISTRY_PLUGINSETTINGS + "\\MigemoLoader")) { if (rkMigemo != null) { rkMigemo.SetValue("dll", pathDLL); rkMigemo.SetValue("dic", pathDic); rkMigemo.SetValue("PartialMatch", fPartialMatch ? 1 : 0); } } } } } finally { pluginServer.ExecuteCommand(Commands.SetModalState, false); } }
private void ShowHideFolderTree() { const uint FCW_TREE = 0x0003; IntPtr hwndTree; bool fTreeVisible = 0 == shellBrowser.GetControlWindow(FCW_TREE, out hwndTree); pluginServer.ExecuteCommand(Commands.ShowFolderTree, !fTreeVisible); }
public void OnMenuItemClick(MenuType menuType, string menuText, ITab tab) { // user clicked registered menu. if (menuText == "SampleSplitButton Menu test") { if (menuType == MenuType.Tab) { MessageBox.Show(tab.Address.Path); } else if (menuType == MenuType.Bar) { pluginServer.ExecuteCommand(Commands.OpenTabBarOptionDialog, null); } } }
public static bool MoveSelectedToParent(IPluginServer pluginServer) { try { Address[] addresses; if (!pluginServer.TryGetSelection(out addresses) || addresses.Length == 0) { return(false); } string currentPath = pluginServer.SelectedTab.Address.Path; string sourcePaths = FileOps.MakeSourcePaths(addresses); if (sourcePaths.Length < 2 || currentPath.Length < 4) { return(false); } string targetDir = Path.GetDirectoryName(currentPath); if (!String.IsNullOrEmpty(targetDir)) { const int FO_MOVE = 0x0001; const int FO_COPY = 0x0002; const short FOF_ALLOWUNDO = 0x0040; bool fInCompressedFolder = File.Exists(currentPath); // or unknown virtual folder?? TENUKI here bool fCopy = fInCompressedFolder ^ Control.ModifierKeys == Keys.Control; SHFILEOPSTRUCT sfo = new SHFILEOPSTRUCT(); sfo.hwnd = pluginServer.ExplorerHandle; sfo.wFunc = fCopy ? FO_COPY : FO_MOVE; sfo.pFrom = sourcePaths; sfo.pTo = targetDir + "\0"; sfo.fFlags = FOF_ALLOWUNDO; SHFileOperation(ref sfo); pluginServer.ExecuteCommand(Commands.RefreshBrowser, null); return(true); } } catch { } return(false); }
public void OnMenuItemClick(MenuType menuType, string menuText, ITab tab) { // user clicked registered menu. if (menuText == "SampleSplitButton Menu test") { if (menuType == MenuType.Tab) { MessageBox.Show(tab.Address.Path); } else if (menuType == MenuType.Bar) { pluginServer.ExecuteCommand(Commands.OpenTabBarOptionDialog, null); } } if (menuText == "²âÊÔ±êÇ©Ëø¶¨×´Ì¬") { MessageBox.Show("²âÊÔ±êÇ©Ëø¶¨×´Ì¬"); ITab[] tabs = pluginServer.GetTabs(); foreach (ITab iTab in tabs) { MessageBox.Show("" + iTab.Address + "->" + iTab.Locked); } } }
public static bool MoveSelectedToParent(IPluginServer pluginServer) { try { Address[] addresses; if(!pluginServer.TryGetSelection(out addresses) || addresses.Length == 0) return false; string currentPath = pluginServer.SelectedTab.Address.Path; string sourcePaths = FileOps.MakeSourcePaths(addresses); if(sourcePaths.Length < 2 || currentPath.Length < 4) return false; string targetDir = Path.GetDirectoryName(currentPath); if(!String.IsNullOrEmpty(targetDir)) { const int FO_MOVE = 0x0001; const int FO_COPY = 0x0002; const short FOF_ALLOWUNDO = 0x0040; bool fInCompressedFolder = File.Exists(currentPath); // or unknown virtual folder?? TENUKI here bool fCopy = fInCompressedFolder ^ Control.ModifierKeys == Keys.Control; SHFILEOPSTRUCT sfo = new SHFILEOPSTRUCT(); sfo.hwnd = pluginServer.ExplorerHandle; sfo.wFunc = fCopy ? FO_COPY : FO_MOVE; sfo.pFrom = sourcePaths; sfo.pTo = targetDir + "\0"; sfo.fFlags = FOF_ALLOWUNDO; SHFileOperation(ref sfo); pluginServer.ExecuteCommand(Commands.RefreshBrowser, null); return true; } } catch { } return false; }