Пример #1
0
        private void RtpList_SelectedIndexChanged(object sender, EventArgs e)
        {
            int index = RtpList.SelectedIndex;

            if (index >= RtpList.Items.Count || index < 0)
            {
                return;
            }
            Rtp rtp = (Rtp)RtpList.Items[index];

            System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(rtp.Path);
            if (!dir.Exists)
            {
                return;
            }
            RtpInnerList.Clear();
            RtpInnerList.Items.Clear();
            RtpInnerList.AddChildDirectory(dir, rtp.Color, false);
            RtpInnerList.AddChildFile(dir, rtp.Color);
            ViewingRtp = rtp;
            // ==== 移动处理 ====
            btUp.Enabled   = !(RtpList.SelectedIndex == 0);
            btDown.Enabled = !(RtpList.SelectedIndex >= EditingRtps.Count - 1);
            btDel.Enabled  = !rtp.IsFromReg;
            // ==== 赋予处理 ====
            Strtb.Text        = rtp.FullString();
            cbNewRtp.Text     = rtp.Path;
            lbColor.BackColor = rtp.Color;
            // ==================
        }
Пример #2
0
 private void RtpInnerList_DoubleClick(object sender, EventArgs e)
 {
     System.IO.DirectoryInfo dir = RtpInnerList.ChosenDirectory;
     if (dir == null)
     {
         return;
     }
     if (ViewingRtp == null)
     {
         return;
     }
     RtpInnerList.Clear();
     RtpInnerList.Items.Clear();
     RtpInnerList.AddChildDirectory(dir, ViewingRtp.Value.Color, !(dir.FullName == ViewingRtp.Value.Path));
     RtpInnerList.AddChildFile(dir, ViewingRtp.Value.Color);
 }