using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; namespace IStation.Model { /// /// 数据来源 /// public class MonitorDataSources : System.ICloneable { public MonitorDataSources() { } public MonitorDataSources(MonitorDataSources rhs) { this.ID = rhs.ID; this.Name = rhs.Name; this.DataSources = rhs.DataSources; this.DataSourcesMappings = rhs.DataSourcesMappings?.Select(x => new DataSourcesMapping(x)).ToList(); this.Flags = rhs.Flags?.ToList(); this.TagName = rhs.TagName; this.SortCode = rhs.SortCode; this.Description = rhs.Description; } public void Reset(MonitorDataSources rhs) { this.ID = rhs.ID; this.Name = rhs.Name; this.DataSources = rhs.DataSources; this.DataSourcesMappings = rhs.DataSourcesMappings?.Select(x => new DataSourcesMapping(x)).ToList(); this.Flags = rhs.Flags?.ToList(); this.TagName = rhs.TagName; this.SortCode = rhs.SortCode; this.Description = rhs.Description; } /// /// 自增标识 /// [Display(Name = "自增标识")] public long ID { get; set; } /// /// 名称 /// [Display(Name = "名称")] public string Name { get; set; } /// /// 数据来源 /// [Display(Name = "数据来源")] public string DataSources { get; set; } /// /// 数据来源映射列表 /// [Display(Name = "数据来源映射列表")] public List DataSourcesMappings { get; set; } /// /// 标签列表 /// [Display(Name = "标签列表")] public List Flags { get; set; } /// /// 标签 /// [Display(Name = "标签名称")] public string TagName { get; set; } /// /// 排序码 /// [Display(Name = "排序码")] public int SortCode { get; set; } /// /// 说明 /// [Display(Name = "说明")] public string Description { get; set; } public MonitorDataSources Clone() { return (MonitorDataSources)this.MemberwiseClone(); } object ICloneable.Clone() { return this.MemberwiseClone(); } } }