static void Main() { LogHelper.Init2(); LogHelper.LogInfo("程序启动"); SetInfo.InitSet(); string language = Settings.Default.Set.OtherSet.LanguageType; LanguageHelper.SetLanguage(language); DevExpress.UserSkins.OfficeSkins.Register(); Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { FrmLogin login = new FrmLogin(); if (login.ShowDialog() == DialogResult.OK) { Application.Run(new FormMain()); } } catch (Exception ex) { LogHelper.LogError(ex); } }
public static void InitSet() { if (Settings.Default.Set == null) { SetInfo setInfo = new SetInfo(); setInfo.AxisSet = new AxisSetInfo(); setInfo.IOSet = new IOSetInfo(); setInfo.OtherSet = new OtherSetInfo(); setInfo.AbsolutePosSet = new AbsolutePosSetInfo(); setInfo.ButtonSet = new ButtonSetInfo(); Settings.Default.Set = setInfo; Settings.Default.Save(); } if (Settings.Default.Set.AbsolutePosSet == null) { Settings.Default.Set.AbsolutePosSet = new AbsolutePosSetInfo(); Settings.Default.Save(); } if (Settings.Default.Set.ButtonSet == null) { Settings.Default.Set.ButtonSet = new ButtonSetInfo(); Settings.Default.Save(); } }
private void simpleButton1_Click(object sender, EventArgs e) { SetInfo.Validate(); this.DialogResult = DialogResult.OK; }
public FrmSet(SetInfo info, CardHelper cardHelper, PortHelper _232Helper) { InitializeComponent(); var newInfo = info.Clone(); this.cardHelper = cardHelper; this._232Helper = _232Helper; this.bindingSourceAxis.DataSource = newInfo; this.bindingSourceIO.DataSource = newInfo; this.bindingSourceOther.DataSource = newInfo; this.bindingSourceAbsolutePos.DataSource = newInfo; this.bindingSourceButton.DataSource = newInfo; var table = new DataTable(); table.Columns.Add("ID", typeof(int)); table.Columns.Add("Name"); table.Rows.Add(1, L.R("FrmSet.SimpleWheel", "普通手轮")); table.Rows.Add(2, L.R("FrmSet.AdvWheel", "多功能键手轮")); this.cmbShouLunType.Properties.DataSource = table; this.cmbShouLunType.Properties.DisplayMember = "Name"; this.cmbShouLunType.Properties.ValueMember = "ID"; table = new DataTable(); table.Columns.Add("ID", typeof(int)); table.Columns.Add("Name"); table.Rows.Add(1, L.R("FrmSet.UpLimit", "上负限位")); table.Rows.Add(2, L.R("FrmSet.DownLimit", "下负限位")); this.cmbMinusLimitMode.Properties.DataSource = table; this.cmbMinusLimitMode.Properties.DisplayMember = "Name"; this.cmbMinusLimitMode.Properties.ValueMember = "ID"; table = new DataTable(); table.Columns.Add("ID"); table.Columns.Add("Name"); table.Rows.Add("zh-CN", "中文"); table.Rows.Add("en-US", "English"); this.lueLanguage.Properties.DataSource = table; this.lueLanguage.Properties.DisplayMember = "Name"; this.lueLanguage.Properties.ValueMember = "ID"; table = new DataTable(); table.Columns.Add("ID"); table.Columns.Add("Name"); table.Rows.Add("1", L.R("FrmSet.ScriptMode1", "模式1(多行)")); table.Rows.Add("2", L.R("FrmSet.ScriptMode2", "模式2(单行)")); this.lueScriptMode.Properties.DataSource = table; this.lueScriptMode.Properties.DisplayMember = "Name"; this.lueScriptMode.Properties.ValueMember = "ID"; table = new DataTable(); table.Columns.Add("ID", typeof(int)); table.Columns.Add("Name"); table.Rows.Add(0, L.R("FrmSet.ThrowMode1", "普通穿透")); table.Rows.Add(1, L.R("FrmSet.ThrowMode2", "位置模式穿透")); this.lueThrowMode.Properties.DataSource = table; this.lueThrowMode.Properties.DisplayMember = "Name"; this.lueThrowMode.Properties.ValueMember = "ID"; table = new DataTable(); table.Columns.Add("ID", typeof(int)); table.Columns.Add("Name"); table.Rows.Add(0, L.R("FrmSet.ThrowStartMode1", "穿透信号")); table.Rows.Add(1, L.R("FrmSet.ThrowStartMode2", "最低位置")); this.lueThrowStartMode.Properties.DataSource = table; this.lueThrowStartMode.Properties.DisplayMember = "Name"; this.lueThrowStartMode.Properties.ValueMember = "ID"; }