schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using XCoreBLL.Resource;
using XImagingXhandler.XDAL;
 
namespace XCore
{
    public class SetVariableBll
    {
 
        string strCurrentCulture = "";
        public SetVariableBll()
        {
            strCurrentCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
        }
        #region 检查所有属性设置是否满足要求
        /// <summary>
        /// 检查所有属性设置是否满足要求
        /// </summary>
        /// <param name="methodAspirate">循环属性对象</param>
        /// <returns>检查所有属性设置是否满足要求</returns>
        public MethodPropertyInfo CheckProperty(MethodSetVariable methodSetVariable)
        {
            MethodPropertyInfo methodPropertyInfo = new MethodPropertyInfo();
 
            if (strCurrentCulture == "zh-CN")
            {
                methodPropertyInfo.property_tips_info = SetVariableResourceCHS.tipsInfo.ToString();
 
                if (methodSetVariable.variablename == null || methodSetVariable.variablename == "")
                {
                    methodPropertyInfo.property_name_info = SetVariableResourceCHS.variablename.ToString();
                }
                if (methodSetVariable.variablevalue == null || methodSetVariable.variablevalue == "")
                {
                    methodPropertyInfo.property_name_info = SetVariableResourceCHS.variablevalue.ToString();
                }
            }
            else if (strCurrentCulture == "en-US")
            {
                methodPropertyInfo.property_tips_info = SetVariableResourceENU.tipsInfo.ToString();
 
                if (methodSetVariable.variablename == null || methodSetVariable.variablename == "")
                {
                    methodPropertyInfo.property_name_info = SetVariableResourceENU.variablename.ToString();
                }
                if (methodSetVariable.variablevalue == null || methodSetVariable.variablevalue == "")
                {
                    methodPropertyInfo.property_name_info = SetVariableResourceENU.variablevalue.ToString();
                }
            }
            return methodPropertyInfo;
        }
        #endregion
 
        /// <summary>
        /// 生成设置变量方法的xml节点属性对象
        /// </summary>
        /// <param name="xmlNode">设置变量方法的xml节点</param>
        /// <returns>设置变量方法的xml节点属性对象</returns>
        public MethodSetVariable GenerateMethodSetVariable(XmlNode xmlNode)
        {
            MethodSetVariable methodSetVariable = new MethodSetVariable();
            methodSetVariable.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
            methodSetVariable.status = xmlNode.SelectSingleNode("status").InnerText;
            methodSetVariable.name = xmlNode.SelectSingleNode("name").InnerText;
            methodSetVariable.strIndex = xmlNode.SelectSingleNode("strIndex").InnerText;
            methodSetVariable.label = xmlNode.SelectSingleNode("label").InnerText;
            methodSetVariable.enablepopwin = xmlNode.SelectSingleNode("enablepopwin").InnerText.ToLower() == "true" ? true :false ;
            methodSetVariable.variablename = xmlNode.SelectSingleNode("variablename").InnerText;
            methodSetVariable.variablevalue = xmlNode.SelectSingleNode("variablevalue").InnerText;
            return methodSetVariable;
        }
    }
}