using OpenTap; using OpenTap.Addin; using OpenTap.Addin.Annotation; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; using System.Xml.Serialization; namespace AddInPlugin.Setting { public enum ReportType { TXT = 0, HTML = 1 } public class LangInfo { public LangInfo(string code, string name) { Code = code; Name = name; } public string Code { get; private set; } public string Name { get; private set; } } [Display("Station", "Station Settings")] public class StationSettings : ComponentSettings { [Display("字体大小", Group: "General", Order: 1)] public double FontSize { get; set; } = 14; [Display("报告类型", Group: "General", Order: 2)] public ReportType ReportType { get; set; } = ReportType.HTML; /// /// Where the session logs are saved. Must be a valid path. /// [Display("报告路径", Group: "General", Order: 3, Description: "存放报告")] [FilePath(FilePathAttribute.BehaviorChoice.Save, IsFolder: true)] public string ReportPath { get; set; } = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Report"); [Display("语言", Group: "General", Order: 3, Description: "系统语言")] [DynamicSelect("LangSource", "Name", "Code")] public string Lang { get; set; } = "zh-CN"; [XmlIgnore] public ObservableCollection LangSource { get; set; } = new ObservableCollection() { new LangInfo("zh-CN","中文"), new LangInfo("en-US","English") }; // public ObservableCollection [Display("123", Group: "General", Order: 3, Description: "存放报告")] public ObservableCollection StationGlobals = new ObservableCollection() { new TestVariable() { Name = "StationGlobal1", Value = "Value1" }, }; } }