//************************************************************************************************************* private async void RemotePath_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Down || e.KeyCode == Keys.Up) { await RemoteList.LoadList(RemotePath.Text); } }
//************************************************************************************************************* public async Task CheckLink(string path, bool local) { if (SkipCheckLink) { SkipCheckLink = false; return; } //TODO: Move this into the Config using (XwDbCommand sql = new XwDbCommand(Config.GetConnectionString(), "Data.SQLite")) { sql.AddParameter("Local", local); sql.ExecuteTX($@"SELECT l.[path] FROM pins p INNER JOIN pins l ON l.ID=p.LinkTo WHERE p.Local=@Local AND p.path='{path}' AND p.ServerID={server.ID}"); if (sql.Read()) { LinkPath.Tag = true; LinkPath.Image = Resources.link; string link = sql.Value(0).ToString(); linkTip.SetToolTip(LinkPath, "Unlink folders"); if (local) { await RemoteList.LoadList(link); } else { LocalList.LoadList(link); } } else { LinkPath.Tag = false; LinkPath.Image = Resources.link_break; linkTip.SetToolTip(LinkPath, "Link local and remote folders"); } } }
//************************************************************************************************************* private async void RemotePath_DropDownClosed(object sender, EventArgs e) { RemoteList.CheckLick = true; string path = (RemotePath.SelectedItem == null) ? RemotePath.Text : RemotePath.SelectedItem.ToString(); await RemoteList.LoadList(path); }