1
czw
14 小时以前 e97a0f31c187e25d9b2480b6e144648239dae80d
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Runtime.Serialization;
using System.Collections.Concurrent;
using System.ServiceModel;
using GZ.Modular.Log;
using GZ.Modular.Redis;
using MongoDB.Driver;
using Dapper;
namespace GZ.Projects.HnSx
{
    /// <summary>
    /// 变量数据库
    /// </summary>
    public class Tag : System.ComponentModel.INotifyPropertyChanged
    {
        #region 变量
        #region 内置变量
        private Dictionary<string, string> _Languages;
        public Dictionary<string,string> Languages
        {
            get
            {
                return _Languages;
            }
            set
            {
                _Languages = value;
                RaisePropertyChanged("Languages");
            }
        }
 
        private string _Lang;
        public string Lang
        {
            get
            {
                return _Lang;
            }
            set
            {
                _Lang = value;
                RaisePropertyChanged("Lang");
                try
                {
                    if (_Languages.Any())
                    {
                        Application.Current.Resources.MergedDictionaries.Clear();
                        Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri(new StringBuilder().AppendFormat(@"资源/语言/{0}.xaml", _Lang).ToString(), UriKind.Relative) });
                    }
                }
                catch(Exception ex)
                {
                    MessageBox.Show("切换语言异常:" + ex.Message);
                }
            }
        }
        #endregion
        #endregion
        
        #region 变量组
        private TagGroup1 _Group1 = new TagGroup1();
        public TagGroup1 Group1 { get { return _Group1; } set { _Group1=value; RaisePropertyChanged("Group1"); } }
        #endregion
        
        #region 内部类
            public class TagGroup1 : System.ComponentModel.INotifyPropertyChanged
    {
        #region 变量
        private System.UInt16 _Param3_LAST;
        public System.UInt16 Param3_LAST
        {
            get 
            {
    return _Param3_LAST; 
            }
            set 
            {
                _Param3_LAST = value; 
                RaisePropertyChanged("Param3_LAST"); 
            }
        }
        private System.UInt16 _Param3;
        public System.UInt16 Param3
        {
            get 
            {
    return _Param3; 
            }
            set 
            {
                _Param3 = value; 
                RaisePropertyChanged("Param3"); 
            }
        }
        private System.UInt16 _Param4;
        public System.UInt16 Param4
        {
            get 
            {
    return _Param4; 
            }
            set 
            {
                _Param4 = value; 
                RaisePropertyChanged("Param4"); 
            }
        }
        #endregion
        
        #region 变量组
        #endregion
        
        #region 内部类
        
        #endregion
            
        #region 属性变更
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        public void RaisePropertyChanged(string propertyName)
        {
            System.ComponentModel.PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
        #endregion
    }
 
 
        #endregion
            
        #region 属性变更
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        public void RaisePropertyChanged(string propertyName)
        {
            System.ComponentModel.PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
        #endregion
    }
 
}