示例#1
0
        private void BtnPasteFilename_DragDrop(object sender, DragEventArgs e)
        {
            List <string> l1 = new List <string>();

            foreach (string _s1 in (string[])e.Data.GetData(DataFormats.FileDrop))
            {
                l1.Add(_s1);
            }
            l1.Sort();

            Clipboard.SetText(RtnShortPath(l1));
            RtbResult.Paste();

            RtbResult.Select(0, 0);
            RtbResult.ScrollToCaret();

            Scr.Visible = false;
        }
示例#2
0
        private void BtnPasteTextfile_DragDrop(object sender, DragEventArgs e)
        {
            StringBuilder sb = new StringBuilder();
            string        s1 = "";

            foreach (string _s1 in (string[])e.Data.GetData(DataFormats.FileDrop))
            {
                (string _s2, string _s3) = RtnTextFileRead(_s1, false, "");
                if (_s2.Length > 0)
                {
                    _ = sb.Append(_s3);
                }
                else
                {
                    if (File.Exists(_s1))
                    {
                        s1 += "・" + Path.GetFileName(_s1) + NL;
                    }
                }
            }

            Clipboard.SetText(Regex.Replace(sb.ToString(), RgxNL, NL));
            RtbResult.Paste();

            RtbResult.Select(0, 0);
            RtbResult.ScrollToCaret();

            Scr.Visible = false;

            if (s1.Length > 0)
            {
                _ = MessageBox.Show(
                    "[Err] テキストファイルではありません。" + NL + NL + s1,
                    ProgramID
                    );
            }
        }
示例#3
0
 private void CmsResult_貼り付け_Click(object sender, EventArgs e)
 {
     Clipboard.SetText(Regex.Replace(RtnClipboard(), RgxNL, NL));
     RtbResult.Paste();
 }