Example #1
0
 //*************************************************************************************************************
 private void LocalPath_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Down || e.KeyCode == Keys.Up)
     {
         LocalList.LoadList(LocalPath.Text);
     }
 }
Example #2
0
        //*************************************************************************************************************
        private void LocalPath_DropDownClosed(object sender, EventArgs e)
        {
            LocalList.CheckLick = true;
            string path = (LocalPath.SelectedItem == null) ? LocalPath.Text : LocalPath.SelectedItem.ToString();

            LocalList.LoadList(path);
        }
Example #3
0
        //*************************************************************************************************************
        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");
                }
            }
        }