Commit f7f6a7c2 贾鹏旭

注释GC回收

1 个父辈 7dfece50
......@@ -61,7 +61,7 @@ namespace AccAOI
DefaultPath = defaultPath;
}
string CurrentCamera="";
string CurrentCamera = "";
private void FrmAoiSetting_Load(object sender, EventArgs e)
{
LoadTypes();
......@@ -102,7 +102,7 @@ namespace AccAOI
private void btnOpenImage_Click(object sender, EventArgs e)
{
System.Windows.Forms.OpenFileDialog openDialog = new System.Windows.Forms.OpenFileDialog();
openDialog.Title =AOIResourceCulture.GetValue( "打开本地图片");
openDialog.Title = AOIResourceCulture.GetValue("打开本地图片");
openDialog.Filter = "All Supported Images (*.bmp;*.dib;*.rle;*.gif;*.jpg;*.png)|*.bmp;*.dib;*.rle;*.gif;*.jpg;*.png|Bitmaps (*.bmp;*.dib;*.rle)|*.bmp;*.dib;*.rle|Graphics Interchange Format (*.gif)|*.gif|Joint Photographic Experts (*.jpg)|*.jpg|Portable Network Graphics (*.png)|*.png|All Files (*.*)|*.*";
openDialog.DefaultExt = "png";
......@@ -306,7 +306,7 @@ namespace AccAOI
string defaultName = Project.methodMap.Values.Count.ToString().PadLeft(2, '0') + "_" + text;
FrmMethodName frmName = new FrmMethodName(defaultName, new List<string>(Project.methodMap.Keys));
frmName.Text = AOIResourceCulture.GetValue("请输入新【{0}】名称",text);
frmName.Text = AOIResourceCulture.GetValue("请输入新【{0}】名称", text);
DialogResult result = frmName.ShowDialog();
if (result.Equals(DialogResult.OK))
{
......@@ -421,14 +421,14 @@ namespace AccAOI
}
}
private void aoiList_IndexChanged(object sender )
private void aoiList_IndexChanged(object sender)
{
// int index = aoiList.SelectedIndex;
if (aoiList.SelectedIndex >= 0 && (Project != null))
{
string text = aoiList.Text;
// List<AoiMethod> methods = new List<AoiMethod>(Project.methodMap.Values);
if (Project.methodMap.ContainsKey(text ))
if (Project.methodMap.ContainsKey(text))
{
AoiMethod method = Project.methodMap[text];
if (aoiControl != null && aoiControl.TitleName.Equals(method.MethodName))
......@@ -507,9 +507,9 @@ namespace AccAOI
}
else
{
lblTestResult.Text = ControlUtil. GetResultsStr(result);
lblTestResult.Text = ControlUtil.GetResultsStr(result);
}
GC.Collect();
//GC.Collect();
CanSel = true;
}
......@@ -638,7 +638,7 @@ namespace AccAOI
private void btnUpdateName_Click(object sender, EventArgs e)
{
// int index = aoiList.SelectedIndex;
if (aoiList.SelectedIndex >= 0 && (Project != null)&&(aoiControl!=null))
if (aoiList.SelectedIndex >= 0 && (Project != null) && (aoiControl != null))
{
string oldName = aoiList.Text;
......@@ -653,7 +653,7 @@ namespace AccAOI
DialogResult result = frmName.ShowDialog();
if (result.Equals(DialogResult.OK))
{
string newName= frmName.MethodName;
string newName = frmName.MethodName;
if (newName.Equals(oldName))
{
return;
......@@ -714,7 +714,8 @@ namespace AccAOI
needSaveImage.Save(fileName, ImageFormat.Bmp);
MyMessage.Show("保存成功");
}
}catch(Exception ex)
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!