Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            NotepadInfoRepository notepadInfoRepository = new NotepadInfoRepository();
            var infos = notepadInfoRepository.GetInfos();

            listBox1.Items.Clear();
            foreach (var item in infos)
            {
                listBox1.Items.Add($"【{item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")}】{item.NotepadContent}");
            }
        }
Exemplo n.º 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Task.Factory.StartNew(() =>
            {
                NotepadInfoRepository notepadInfoRepository = new NotepadInfoRepository();
                var infos = notepadInfoRepository.GetInfos();
            });

            Application.Run(new Form1());
        }