/// <summary> /// ボタンイベントを作成する /// </summary> private void AddButtonEvent() { try { CompButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; CompButton.Tag = ProcessModel.GetEndProcessModel(); ErrorButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; ErrorButton.Tag = ProcessModel.GetErrorProcessModel(); WaitRadio.CheckedChanged += WaitRadio_CheckedChanged; NonWaitRadio.CheckedChanged += WaitRadio_CheckedChanged; } catch (Exception ex) { throw Program.ThrowException(ex); } }
/// <summary> /// ボタンイベントをセットする /// </summary> private void AddButtonEvent() { try { CompButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; CompButton.Tag = ProcessModel.GetEndProcessModel(); ErrorButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; ErrorButton.Tag = ProcessModel.GetErrorProcessModel(); VariableButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; VariableButton.Tag = StringValue.VARIABLE_VAR0; } catch (Exception ex) { throw Program.ThrowException(ex); } }
/// <summary> /// ボタンイベントをセットする /// </summary> private void AddButtonEvent() { try { CompButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; CompButton.Tag = ProcessModel.GetEndProcessModel(); ErrorButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; ErrorButton.Tag = ProcessModel.GetErrorProcessModel(); ScrollButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } ScrollType type = (ScrollType)obj; ScrollSpeedTitleLbl.Visible = !(type == ScrollType.スクロールしない || type == ScrollType.None); ScrollSpeedUpDown.Visible = !(type == ScrollType.スクロールしない || type == ScrollType.None); ScrollAmountTitleLbl.Visible = !(type == ScrollType.スクロールしない || type == ScrollType.None); ScrollAmountUpDown.Visible = !(type == ScrollType.スクロールしない || type == ScrollType.None); }; ScrollButton.Tag = ScrollType.スクロールしない; VariableButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; VariableButton.Tag = StringValue.VARIABLE_未設定; MoveMouseButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; MoveMouseButton.Tag = MoveMouseType.移動しない; } catch (Exception ex) { throw Program.ThrowException(ex); } }
/// <summary> /// ボタンイベントを作成する /// </summary> private void AddButtonEvent() { try { CompButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; CompButton.Tag = ProcessModel.GetEndProcessModel(); ErrorButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; ErrorButton.Tag = ProcessModel.GetErrorProcessModel(); ClickPosButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; ClickPosButton.Tag = MouseClickPosition.左クリック; ScrollButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } SetScrollSpeedVisible(); }; ScrollButton.Tag = ScrollType.スクロールしない; PointTypeButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } SetScrollSpeedVisible(); }; PointTypeButton.Tag = PointType.相対座標; } catch (Exception ex) { throw Program.ThrowException(ex); } }
/// <summary> /// ボタンイベントを作成する /// </summary> private void AddButtonEvent() { try { CompButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; CompButton.Tag = ProcessModel.GetEndProcessModel(); ErrorButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; ErrorButton.Tag = ProcessModel.GetErrorProcessModel(); Variable1Button.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; Variable1Button.Tag = StringValue.VARIABLE_VAR0; Variable2Button.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; Variable2Button.Tag = StringValue.VARIABLE_VAR0; ArrayVariableButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; ArrayVariableButton.Tag = StringValue.VARIABLE_ARY_VAR0; CompareTypeButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; CompareTypeButton.Tag = CompareTypeType.文字列; CompareOperatorButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; CompareOperatorButton.Tag = CompareOperatorType.値; CalcButton.OnTagChanged = (BaseButton sender, object obj) => { if (obj != null) { sender.Text = obj.ToString(); } }; CalcButton.Tag = VariableCalcType.加算; VariableRadio.CheckedChanged += VariableRadio_CheckedChanged; ArrayVariableRadio.CheckedChanged += VariableRadio_CheckedChanged; VariableTargetRadio.CheckedChanged += VariableTargetRadio_CheckedChanged; ElementTargetRadio.CheckedChanged += VariableTargetRadio_CheckedChanged; CompareTargetVariableRadio.CheckedChanged += CompareTargetRadio_CheckedChanged;; CompareTargetInputRadio.CheckedChanged += CompareTargetRadio_CheckedChanged; } catch (Exception ex) { throw Program.ThrowException(ex); } }
/// <summary> /// プロジェクトを再構築する /// </summary> /// <param name="model"></param> /// <returns></returns> public static ProjectModel RebuildProject(ProjectModel model) { try { List <ProcessModel> allModel = model.GetOneDimensionProcessModelList(); foreach (var ary in model.ArrayVariableList) { ary.Value.ArrayToList(); } foreach (var proc in model.ProcessModelList) { proc.ByteArrayToBitmap(true); //データはシリアライズされている別オブジェクトなので、IDを元に参照を再設定する if (!string.IsNullOrEmpty(proc.NextProcessId)) { proc.NextProcess = allModel.FirstOrDefault(a => a.ProcessId == proc.NextProcessId) ?? ProcessModel.GetEndProcessModel(); } else { proc.NextProcess = ProcessModel.GetEndProcessModel(); } //データはシリアライズされている別オブジェクトなので、IDを元に参照を再設定する if (!string.IsNullOrEmpty(proc.ErrorProcessId)) { proc.ErrorProcess = allModel.FirstOrDefault(a => a.ProcessId == proc.ErrorProcessId) ?? ProcessModel.GetErrorProcessModel(); } else { proc.ErrorProcess = ProcessModel.GetErrorProcessModel(); } } foreach (var macro in model.MacroModelList) { foreach (var ary in macro.ArrayVariableList) { ary.Value.ArrayToList(); } foreach (var proc in macro.ProcessModelList) { proc.ByteArrayToBitmap(true); //データはシリアライズされている別オブジェクトなので、IDを元に参照を再設定する if (!string.IsNullOrEmpty(proc.NextProcessId)) { proc.NextProcess = allModel.FirstOrDefault(a => a.ProcessId == proc.NextProcessId) ?? ProcessModel.GetEndProcessModel(); } else { proc.NextProcess = ProcessModel.GetEndProcessModel(); } //データはシリアライズされている別オブジェクトなので、IDを元に参照を再設定する if (!string.IsNullOrEmpty(proc.ErrorProcessId)) { proc.ErrorProcess = allModel.FirstOrDefault(a => a.ProcessId == proc.ErrorProcessId) ?? ProcessModel.GetErrorProcessModel(); } else { proc.ErrorProcess = ProcessModel.GetErrorProcessModel(); } } } return(model); } catch (Exception ex) { throw Program.ThrowException(ex); } }