C3204
2025-12-18 d85cbf0ccd61d95b96695756e0c90db8b7679545
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Text.RegularExpressions;
using LB_VisionControl.ScriptEditControl.FastColorTextBox;
namespace LB_VisionControl.ScriptEditControl
{
    public partial class ClassFileList : UserControl
    {
        public ClassFileList()
        {
            InitializeComponent();
            LoadFile();
        }
        public FastColoredTextBox fctb { get; set; }
        public void LoadFile()
        {
            if (!Directory.Exists(CommConfig.ClassLibPath))
            {
                textBox1.Text = "无可用文件!";
                return;
 
            }
            foreach (var i in Directory.GetFiles(CommConfig.ClassLibPath))
            {
                listBox1.Items.Add(i);
            }
        }
 
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            string s = File.ReadAllText(listBox1.Text);
            Regex reg = new Regex(@"(?<!/)/\*([^*/]|\*(?!/)|/(?<!\*))*((?=\*/))(\*/)");
            Match m = reg.Match(s, 0);
            if (m.Success)
            {
                textBox1.Text = m.Value;
            }
            else
            {
                textBox1.Text = "无可用数据";
            }
        }
 
        private void listBox1_DoubleClick(object sender, EventArgs e)
        {
            if (fctb != null)
            {
                fctb.Text = File.ReadAllText(listBox1.Text);
            }
        }
    }
}