Example #1
0
        static void Main(string[] args)
        {
            //SAPTestHelper.Current.SetSession();
            //SAPTestHelper.Current.MainWindow.FindDescendantByProperty<GuiOkCodeField>().Text = "SE16";
            //DataDemo.GetStudent();
            //SAPTestHelper.Current.SetSession();

            DataDemo.Recursion();
            Console.ReadLine();
        }
Example #2
0
        public void Run()
        {
            // 创建生产者
            var producer = new Producer();

            // 从当前组件中查找消费者进行注册
            producer.Register();

            Console.WriteLine($"\r\n主线程ID:{Thread.CurrentThread.ManagedThreadId}\r\n");

            // 测试发消息
            var data = new DataDemo {
                Xxx = "haha"
            };

            producer.Publish("aaa", 111, data, DateTime.Now);

            // 用线程发3条消息
            new Thread(() => {
                Console.WriteLine($"\r\nddd1线程ID:{Thread.CurrentThread.ManagedThreadId}\r\n");
                producer.Publish("ddd1");
            }).Start();
            new Thread(() => {
                Console.WriteLine($"\r\nddd2线程ID:{Thread.CurrentThread.ManagedThreadId}\r\n");
                producer.Publish("ddd2");
            }).Start();
            new Thread(() => {
                Console.WriteLine($"\r\nddd3线程ID:{Thread.CurrentThread.ManagedThreadId}\r\n");
                producer.Publish("ddd3");
            }).Start();

            // 等10秒释放生产者
            new Thread(() => {
                Thread.Sleep(10000);
                producer.Dispose();
            }).Start();
        }
Example #3
0
 void OpenOrCreateData()
 {
     data  = EaFile.Open <DataDemo> ();
     data1 = EaFile.Open <DataDemo> ("anotherData");
 }