using directPacking;
|
using System;
|
using System.Windows.Forms;
|
|
namespace MyGlassEdit.配置
|
{
|
public partial class 使用设置 : Form
|
{
|
public 使用设置()
|
{
|
InitializeComponent();
|
}
|
|
public 使用设置(参数设定 f)
|
{
|
switch (Setting.language)
|
{
|
case 1://英语
|
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en");
|
|
break;
|
case 2:
|
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("ru");
|
|
break;
|
default:
|
//System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("");
|
break;
|
}
|
InitializeComponent();
|
parent = f;
|
}
|
参数设定 parent;
|
|
public void loadSettings()
|
{
|
|
rBtnNoBHXB.Checked = !globel.IsContainCutEdge;
|
rBtnBHXB.Checked = globel.IsContainCutEdge;
|
|
rBtnArea.Checked = globel.MesUnit == "面积";
|
rBtnPian.Checked = globel.MesUnit == "片";
|
|
rBtnZXSQL.Checked = globel.CarryOutInfoSource == "数据库";
|
rBtnZXFile.Checked = globel.CarryOutInfoSource == "优化文件";
|
|
rBtnPolysList.Checked = globel.SaveResultSource == "成品列表";
|
rBtnOptimaResult.Checked = globel.SaveResultSource == "优化结果";
|
|
txtDefaultDisplayDays.Text = globel.DefaultDisplayDays.ToString();
|
|
txtPolyEdge.Text = globel.PolyEdgeGreaterThanNumRemind.ToString();
|
|
txtAlertDuration.Text = globel.AlertDuration.ToString();
|
|
|
rBtnReStream.Checked = globel.DataReportMode == "数据流";
|
rBtnReOffice.Checked = !rBtnReStream.Checked;
|
|
/*
|
if (globel.ShapeOptima)
|
{
|
rBtnOptima.Checked = globel.ShapeOptima;
|
rBtnNoOptima.Checked = !rBtnOptima.Checked;
|
|
tableLayoutPanel5.Visible = true;
|
label12.Visible = true;
|
}
|
else {
|
tableLayoutPanel5.Visible = radioButton4.Checked;
|
label12.Visible = radioButton4.Checked;
|
}*/
|
}
|
|
public bool save()
|
{
|
try
|
{
|
|
if (Utility.StringUtil.IsValidDecimal(txtDefaultDisplayDays.Text.Trim()))
|
{
|
globel.DefaultDisplayDays = Convert.ToInt32(txtDefaultDisplayDays.Text.Trim());
|
}
|
else
|
{
|
|
globel.ShowFromWarningMessage("默认显示几天内的已优化工程,请输入大于 0 的正整数!",false);
|
return false;
|
}
|
|
if (Utility.StringUtil.IsValidDecimal(txtPolyEdge.Text.Trim()))
|
{
|
globel.PolyEdgeGreaterThanNumRemind = Convert.ToInt32(txtPolyEdge.Text.Trim());
|
}
|
else
|
{
|
globel.ShowFromWarningMessage("优化时,成品存在单边大于多少的成品时提醒设置参数需输入大于等于零的整数!设置为0时,不启动功能");
|
return false;
|
}
|
|
if (Utility.StringUtil.IsValidDecimal(txtAlertDuration.Text.Trim()))
|
{
|
if (Convert.ToInt32(txtAlertDuration.Text.Trim())<1)
|
{
|
globel.ShowFromWarningMessage("消息提示框的默认显示时长需设置为大于等于1的正整数,建议为 3 秒");
|
|
txtAlertDuration.Text = globel.AlertDuration.ToString();
|
return false;
|
}
|
|
globel.AlertDuration = Convert.ToInt32(txtAlertDuration.Text.Trim());
|
}
|
else
|
{
|
globel.ShowFromWarningMessage("消息提示框的默认显示时长需设置为大于等于1的正整数,建议为 3 秒");
|
return false;
|
}
|
|
globel.IsContainCutEdge = rBtnBHXB.Checked;
|
globel.MesUnit = rBtnArea.Checked ? "面积" : "片";
|
globel.SaveResultSource = rBtnPolysList.Checked ? "成品列表" : "优化结果";
|
globel.CarryOutInfoSource = rBtnZXSQL.Checked ? "数据库" : "优化文件";
|
globel.DataReportMode = rBtnReStream.Checked ? "数据流" : "Office插件";
|
return true;
|
}
|
catch (Exception ex)
|
{
|
globel.ShowErrorMessage(Sentences.canshucuowu + ":" + ex.Message);
|
return false;
|
}
|
|
}
|
|
private void 使用设置_Load(object sender, EventArgs e)
|
{
|
loadSettings();
|
}
|
|
}
|
}
|