1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381 |
- using Metis.ParameterSet;
- using PaintDotNet.Base;
- using PaintDotNet.Base.CommTool;
- using PaintDotNet.Base.Enum;
- using PaintDotNet.Base.Functionodel;
- using PaintDotNet.CustomControl;
- using PaintDotNet.Data.Action;
- using PaintDotNet.Data.Param;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Windows.Forms;
- using static Metis.ParameterSet.ImageMenu;
- namespace PaintDotNet.Processing
- {
- /// <summary>
- /// 预处理 - 常规操作
- /// </summary>
- internal class NormalOperationDialog : Form
- {
- /// <summary>
- /// 步长 初始值1,依次增加
- /// </summary>
- string stepLength = "00" + Startup.instance.step_length;
- /// <summary>
- /// 公共按钮
- /// </summary>
- private CommonControlButtons commonControlButtons;
- /// <summary>
- /// 图像面板
- /// </summary>
- private DocumentWorkspaceWindow documentWorkspace;
- /// <summary>
- /// 主工作空间
- /// </summary>
- private AppWorkspace appWorkspace;
- /// <summary>
- /// 当前处理的程序
- /// </summary>
- private ParamObject action;
- /// <summary>
- /// 当前活动的图像
- /// </summary>
- private OpenCvSharp.Mat imageMat;
- /// <summary>
- /// 调用调色板的控件
- /// </summary>
- private Panel panel2;
- /// <summary>
- /// 调色板
- /// </summary>
- private ColorsForm colorsFormGrid;
- /// <summary>
- /// 一些方法用到了微米换算
- /// </summary>
- private double ruleValue = 0.0;
- /// <summary>
- /// 菜单id
- /// </summary>
- private ActionType menuId;
- /// <summary>
- /// stringarry参数高度
- /// </summary>
- private int defaultHeight = 45;
- // <summary>
- /// 如果有参数保存,将参数带入
- /// </summary>
- private Boolean initPamasValues = false;
- /// <summary>
- /// 是否点击过应用按钮
- /// 如果没有点过,直接点确定还需要走一遍方法,
- /// 如果已经点过,直接拿当前图片
- /// </summary>
- private bool applyButtonClick = false;
- private PdnMenuItem MenuItem;
- [Browsable(false)]
- public AppWorkspace AppWorkspace
- {
- get
- {
- return this.appWorkspace;
- }
- set
- {
- this.appWorkspace = value;
- }
- }
- /// <summary>
- /// dialog
- /// </summary>
- /// <param name="appWorkspace"></param>
- /// <param name="menuId">对应菜单的id</param>
- public NormalOperationDialog(AppWorkspace appWorkspace, ActionType menuId, string dialogText,PdnMenuItem menuItem)
- {
- this.menuId = menuId;
- this.MenuItem = menuItem;
- InitializeComponent();
- InitializeLanguageText();
- //
- // 设置Dialog属性
- //
- this.AppWorkspace = appWorkspace;
- this.StartPosition = FormStartPosition.CenterScreen;
- this.Icon = PdnInfo.AppIcon;
- this.Text = dialogText;
- //
- //初始化色板
- //
- this.colorsFormGrid = new ColorsForm();
- this.colorsFormGrid.StartPosition = FormStartPosition.CenterScreen;
- this.colorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.gridColorChanged));
-
- //
- //初始化图像控件
- //
- this.documentWorkspace = new DocumentWorkspaceWindow(appWorkspace);
- this.documentWorkspace.Dock = DockStyle.Fill;
- this.documentWorkspace.HookMouseEvents();
- this.documentWorkspace.AuxiliaryLineEnabled = false;
- this.documentWorkspace.Visible = false;
- this.groupBox1.Controls.Add(documentWorkspace);
- //
- //初始化操作按钮
- //
- this.commonControlButtons = new CommonControlButtons();
- this.commonControlButtons.Dock = DockStyle.Top;
- this.commonControlButtons.Height = 30;
- this.groupBox1.Controls.Add(commonControlButtons);
- this.imageMat = this.appWorkspace.ActiveDocumentWorkspace.CompositionSurface.CreatedAliasedMat();
- Document document = Document.FromImageMat(imageMat.Clone());
- this.documentWorkspace.Document = document;
- this.documentWorkspace.Visible = true;
- this.documentWorkspace.GraphicsList = this.appWorkspace.ActiveDocumentWorkspace.GraphicsList;
- this.documentWorkspace.PhaseModels = this.appWorkspace.ActiveDocumentWorkspace.PhaseModelsForCopy;
- //获取
- //Startup.instance.rules.TryGetValue(MeasurementUnit.Micron, out ruleValue);
- ruleValue = this.AppWorkspace.ActiveDocumentWorkspace.GetRuler(MeasurementUnit.Micron);
- resetNumber();
- InitCommonButtonEvent();
- SpecialAction(menuId, Color.Yellow.ToArgb());
- }
- /*/// <summary>
- /// 主要是为了改变自定义的进度条
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void decimalScopeControl_ValueChangedEvent(object sender, EventArgs e)
- {
- //特殊处理孔洞删除
- if (menuId == ActionType.ActionHoleRemoval)
- {
- 1111111
- }
- }*/
- private void SpecialAction(ActionType menuId, int color)
- {
- //特殊处理孔洞删除
- if (menuId == ActionType.ActionHoleRemoval)
- {
- //this.parametersSettingControl.applyButton.Visible = false;
- /*List<double> oneL = new List<double>();
- oneL.Add(0);
- oneL.Add(double.MaxValue);
- this.action.Lists[1].value = oneL;*/
- List<PhaseModel> phases = this.AppWorkspace.ActiveDocumentWorkspace.PhaseModels.FindAll(a => a.choise == true && a.mat != null);
- if (phases.Count > 0)
- {
- List<PhaseModel> phasesCopy = this.documentWorkspace.PhaseModels.FindAll(a => a.choise == true && a.mat != null);
- for (int i = 0; i < phases.Count; i++)
- {
- PhaseModel model = new PhaseModel();
- model.choise = phases[i].choise;
- model.color = phases[i].color;
- model.name = phases[i].name;
- model.position = phases[i].position;
- model.mat = new OpenCvSharp.Mat();
- phases[i].mat.CopyTo(model.mat);
- this.action.Lists[3].Value = color;
- phasesCopy[i].mat = action.PerformProcess(model, ruleValue);
- this.documentWorkspace.Refresh();
- }
- }
- }
- }
- private void InitCommonButtonEvent()
- {
- this.commonControlButtons.zoomInButton.Click += new EventHandler(zoomInButton_Click);
- this.commonControlButtons.zoomOutButton.Click += new EventHandler(zoomOutButton_Click);
- this.commonControlButtons.zoomToWindowButton.Click += new EventHandler(zoomToWindowButton_Click);
- this.commonControlButtons.actualSizeButton.Click += new EventHandler(actualSizeButton_Click);
- this.commonControlButtons.pointerButton.Click += new EventHandler(pointerButton_Click);
- this.commonControlButtons.mobileModeButton.Click += new EventHandler(mobileModeButton_Click);
- }
- private void zoomInButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomIn();
- }
- private void zoomOutButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomOut();
- }
- private void zoomToWindowButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomBasis = ZoomBasis.FitToWindow;
- }
- private void actualSizeButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomBasis = ZoomBasis.ScaleFactor;
- this.documentWorkspace.ScaleFactor = ScaleFactor.OneToOne;
- }
- private void pointerButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.Pointer;
- }
- private void mobileModeButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.MoveMode;
- }
- /// <summary>
- /// 切换参数
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Radio_CheckedChanged(object sender, EventArgs e)
- {
- //如果是孔洞删除,则判断范围的最大最小值
- if(menuId == ActionType.ActionHoleRemoval)
- {
- if (((RadioButton)sender).Checked)
- {
- GetMinMaxValue();
- }
- /*switch ((FilterParameters)(((RadioButton)sender).Tag))
- {
- case FilterParameters.Area:
- if(((RadioButton)sender).Checked)
- {
- GetMinMaxValue();
- }
- break;
- case FilterParameters.AreaRatio:
- if (((RadioButton)sender).Checked)
- {
- GetMinMaxValue();
- }
- break;
- case FilterParameters.AspectRatio:
- if (((RadioButton)sender).Checked)
- {
- GetMinMaxValue();
- }
- break;
- case FilterParameters.LongTrail:
- if (((RadioButton)sender).Checked)
- {
- GetMinMaxValue();
- }
- break;
- }*/
- }
- }
- private void GetMinMaxValue()
- {
- DecimalScopeControl control = (DecimalScopeControl)(groupBoxParam.Controls.Find("ActionHoleRemoval", false)[0]);
- control.Maximum2 = int.MaxValue;
- this.applyButtonImpl(null, null);
- if(((Action914)action).outmax>-1)
- {
- control.Maximum2 = (decimal)(((Action914)action).outmax);
- }
- }
- private void CheckBox_CheckedChanged(object sender, EventArgs e)
- {
-
- }
-
- /// <summary>
- /// 相颜色点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void panel2_Click(object sender, EventArgs e)
- {
- this.panel2 = ((Panel)sender);
- this.colorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(panel2.BackColor);
- this.colorsFormGrid.ShowDialog();
- }
- /// <summary>
- /// Panel2的调色板颜色改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void gridColorChanged(object sender, EventArgs e)
- {
- Color color = this.colorsFormGrid.UserPrimaryColor.ToColor();
- //更改背景色,触发事件
- this.panel2.BackColor = color;
- ////改变配置文件里面的相颜色
- //this.binaryExtractionModel.PhaseColor = color.ToArgb();
- if (menuId == ActionType.ActionHoleRemoval)
- this.SpecialAction(this.menuId, color.ToArgb());
- //else OpenCvSharp.Mat mat = action.PerformProcess(this.imageMat.Clone());
-
- //关闭色板
- this.colorsFormGrid.Close();
- }
- /// <summary>
- /// 初始化数据
- /// </summary>
- public void InitData()
- {
- if (menuId == ActionType.ActionHoleRemoval)
- {
- GetMinMaxValue();
- }
- }
-
- private void resetNumber()
- {
- switch (menuId)
- {
- //二值操作->腐蚀
- case ActionType.ActionErosion:
- action = new Data.Action.Action903();
- break;
- //二值操作->膨胀
- case ActionType.ActionDilation:
- action = new Data.Action.Action904();
- break;
- //二值操作->粗化
- case ActionType.ActionThickening:
- action = new Data.Action.Action905();
- break;
- //二值操作->细化
- case ActionType.ActionThinning:
- action = new Data.Action.Action906();
- break;
- //二值操作->开运算
- case ActionType.ActionOpenExtraction:
- action = new Data.Action.Action907();
- break;
- //二值操作->闭运算
- case ActionType.ActionCloseExtraction:
- action = new Data.Action.Action908();
- break;
- //二值操作->形态学分割
- case ActionType.ActionMorphologySegment:
- action = new Data.Action.Action909();
- break;
- //二值操作->分水岭分割
- case ActionType.ActionWatershedSegment:
- action = new Data.Action.Action910();
- break;
- //二值操作->去碎屑
- case ActionType.ActionDebris:
- action = new Data.Action.Action911();
- break;
- //二值操作->抽骨架
- case ActionType.ActionSkeleton:
- action = new Data.Action.Action912();
- break;
- //二值操作->孔洞删除
- case ActionType.ActionHoleRemoval:
- action = new Data.Action.Action914();
- break;
- default:
- action = new Data.Action.Action903();
- break;
- }
- for (int i = groupBoxParam.Controls.Count - 1; i > 0; i--)
- {
- if (!groupBoxParam.Controls[i].Name.Equals("button5"))
- groupBoxParam.Controls.RemoveAt(i);
- }
- if (action.Lists == null || action.Lists.Count < 1)
- {
- Label label = new Label();
- label.Left = 7;
- label.Top = 31;
- label.Size = new Size(60, 12);
- label.TextAlign = ContentAlignment.TopLeft;
- label.Text = PdnResources.GetString("Menu.Noparams.text");
- groupBoxParam.Controls.Add(label);
- GetParameters(Startup.instance.binaryActionModel);
- }
- else
- {
- //如果是脚本执行,将参数带入(AppWorkspace.ScriptRunning && AppWorkspace.ScriptCurrentParam != null && AppWorkspace.ScriptCurrentParam.MenuId == action.MenuId);
- if (AppWorkspace.ScriptRunning && AppWorkspace.ScriptCurrentParam != null && AppWorkspace.ScriptCurrentParam.MenuId == action.MenuId)
- {
- foreach (Args arg in action.Lists)
- {
- Args param1 = AppWorkspace.ScriptCurrentParam.Lists.Find(m => m.Key.Equals(arg.Key));
- if (param1.value != null)
- arg.Value = param1.value;
- }
- AppWorkspace.ScriptCurrentParam = null;//阻止第二次进入仍然被赋值参数
- }
- else
- {
- GetParameters(Startup.instance.binaryActionModel);
- }
- int controlsTop = 0;
- //初始化手动控件
- for (int i = 0; i < action.Lists.Count; i++)
- {
- Args args = action.Lists[i];
- if (args is IntegerNumber || args is DecimalNumber || args is OddNumber)
- {
- CustomControl.NumberParamControl numberParam = new CustomControl.NumberParamControl();
- numberParam.Left = 78;
- numberParam.Top = 35 + controlsTop;
- //设置参数范围
- numberParam.paramIndex = 100 + i;
- if (args is DecimalNumber)
- {
- numberParam.DecimalPlaces = ((DecimalNumber)args).DecimalPlaces;
- numberParam.Minimum = (double)((DecimalNumber)args).Min;
- numberParam.Maximum = (double)((DecimalNumber)args).Max;
- }
- else if (args is OddNumber)
- {
- numberParam.Increment = 2;
- numberParam.Minimum = ((OddNumber)args).Min;
- numberParam.Maximum = ((OddNumber)args).Max;
- numberParam.IsOddNumber = true;
- }
- else
- {
- numberParam.DecimalPlaces = 0;
- numberParam.Minimum = ((IntegerNumber)args).Min;
- numberParam.Maximum = ((IntegerNumber)args).Max;
- }
- double fnum = 0;
- if (double.TryParse(args.value.ToString(), out fnum))
- {
- numberParam.Value = fnum;
- }
- groupBoxParam.Controls.Add(numberParam);
- groupBoxParam.Controls.SetChildIndex(numberParam, 100 + i);
- if (args is DecimalNumber)
- {
- numberParam.ValueChanged += new EventHandler(((DecimalNumber)args).numberParam_ValueChanged);
- }
- else if (args is OddNumber)
- {
- numberParam.ValueChanged += new EventHandler(((OddNumber)args).numberParam_ValueChanged);
- }
- else
- {
- numberParam.ValueChanged += new EventHandler(((IntegerNumber)args).numberParam_ValueChanged);
- }
- numberParam.ValueChanged += this.ParameterChangeEvent;
- Label label = new Label();
- label.Left = 19;
- label.Top = 40 + controlsTop;
- label.Size = new Size(53, 12);
- label.TextAlign = ContentAlignment.MiddleRight;
- label.Text = args.name + ":";
- groupBoxParam.Controls.Add(label);
- controlsTop += 45;
- }
- else if (args is ChoiseArray)
- {
- Label label = new Label();
- label.Left = 19;
- label.Top = 40 + controlsTop;
- label.Size = new Size(53, 12);
- label.TextAlign = ContentAlignment.MiddleRight;
- label.Text = args.name + ":";
- groupBoxParam.Controls.Add(label);
- //初始化选项列表
- for (int j = 0; j < args.choiseList.Count; j++)
- {
- BooleanObject argsChoise = args.choiseList[j] as BooleanObject;
- RadioButton radio = new RadioButton();
- if (j == 0)
- {
- radio.Checked = true;
- }
- radio.AutoSize = true;
- radio.Location = new Point(88, 40 + controlsTop);
- radio.Text = argsChoise.name + "";
- radio.Tag = argsChoise.Key;
- radio.CheckedChanged += ((ChoiseArray)args).numberParam_ValueChanged;
- radio.CheckedChanged += Radio_CheckedChanged;
- radio.CheckedChanged += this.ParameterChangeEvent;
- groupBoxParam.Controls.Add(radio);
- controlsTop += 45;
- }
- }
- else if (args is ColorNumber)
- {
- Label label = new Label();
- label.Left = 5;
- label.Top = 40 + controlsTop;
- label.Size = new Size(65, 12);
- label.TextAlign = ContentAlignment.MiddleRight;
- label.Text = args.name + ":";
- groupBoxParam.Controls.Add(label);
- Panel panel = new Panel();
- panel.BackColor = Color.FromArgb(int.Parse(args.Value.ToString()));
- panel.Size = new Size(100, 35);
- panel.Top = 25 + controlsTop;
- panel.Left = 70;
- if (menuId != ActionType.ActionHoleRemoval)
- {
- panel.BackColorChanged += ((ColorNumber)args).numberParam_ValueChanged;
- panel.BackColorChanged += this.ParameterChangeEvent;
- }
- panel.Click += new EventHandler(panel2_Click);
- groupBoxParam.Controls.Add(panel);
- controlsTop += 45;
- }
- else if (args is StringArray)
- {
- Label label = new Label();
- label.Left = 5;
- label.Top = 40 + controlsTop;
- label.Size = new Size(65, 12);
- label.TextAlign = ContentAlignment.MiddleRight;
- label.Text = args.name + ":";
- groupBoxParam.Controls.Add(label);
- Panel panel = new Panel();
- panel.Size = new Size(200, defaultHeight);
- panel.Top = 40 + controlsTop;
- panel.Left = 70;
- int position = 1;
- int topMargin = 0;
- //循环字典,铺多个radio
- foreach (var item in (Dictionary<Enum, object>)(args.initialValue))
- {
- int xvalue = 0;
- if (position % 1 == 0) xvalue = 0;
- if (position % 2 == 0) xvalue = 1;
- //if (position % 3 == 0) xvalue = 2;
- RadioButton radio = new RadioButton();
- if (position == 1)
- {
- radio.Checked = true;
- }
- radio.AutoSize = true;
- radio.Location = new Point(xvalue * 110, topMargin);
- radio.Text = item.Value.ToString();
- radio.Tag = item.Key;
- if (args.value != null && (int)(args.value) == (int)(object)item.Key)
- {
- radio.Checked = true;
- }
- else
- {
- radio.Checked = false;
- }
- radio.CheckedChanged += ((StringArray)args).numberParam_ValueChanged;
- radio.CheckedChanged += Radio_CheckedChanged;
- radio.CheckedChanged += this.ParameterChangeEvent;
- panel.Controls.Add(radio);
- if (position % 2 == 0) topMargin += 25;
- position++;
- }
- groupBoxParam.Controls.Add(panel);
- controlsTop += 45;
- }
- else if (args is DecimalScope)
- {
- DecimalScopeControl decimalScopeControl;
- if (this.menuId == ActionType.ActionHoleRemoval)
- {
- decimalScopeControl = new DecimalScopeControl(PdnResources.GetString("Menu.numberrange.text") + ":", true, 100);
- }
- else
- {
- decimalScopeControl = new DecimalScopeControl(PdnResources.GetString("Menu.numberrange.text") + ":");
- }
- decimalScopeControl.Name = "ActionHoleRemoval";
- decimalScopeControl.Size = new Size(350, 30);
- decimalScopeControl.Top = 45 + controlsTop;
- decimalScopeControl.Left = 5;
- decimalScopeControl.numericUpDown1.Width = 50;
- decimalScopeControl.numericUpDown2.Width = 50;
- decimalScopeControl.DecimalPlaces = 2;
-
- decimalScopeControl.ValueChanged += new EventHandler(((DecimalScope)args).numberScope_ValueChanged);
- decimalScopeControl.ValueChanged += this.ParameterChangeEvent;
-
- groupBoxParam.Controls.Add(decimalScopeControl);
- controlsTop += 45;
- //decimalScopeControl.minValue = ((List<double>)(args.Value))[0];
- //decimalScopeControl.maxValue = ((List<double>)(args.Value))[1];
- //decimalScopeControl.numericUpDown1.Value = (decimal)((List<double>)(args.Value))[0];
- //decimalScopeControl.numericUpDown2.Value = (decimal)((List<double>)(args.Value))[1];
- }
- else if (args is BooleanObject)
- {
- Label label = new Label();
- label.Left = 5;
- label.Top = 40 + controlsTop;
- label.Size = new Size(65, 12);
- label.TextAlign = ContentAlignment.MiddleRight;
- label.Text = args.name + ":";
- groupBoxParam.Controls.Add(label);
- CheckBox checkBox = new CheckBox();
- checkBox.Text = args.name;
- checkBox.Top = 35 + controlsTop;
- checkBox.Left = 70;
- checkBox.Checked = (bool)(((BooleanObject)args).value);
- checkBox.CheckedChanged += new EventHandler(((BooleanObject)args).CheckBox_ValueChanged);
- checkBox.CheckedChanged += new EventHandler(CheckBox_CheckedChanged);
- checkBox.CheckedChanged += this.ParameterChangeEvent;
- groupBoxParam.Controls.Add(checkBox);
- controlsTop += 45;
- }
- }
- }
- InitData();
- }
- private void ParameterChangeEvent(object sender, EventArgs e)
- {
- this.applyButtonClick = false;
- }
- private void BshTransferAdjustDialog_Load(object sender, EventArgs e)
- {
- //设置该参数false,以便方便的从子线程更新UI
- //虽然这种方式省事,但是从严谨的角度考虑,在复杂多线程的情况下不能这样处理
- System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
- //图像名称输入框
- informationControl.fileNameTextBox1.Text = this.Text + "-" + stepLength;
- parametersSettingControl.applyButtonClick += new EventHandler(applyButtonImpl);//注册事件,在窗体中事件处理代码中预览图像处理效果
- parametersSettingControl.sureButtonClick += new EventHandler(sureButtonImpl);//注册事件,在窗体中事件处理代码中预览图像处理效果
- }
- /// <summary>
- /// 应用
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void applyButtonImpl(object sender, EventArgs e)
- {
- ProgressThreadProcClass procClass = new ProgressThreadProcClass();
- int itemCount = 100;
- ProgressThreadProcClass.IFileTransferProgressEvents progressEvents = new ProgressThreadProcClass.IFileTransferProgressEvents();
- System.Threading.ThreadStart copyThreadProc =
- delegate ()
- {
- try
- {
- //如果有选中的相
- List<PhaseModel> phases = this.AppWorkspace.ActiveDocumentWorkspace.PhaseModels.FindAll(a => a.choise == true);
- if (action.MenuId == ActionType.ActionWatershedSegment)
- {
- if (phases.Count > 0)
- {
- List<PhaseModel> phasesCopy = this.documentWorkspace.PhaseModels.FindAll(a => a.choise == true);
- for (int i = 0; i < phases.Count; i++)
- {
- PhaseModel model = new PhaseModel();
- model.choise = phases[i].choise;
- model.color = phases[i].color;
- model.name = phases[i].name;
- model.position = phases[i].position;
- model.mat = new OpenCvSharp.Mat();
- phases[i].mat.CopyTo(model.mat);
- phasesCopy[i].mat = action.PerformProcess(this.imageMat.Clone(), model, new Point()/*ruleValue*/);
- this.documentWorkspace.Refresh();
- }
- }
- else
- {
- OpenCvSharp.Mat mat = action.PerformProcess(this.imageMat.Clone());
- Document doc = Document.FromMat(mat);
- this.documentWorkspace.Document = doc;
- this.documentWorkspace.Refresh();
- }
- return;
- }
- if (phases.Count > 0)
- {
- List<PhaseModel> phasesCopy = this.documentWorkspace.PhaseModels.FindAll(a => a.choise == true);
- for (int i = 0; i < phases.Count; i++)
- {
- if (phases[i].mat != null)
- {
- PhaseModel model = new PhaseModel();
- model.choise = phases[i].choise;
- model.color = phases[i].color;
- model.name = phases[i].name;
- model.position = phases[i].position;
- model.mat = new OpenCvSharp.Mat();
- phases[i].mat.CopyTo(model.mat);
- phasesCopy[i].mat = action.PerformProcess(model, ruleValue);
- this.documentWorkspace.Refresh();
- }
- }
- }
- else
- {
- OpenCvSharp.Mat mat = action.PerformProcess(this.imageMat.Clone());
- Document doc = Document.FromMat(mat);
- this.documentWorkspace.Document = doc;
- this.documentWorkspace.Refresh();
- }
- this.applyButtonClick = true;
- }
- catch(Exception)
- {
- }
- finally
- {
- progressEvents.EndOperation(OperationResult.Finished);
- }
- };
- procClass.StartProgressAction(/*currentForm*/this, itemCount, copyThreadProc, progressEvents, null);
- }
- /// <summary>
- /// 确定
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- internal void sureButtonImpl(object sender, EventArgs e)
- {
- ProgressThreadProcClass procClass = new ProgressThreadProcClass();
- int itemCount = 100;
- ProgressThreadProcClass.IFileTransferProgressEvents progressEvents = new ProgressThreadProcClass.IFileTransferProgressEvents();
- System.Threading.ThreadStart copyThreadProc =
- delegate ()
- {
- try
- {
- if(!this.applyButtonClick)
- {
- //特殊处理孔洞删除
- if (menuId == ActionType.ActionHoleRemoval)
- {
- this.action.Lists[3].value = Color.Transparent.ToArgb();
- }
- //如果有选中的相
- List<PhaseModel> phases = this.AppWorkspace.ActiveDocumentWorkspace.PhaseModels.FindAll(a => a.choise == true);
- if (action.MenuId == ActionType.ActionWatershedSegment)
- {
- if (phases.Count > 0)
- {
- List<PhaseModel> phasesCopy = this.documentWorkspace.PhaseModels.FindAll(a => a.choise == true);
- for (int i = 0; i < phases.Count; i++)
- {
- PhaseModel model = new PhaseModel();
- model.choise = phases[i].choise;
- model.color = phases[i].color;
- model.name = phases[i].name;
- model.position = phases[i].position;
- model.mat = new OpenCvSharp.Mat();
- phases[i].mat.CopyTo(model.mat);
- phasesCopy[i].mat = action.PerformProcess(this.imageMat.Clone(), model, new Point()/*ruleValue*/);
- this.documentWorkspace.Refresh();
- }
- }
- else
- {
- OpenCvSharp.Mat mat = action.PerformProcess(this.imageMat.Clone());
- Document doc = Document.FromMat(mat);
- this.documentWorkspace.Document = doc;
- this.documentWorkspace.Refresh();
- }
- this.Invoke(new EventHandler(delegate
- {
- if (informationControl.radioButton1.Checked)
- {
- this.OpenFileImpl();
- }
- else
- {
- this.AppWorkspace.ActiveDocumentWorkspace.phaseModels = this.documentWorkspace.PhaseModels;
- this.AppWorkspace.ActiveDocumentWorkspace.Refresh();
- }
- this.Close();
- }));
- return;
- }
- if (phases.Count > 0)
- {
- List<PhaseModel> phasesCopy = this.documentWorkspace.PhaseModels.FindAll(a => a.choise == true);
- for (int i = 0; i < phases.Count; i++)
- {
- if (phases[i].mat != null)
- {
- PhaseModel model = new PhaseModel();
- model.choise = phases[i].choise;
- model.color = phases[i].color;
- model.name = phases[i].name;
- model.position = phases[i].position;
- model.mat = new OpenCvSharp.Mat();
- phases[i].mat.CopyTo(model.mat);
- phasesCopy[i].mat = action.PerformProcess(model, ruleValue);
- this.documentWorkspace.Refresh();
- }
- }
- }
- else
- {
- OpenCvSharp.Mat mat = action.PerformProcess(this.imageMat.Clone());
- Document doc = Document.FromMat(mat);
- this.documentWorkspace.Document = doc;
- this.documentWorkspace.Refresh();
- }
- }
- this.Invoke(new EventHandler(delegate
- {
- if (informationControl.radioButton1.Checked)
- {
- this.OpenFileImpl();
- }
- else
- {
- this.AppWorkspace.ActiveDocumentWorkspace.phaseModels = this.documentWorkspace.PhaseModels;
- this.AppWorkspace.ActiveDocumentWorkspace.Refresh();
- }
- this.Close();
- }));
- }
- catch (Exception)
- {
- }
- finally
- {
- progressEvents.EndOperation(OperationResult.Finished);
- }
- };
- procClass.StartProgressAction(/*currentForm*/this, itemCount, copyThreadProc, progressEvents, null);
- /*//生成新图-是
- if (informationControl.radioButton1.Checked)
- {
- //特殊处理孔洞删除
- if (menuId == ActionType.ActionHoleRemoval)
- {
- this.action.Lists[3].value = Color.Transparent.ToArgb();
- }
- if(!this.applyButtonClick)
- {
- this.applyButtonImpl(sender, e);
- }
- this.OpenFileImpl();
- }
- else
- {
- //特殊处理孔洞删除
- if (menuId == ActionType.ActionHoleRemoval)
- {
- this.action.Lists[3].value = Color.Transparent.ToArgb();
- }
- if (!this.applyButtonClick)
- {
- this.applyButtonImpl(sender, e);
- }
- this.AppWorkspace.ActiveDocumentWorkspace.phaseModels = this.documentWorkspace.PhaseModels;
- this.AppWorkspace.ActiveDocumentWorkspace.Refresh();
- }
- this.Close();*/
- }
- /// <summary>
- /// 生成新图
- /// </summary>
- /// <param name="mat"></param>
- private void OpenFileImpl()
- {
- DocumentWorkspace dw = AppWorkspace.AddNewDocumentWorkspace();
- Document document = Document.FromImageMat(this.documentWorkspace.CompositionSurface.CreatedAliasedMat().Clone());//return mat/*.Clone()*/;//待测试
- dw.Document = document;
- dw.PhaseModels = this.documentWorkspace.PhaseModelsForCopy;
- dw.xmlSaveModel = this.AppWorkspace.ActiveDocumentWorkspace.xmlSaveModel;
- dw.rules = new Dictionary<MeasurementUnit, double>(this.AppWorkspace.ActiveDocumentWorkspace.rules);
- //dw.PanelBottom.documentStrip.ShowPictures = false;
- dw.fileText = informationControl.fileNameTextBox1.Text;
- AppWorkspace.ActiveDocumentWorkspace = dw;
- Startup.instance.step_length += 1;
- }
- /// <summary>
- /// 参数-重设
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button5_Click(object sender, EventArgs e)
- {
- GetParameters(Startup.instance.binaryActionModel);
- //初始化/重置参数
- resetNumber();
- }
- #region 设计器
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
- #region Windows Form Designer generated code
- private void InitializeLanguageText()
- {
- this.groupBoxParam.Text = PdnResources.GetString("Menu.params.text");
- this.button5.Text = PdnResources.GetString("Menu.rebuild.Text");
- this.groupBox1.Text = PdnResources.GetString("Menu.Preview.text");
- this.Text = PdnResources.GetString("Menu.geprocessiconditioningsaturationbrigh.Text");
- }
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.parametersSettingControl = new PaintDotNet.CustomControl.ParametersSettingAdjustControl();
- this.informationControl = new PaintDotNet.CustomControl.InformationAdjustControl();
- this.groupBoxParam = new System.Windows.Forms.GroupBox();
- this.button5 = new System.Windows.Forms.Button();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.groupBoxParam.SuspendLayout();
- this.SuspendLayout();
- //
- // parametersSettingControl
- //
- this.parametersSettingControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.parametersSettingControl.Location = new System.Drawing.Point(12, 12);
- this.parametersSettingControl.Name = "parametersSettingControl";
- this.parametersSettingControl.Size = new System.Drawing.Size(822, 58);
- this.parametersSettingControl.TabIndex = 9;
- //
- // informationControl
- //
- this.informationControl.Location = new System.Drawing.Point(12, 76);
- this.informationControl.Name = "informationControl";
- this.informationControl.Size = new System.Drawing.Size(373, 82);
- this.informationControl.TabIndex = 11;
- //
- // groupBoxParam
- //
- this.groupBoxParam.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBoxParam.Controls.Add(this.button5);
- this.groupBoxParam.Location = new System.Drawing.Point(12, 164);
- this.groupBoxParam.Name = "groupBoxParam";
- this.groupBoxParam.Size = new System.Drawing.Size(373, 315);
- this.groupBoxParam.TabIndex = 12;
- this.groupBoxParam.TabStop = false;
- //
- // button5
- //
- this.button5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.button5.Location = new System.Drawing.Point(292, 286);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(75, 23);
- this.button5.TabIndex = 1;
- this.button5.UseVisualStyleBackColor = true;
- this.button5.Click += new System.EventHandler(this.button5_Click);
- //
- // groupBox1
- //
- this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox1.Location = new System.Drawing.Point(392, 77);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(442, 402);
- this.groupBox1.TabIndex = 13;
- this.groupBox1.TabStop = false;
- //
- // NormalOperationDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(846, 491);
- this.Controls.Add(this.groupBox1);
- this.Controls.Add(this.groupBoxParam);
- this.Controls.Add(this.informationControl);
- this.Controls.Add(this.parametersSettingControl);
- this.Name = "NormalOperationDialog";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.NormalOperationDialog_FormClosing);
- this.Load += new System.EventHandler(this.BshTransferAdjustDialog_Load);
- this.groupBoxParam.ResumeLayout(false);
- this.ResumeLayout(false);
- }
- #endregion
- private CustomControl.ParametersSettingAdjustControl parametersSettingControl;
- private CustomControl.InformationAdjustControl informationControl;
- private System.Windows.Forms.GroupBox groupBoxParam;
- private System.Windows.Forms.Button button5;
- private GroupBox groupBox1;
- #endregion
- #region 关闭窗口时,保存参数
- private void NormalOperationDialog_FormClosing(object sender, FormClosingEventArgs e)
- {
- #region [开启脚本录制]
- if (appWorkspace.startScriptRecording)
- {
- getScriptRecording();
- }
- #endregion
- string newpic = 1 + "";
- //获取参数实体
- ImageMenu imageMenu;
- if (Startup.instance.imageMenuModel != null)
- {
- imageMenu = Startup.instance.imageMenuModel;
- }
- else
- {
- imageMenu = new ImageMenu();
- imageMenu.ListParam = new List<ImageParam>();
- }
- //数字控制是否生成新图
- if (informationControl.radioButton1.Checked)
- newpic = 1 + "";
- else
- newpic = 0 + "";
- List<ImageParam> list = imageMenu.ListParam.Where(x => x.menuId == (int)action.MenuId).ToList();
- if (list.Count == 0)
- {
- ImageParam param = new ImageParam();
- param.menuId = (int)action.MenuId;
- param.param_key = "param_newpic";
- param.param_type = -1;
- param.param_value = newpic;
- imageMenu.ListParam.Add(param);
- }
- //判断页面是否有参数
- if (action.lists.Count > 0)
- {
- for (int i = 0; i < action.lists.Count; i++)
- {
- if (list.Count > 0)//是否存过参数
- {
- for (int j = 0; j < imageMenu.ListParam.Count; j++)//给参数实体赋值
- {
- if (imageMenu.ListParam[j].menuId == (int)action.MenuId && imageMenu.ListParam[j].param_key == action.lists[i].key)
- {
- if (action.lists[i].Type == Dtryt.DecimalScope)
- {
- imageMenu.ListParam[j].param_type = (int)action.lists[i].Type;
- imageMenu.ListParam[j].param_value = string.Join(",", ((List<double>)(action.lists[i].Value)).ToArray());
- imageMenu.ListParam[j].value = null;
- }
- else
- {
- imageMenu.ListParam[j].param_type = (int)action.lists[i].Type;
- imageMenu.ListParam[j].param_value = action.lists[i].value.ToString();
- }
- //imageMenu.ListParam[j].param_newpic = informationControl.radioButton1.Checked;
- }
- else if (imageMenu.ListParam[j].menuId == (int)action.MenuId && imageMenu.ListParam[j].param_key == "param_newpic")
- {
- //imageMenu.ListParam[j].param_type = (int)action.lists[i].Type;
- imageMenu.ListParam[j].param_value = newpic;
- //imageMenu.ListParam[j].param_newpic = informationControl.radioButton1.Checked;
- }
- }
- }
- else //如果没保存过新增
- {
- ImageParam param = new ImageParam();
- param.menuId = (int)action.MenuId;
- param.param_key = action.lists[i].key;
- if (action.lists[i].Type == Dtryt.DecimalScope)
- {
- param.param_type = (int)action.lists[i].Type;
- param.param_value = string.Join(",", ((List<double>)(action.lists[i].Value)).ToArray());
- }
- else
- {
- param.param_type = (int)action.lists[i].Type;
- param.param_value = action.lists[i].value.ToString();
- }
-
- imageMenu.ListParam.Add(param);
- }
- }
- }
- else //没有参数,给是否生成新图赋值
- {
- if (list.Count > 0)
- {
- for (int j = 0; j < imageMenu.ListParam.Count; j++)
- {
- if (imageMenu.ListParam[j].menuId == (int)action.MenuId && imageMenu.ListParam[j].param_key == "param_newpic")
- {
- imageMenu.ListParam[j].param_value = newpic;
- }
- }
- }
- }
- Startup.instance.binaryActionModel = imageMenu;
- //按路径和名称保存xml文件
- string userInfoXml = XmlSerializeHelper.XmlSerialize<ImageMenu>(imageMenu);
- //xml保存路径
- string filePath = Application.StartupPath + "\\Config\\" + "Default\\BinaryActionSaving\\ParameterSaving.xml";
- //保存xml
- FileOperationHelper.WriteStringToFile(userInfoXml, filePath, FileMode.Create);
- }
- /// <summary>
- /// 初始化时获取参数
- /// </summary>
- /// <param name="imageMenu">系统读取的参数配置</param>
- public void GetParameters(ImageMenu imageMenu)
- {
- List<ImageParam> list = new List<ImageParam>();
- if (imageMenu.ListParam.Count > 0)
- list = imageMenu.ListParam.Where(x => x.menuId == (int)action.MenuId).ToList();
- if (list.Count > 0)
- {
- initPamasValues = true;
- for (int i = 0; i < action.Lists.Count; i++)
- {
- for (int j = 0; j < list.Count; j++)
- {
- if (list[j].param_key.Equals(action.Lists[i].key))
- {
- if (list[j].param_type == (int)Base.Dtryt.Choise)
- {
- int valueC;
- if (int.TryParse(list[j].param_value.ToString(), out valueC))
- list[j].value = valueC;
- else if (list[j].param_value.ToString() != "")
- list[j].value = list[j].param_value.ToString();
- else
- list[j].value = 1;
- }
- if (list[j].param_type == (int)Base.Dtryt.Interger)
- {
- int valueC;
- if (int.TryParse(list[j].param_value.ToString(), out valueC))
- list[j].value = valueC;
- else
- list[j].value = 0;
- }
- else if (list[j].param_type == (int)Base.Dtryt.Array)
- {
- int valueC;
- if ("Structures".Equals(list[j].param_key))
- {
- foreach (var item in (Dictionary<Enum, object>)(action.Lists[i].initialValue))
- {
- if (list[j].param_value.ToString() == item.Key.ToString())
- {
- valueC = (int)(object)item.Key;
- list[j].value = valueC;
- break;
- }
- }
- }
- else if ("currentPhase".Equals(list[j].param_key))
- {
- foreach (var item in (Dictionary<Enum, object>)(action.Lists[i].initialValue))
- {
- if (list[j].param_value.ToString() == item.Key.ToString())
- {
- valueC = (int)(object)item.Key;
- list[j].value = valueC;
- break;
- }
- }
- }
- else if ("UnitParameters".Equals(list[j].param_key))
- {
- foreach (var item in (Dictionary<Enum, object>)(action.Lists[i].initialValue))
- {
- if (list[j].param_value.ToString() == item.Key.ToString())
- {
- valueC = (int)(object)item.Key;
- list[j].value = valueC;
- break;
- }
- }
- }
- else if ("FilterParameters".Equals(list[j].param_key))
- {
- foreach (var item in (Dictionary<Enum, object>)(action.Lists[i].initialValue))
- {
- if (list[j].param_value.ToString() == item.Key.ToString())
- {
- valueC = (int)(object)item.Key;
- list[j].value = valueC;
- break;
- }
- }
- }
- else if ("FunctionParameters".Equals(list[j].param_key))
- {
- foreach (var item in (Dictionary<Enum, object>)(action.Lists[i].initialValue))
- {
- if (list[j].param_value.ToString() == item.Key.ToString())
- {
- valueC = (int)(object)item.Key;
- list[j].value = valueC;
- break;
- }
- }
- }
- else
- {
- if (int.TryParse(list[j].param_value.ToString(), out valueC))
- list[j].value = valueC;
- else
- list[j].value = 0;
- }
-
- }
- else if (list[j].param_type == (int)Base.Dtryt.Boolean)
- {
- bool valueC;
- if (Boolean.TryParse(list[j].param_value.ToString(), out valueC))
- list[j].value = valueC;
- else
- list[j].value = list[j].param_value.ToString().Equals("0");
- }
- else if (list[j].param_type == (int)Base.Dtryt.DecimalScope)
- {
- string[] valuelst = list[j].param_value.Split(',');
- List<double> listV = new List<double>();
- foreach (string str in valuelst)
- {
- double outV;
- if (double.TryParse(str, out outV))
- listV.Add(outV);
- else
- listV.Add(0);
- }
- list[j].value = listV;
- }
- else if (list[j].param_type == (int)Base.Dtryt.Color)
- {
- int valueC;
- if (int.TryParse(list[j].param_value.ToString(), out valueC))
- list[j].value = valueC;
- else
- list[j].value = -65536;
- }
- action.Lists[i].Type = (Dtryt)list[j].param_type;
- if (list[j].value != null)
- {
- action.Lists[i].value = list[j].value;
- }
- else
- {
- action.Lists[i].value = int.Parse(list[j].param_value);
- }
-
- break;
- }
- }
- }
- for (int j = 0; j < list.Count; j++)
- {
- if ("param_newpic".Equals(list[j].param_key))
- {
- if (list[j].param_value == "1")
- {
- informationControl.radioButton1.Checked = true;
- informationControl.radioButton2.Checked = false;
- }
- else
- {
- informationControl.radioButton1.Checked = false;
- informationControl.radioButton2.Checked = true;
- }
- }
- }
- }
- }
- #endregion
- #region [脚本录制]
- private void getScriptRecording()
- {
- List<Args> args = action.Lists;
- appWorkspace.SetScriptStartRecording(MenuItem.MenuId, MenuItem.Text, args);
- }
- #endregion
- }
- }
|