private void OnExplorerVM_TryOpenExplorer(ExplorerViewModel argSender, string argItemPath) { try { Process.Start("explorer.exe", argItemPath); } catch { this.RunCommand(String.Format("start \"{0}\"", argItemPath)); } }
private void OnExplorerVM_FolderChanged(ExplorerViewModel argSender, string argItemPath) { char tmpOldDrive = this.CurrentFolder[0]; char tmpNewDrive = argItemPath[0]; this.RunCommand("cd " + argItemPath); if (tmpOldDrive != tmpNewDrive) { this.RunCommand(String.Format("{0}:", tmpNewDrive)); } }
protected override void InitializeRuntimeMode() { base.InitializeRuntimeMode(); this.IsBusy = false; this.AutoSyncWithCurrentFolder = true; this.explorerVM = new ExplorerViewModel(this.Dispatcher); this.ExplorerVM.ItemChosen += OnExplorerVM_ItemChosen; this.ExplorerVM.TryOpenExplorer += OnExplorerVM_TryOpenExplorer; this.ExplorerVM.FolderChanged += OnExplorerVM_FolderChanged; this.ExplorerVM.RunFile += OnExplorerVM_RunFile; }
private void OnExplorerVM_ItemChosen(ExplorerViewModel argSender, string argItemPath) { this.CurrentCommand += argItemPath; }
private void OnExplorerVM_RunFile(ExplorerViewModel argSender, string argItemPath) { this.RunCommand(argItemPath); }