示例#1
0
        public void SetCtls(StartStopEntity entity)
        {
            if (InvokeRequired)
            {
                this.Invoke(new Action(() =>
                {
                    SetCtls(entity);
                }));
                return;
            }
            LV_StartStop.Items.Clear();
            var properties = entity.GetType().GetProperties();

            foreach (var p in properties)
            {
                var attr = Attribute.GetCustomAttribute(p, typeof(DescriptionAttribute));
                if (null != attr)
                {
                    var desc = (DescriptionAttribute)attr;
                    LV_StartStop.Items.Add(new ListViewItem(new string[] { desc.Name, p.GetValue(entity).ToString() }));
                }
            }
        }
示例#2
0
 public void SetCtls(StartStopEntity entity)
 {
     throw new NotImplementedException();
 }