wangxinhui
2026-04-03 5041a3fe01314dbf404fecc25df56cc2a43ad209
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace WIDESEA_StorageTaskServices
{
    public class PrintStatusContainer
    {
        // 线程安全锁(多线程访问必备)
        private readonly object _lockObj = new object();
        private bool _automaticPrint;
        private string _printIPAddress;
 
        /// <summary>
        /// 自动打印状态(线程安全)
        /// </summary>
        public bool AutomaticPrint
        {
            get
            {
                lock (_lockObj) return _automaticPrint;
            }
            set
            {
                lock (_lockObj) _automaticPrint = value;
            }
        }
 
        /// <summary>
        /// 自动打印的楼层
        /// </summary>
        public string PrintIPAddress
        {
            get
            {
                lock (_lockObj) return _printIPAddress;
            }
            set
            {
                lock (_lockObj) _printIPAddress = value;
            }
        }
    }
}