//──────────────────────────────────────── public override void Translate_Step2( ConfigurationtreeToFunction_Item parentProcesser, Configurationtree_Node action_Conf, Expression_Node_Function parent_Expr_Func,//todo:何これ? MemoryApplication owner_MemoryApplication, Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog, Log_Reports log_Reports ) { Expression_Node_String ec_ArgListboxName; parent_Expr_Func.TrySelectAttribute(out ec_ArgListboxName, Expression_Node_Function20Impl.PM_NAME_CONTROL_LISTBOX, EnumHitcount.One_Or_Zero, log_Reports); if ("" == ec_ArgListboxName.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports)) { // 引数 listboxFcName が指定されていない場合は、その記述が書かれているコントロールの名前を入れる。 Configuration_Node cf_Event = action_Conf.GetParentByNodename( NamesNode.S_EVENT, EnumConfiguration.Unknown, true, log_Reports); if (log_Reports.Successful) { Configuration_Node parent_Configurationtree_Control = cf_Event.GetParentByNodename( NamesNode.S_CONTROL1, EnumConfiguration.Tree, true, log_Reports); string sName_Usercontrol; ((Configurationtree_Node)parent_Configurationtree_Control).Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Usercontrol, true, log_Reports); ec_ArgListboxName.AppendTextNode(sName_Usercontrol, action_Conf, log_Reports); } } }
public override Expression_Node_Function NewInstance( Expression_Node_String parent_Expression, Configuration_Node cur_Conf, object owner_MemoryApplication, Log_Reports pg_Logging) { Log_Method pg_Method = new Log_MethodImpl(0); pg_Method.BeginMethod(Info_CSVEditorImpl.Name_Library, this, "NewInstance", pg_Logging); // Expression_Node_Function f0 = new Expression_Node_Function_BootCsvEditorExImpl(this.EnumEventhandler, this.List_NameArgumentInitializer, this.Functiontranslatoritem); f0.Parent_Expression = parent_Expression; f0.Cur_Configuration = cur_Conf; ((Expression_Node_FunctionAbstract)f0).Owner_MemoryApplication = (MemoryApplication)owner_MemoryApplication; //関数名初期化 f0.Dictionary_Expression_Attribute.Set(PmNames.S_NAME.Name_Pm, new Expression_Leaf_StringImpl(NAME_FUNCTION, null, cur_Conf), pg_Logging); //「プロジェクト選択時」のイベントハンドラーを上書き要求。 { Expression_Node_Function expr_Func2 = Collection_Function.NewFunction2( Expression_Node_Function_OnEditorSelected_Impl.NAME_FUNCTION, f0, cur_Conf, //EnumEventhandler.Tp_B_Wr_Rhn, owner_MemoryApplication, pg_Logging); ((Expression_Node_Function_BootCsvEditorExImpl)f0).Functionitem_OnProjectSelected = expr_Func2; } // pg_Method.EndMethod(pg_Logging); return(f0); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── public override void Translate_Step2( ConfigurationtreeToFunction_Item parentProcesser, Configurationtree_Node action_Conf, Expression_Node_Function parent_Expr_Func,//todo:何これ? MemoryApplication owner_MemoryApplication, Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog, Log_Reports log_Reports ) { Expression_Node_String ec_ArgListboxName; parent_Expr_Func.TrySelectAttribute(out ec_ArgListboxName, Expression_Node_Function20Impl.PM_NAME_CONTROL_LISTBOX, EnumHitcount.One_Or_Zero, log_Reports); if ("" == ec_ArgListboxName.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports)) { // 引数 listboxFcName が指定されていない場合は、その記述が書かれているコントロールの名前を入れる。 Configuration_Node cf_Event = action_Conf.GetParentByNodename( NamesNode.S_EVENT, EnumConfiguration.Unknown, true, log_Reports); if (log_Reports.Successful) { Configuration_Node parent_Configurationtree_Control = cf_Event.GetParentByNodename( NamesNode.S_CONTROL1, EnumConfiguration.Tree, true, log_Reports); string sName_Usercontrol; ((Configurationtree_Node)parent_Configurationtree_Control).Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Usercontrol, true, log_Reports); ec_ArgListboxName.AppendTextNode(sName_Usercontrol, action_Conf, log_Reports); } } }
protected void Set_OnWrRhn( Expression_Node_Function expr_Func, object prm_Sender, Log_Reports prm_D_LoggingBuffer ) { expr_Func.EnumEventhandler = EnumEventhandler.O_Lr; expr_Func.Functionparameterset.Sender = prm_Sender; }
//──────────────────────────────────────── public virtual void Translate_Step2( ConfigurationtreeToFunction_Item parentProcesser, Configurationtree_Node action_Conf, Expression_Node_Function parent_Ec_Sf,//todo:何これ? MemoryApplication owner_MemoryApplication, Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog, Log_Reports log_Reports ) { }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── /// <summary> /// Exe_2ActionImpl#SToFc で使用。 /// </summary> /// <param name="s_Action"></param> /// <param name="bRequired"></param> /// <param name="log_Reports"></param> /// <returns></returns> public Expression_Node_Function Translate( Configurationtree_Node action_Conf, bool bRequired, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Translate", log_Reports); // // string sName_Fnc; if (action_Conf.Dictionary_Attribute.ContainsKey(PmNames.S_NAME.Name_Pm)) { action_Conf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Fnc, true, log_Reports); } else { sName_Fnc = "<エラー:" + log_Method.Fullname + ">"; } Expression_Node_Function expr_Func = Collection_Function.NewFunction2(sName_Fnc, null, action_Conf, this.Owner_MemoryApplication, log_Reports); if (log_Reports.Successful) { if (null != expr_Func) { Log_TextIndented_ConfigurationtreeToExpressionImpl pg_ParsingLog = new Log_TextIndented_ConfigurationtreeToExpressionImpl(); pg_ParsingLog.BEnabled = false; expr_Func = ((Expression_Node_FunctionAbstract)expr_Func).Functiontranslatoritem.Translate( sName_Fnc, action_Conf,//これは生成時に指定できない? pg_ParsingLog, this.Owner_MemoryApplication, log_Reports ); if (Log_ReportsImpl.BDebugmode_Static && pg_ParsingLog.BEnabled) { log_Method.WriteInfo_ToConsole(" pg_ParsingLog=" + Environment.NewLine + pg_ParsingLog.ToString()); } } } goto gt_EndMethod; // gt_EndMethod: log_Method.EndMethod(log_Reports); return(expr_Func); }
protected void Set_OnDnD( Expression_Node_Function expr_Func, object prm_Sender, GiveFeedbackEventArgs prm_E ) { if (null != expr_Func)//暫定 { expr_Func.EnumEventhandler = EnumEventhandler.O_Gfea; expr_Func.Functionparameterset.Sender = prm_Sender; expr_Func.Functionparameterset.GiveFeedbackEventArgs = prm_E; } }
protected void Set_OnEditorSelected( Expression_Node_Function expr_Func, object prm_Sender, object prm_St_selectedEditorElm,//St_ProjectElm bool prm_ProjectValid, Log_Reports prm_D_LoggingBuffer ) { expr_Func.EnumEventhandler = EnumEventhandler.Editor_B_Lr; expr_Func.Functionparameterset.Sender = prm_Sender; expr_Func.Functionparameterset.SelectedProjectElement_Configurationtree = prm_St_selectedEditorElm; expr_Func.Functionparameterset.IsProjectValid = prm_ProjectValid; }
protected void Set_OnQueryContinueDragEventArgs( Expression_Node_Function expr_Func, object prm_Sender, QueryContinueDragEventArgs prm_E ) { if (null != expr_Func)//暫定 { expr_Func.EnumEventhandler = EnumEventhandler.O_Qcdea; expr_Func.Functionparameterset.Sender = prm_Sender; expr_Func.Functionparameterset.QueryContinueDragEventArgs = prm_E; } }
protected void Set_OnKey( Expression_Node_Function expr_Func, object prm_Sender, KeyEventArgs prm_E ) { if (null != expr_Func)//暫定 { expr_Func.EnumEventhandler = EnumEventhandler.O_Kea; expr_Func.Functionparameterset.Sender = prm_Sender; expr_Func.Functionparameterset.KeyEventArgs = prm_E; } }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── /// <summary> /// 関数を登録します。 /// </summary> /// <param name="sName_Fnc"></param> /// <param name="expr_Func"></param> public static void SetFunction(string sName_Fnc, Expression_Node_Function expr_Func, Log_Reports log_Reports) { Log_Method log_Method = new Log_MethodImpl(1); log_Method.BeginMethod(Info_Functions.Name_Library, "Collection_Function", "SetFunction", log_Reports); // dictionary_Interlibrary[sName_Fnc] = expr_Func; if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("関数[" + sName_Fnc + "]を登録しました。dictionary.count=[" + dictionary_Interlibrary.Count + "]"); } // log_Method.EndMethod(log_Reports); }
protected string Set_OnLstBox( Expression_Node_Function expr_Func, object prm_Sender, object prm_ItemValue, Log_Reports prm_D_LoggingBuffer ) { if (null != expr_Func)//暫定 { expr_Func.EnumEventhandler = EnumEventhandler.O_Lr; expr_Func.Functionparameterset.Sender = prm_Sender; expr_Func.Functionparameterset.ItemValue = prm_ItemValue; } return(""); }
//──────────────────────────────────────── /// <summary> /// ユーザー定義関数を登録します。 /// </summary> /// <param name="sName"></param> /// <param name="e_Func"></param> /// <param name="log_Reports"></param> public void AddFunction(string sName, Expression_Node_Function ec_CommonFunction, Log_Reports log_Reports) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "AddFunc", log_Reports); if (log_Method.CanDebug(1)) { } // // if (this.dictionary_Item.ContainsKey(sName)) { goto gt_Error_Exists; } this.dictionary_Item.Add(sName, ec_CommonFunction); if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole(" ユーザー定義関数の追加登録 [" + sName + "]"); } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_Exists: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲設定エラー101!", log_Method); r.Message = "ユーザー定義関数[" + sName + "]は既に定義されていますが、さらに定義されました。同じ名前のユーザー定義関数は1つしか定義してはいけません。"; log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// ユーザー定義関数を取得。 /// </summary> /// <param name="e_Func"></param> /// <param name="sCall"></param> /// <param name="log_Reports"></param> /// <returns></returns> public bool TryGetFunction(out Expression_Node_Function ec_CommonFunction, string sCall, Log_Reports log_Reports) { bool bResult; if (!this.dictionary_Item.ContainsKey(sCall)) { bResult = false; ec_CommonFunction = null; } else { bResult = true; ec_CommonFunction = this.dictionary_Item[sCall]; } return(bResult); }
protected void Set_OnImgDropB( Expression_Node_Function expr_Func, object prm_Sender, DragEventArgs prm_E, Point prm_ParentLocation, string prm_Fpatha_Image, Bitmap prm_DroppedBitmap, Log_Reports prm_D_LoggingBuffer ) { if (null != expr_Func)//暫定 { expr_Func.EnumEventhandler = EnumEventhandler.O_Dea_P_S_B_Lr; expr_Func.Functionparameterset.Sender = prm_Sender; expr_Func.Functionparameterset.DragEventArgs = prm_E; expr_Func.Functionparameterset.ParentLocation = prm_ParentLocation; expr_Func.Functionparameterset.Filepathabsolute_Image = prm_Fpatha_Image; expr_Func.Functionparameterset.DroppedBitmap = prm_DroppedBitmap; } }
protected void Set_OnImgDrop( Expression_Node_Function expr_Func, object prm_Sender, DragEventArgs prm_E, Point prm_ParentLocation, string prm_DebugMessage1, string prm_DebugStatusResultMessage, Log_Reports prm_D_LoggingBuffer ) { if (null != expr_Func)//暫定 { expr_Func.EnumEventhandler = EnumEventhandler.O_Dea_P_S_S_Lr; expr_Func.Functionparameterset.Sender = prm_Sender; expr_Func.Functionparameterset.DragEventArgs = prm_E; expr_Func.Functionparameterset.ParentLocation = prm_ParentLocation; expr_Func.Functionparameterset.Message_Debug1 = prm_DebugMessage1; expr_Func.Functionparameterset.Message_DebugStatusResult = prm_DebugStatusResultMessage; } }
/// <summary> /// (17b)今日の分のバックアップを取ります。 /// </summary> /// <param name="e_FpathList_BackupRequest"></param> /// <param name="sender"></param> /// <param name="eventMonitor_Dammy"></param> /// <param name="log_Reports"></param> protected virtual void On_P17b_DateBackup( List <Expression_Node_Filepath> listExpression_Filepath_BackupRequest, object sender, Log_Reports log_Reports) { if (log_Reports.Successful) { Expression_Node_Function expr_Func = Collection_Function.NewFunction2( Expression_Node_Function44Impl.NAME_FUNCTION, this, this.Cur_Configuration, this.Owner_MemoryApplication, log_Reports); { ((Expression_Node_Function44Impl)expr_Func).Expression_FilepathList_Backup = listExpression_Filepath_BackupRequest; } expr_Func.Execute4_OnLr( sender, log_Reports ); } }
//──────────────────────────────────────── protected virtual string E_Execute_NoUse( Expression_Node_Function ec_CommonFunction, string sLibraryName, string sClassName, string sMethodName, EnumEventhandler enumEH, Configuration_Node conf_Node, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Expr.Name_Library, this, "E_Execute_NoUse", log_Reports); // // string sResult = ""; //#このルートはエラー { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, log_Method.Fullname, log_Reports); //問題の起こったメソッド tmpl.SetParameter(2, enumEH.ToString(), log_Reports); //イベントハンドラー string sFncName0; ec_CommonFunction.TrySelectAttribute(out sFncName0, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); tmpl.SetParameter(3, sFncName0, log_Reports); //関数名 tmpl.SetParameter(4, Log_RecordReportsImpl.ToText_Configuration(conf_Node), log_Reports); //設定位置パンくずリスト this.Owner_MemoryApplication.CreateErrorReport("Er:6039;", tmpl, log_Reports); } // ((E_SysFncAbstract)this.E_SystemAction).EventMonitor.BNowActionWorking = false; // // log_Method.EndMethod(log_Reports); return(sResult); }
//──────────────────────────────────────── /// <summary> /// UsercontrolPerformerImpl#Perform_FcImpl で使用。 /// UsercontrolPerformerImpl#Perform で使用。 /// /// cf_Eventは、ucFc.ControlCommon.Configurationtree_Control.SDic_Event から取っている。 /// </summary> /// <param name="sender"></param> /// <param name="event_Conf"></param> /// <param name="moWorkbench"></param> /// <param name="log_Reports"></param> public void Execute2_Event( object sender, Configurationtree_Node event_Conf, MemoryApplication owner_MemoryApplication, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(1, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute2_Event", log_Reports); Configurationtree_Node cf_ThisMethod = new Configurationtree_NodeImpl("<" + log_Method.Fullname + ":>", null); if (log_Reports.CanStopwatch) { // コメント作成 { StringBuilder sb = new StringBuilder(); string sName_Control; { Configuration_Node owner_Configurationtree_Control = event_Conf.GetParentByNodename( NamesNode.S_CONTROL1, EnumConfiguration.Tree, true, log_Reports); ((Configurationtree_Node)owner_Configurationtree_Control).Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Control, false, log_Reports); } string sEventName; { event_Conf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sEventName, false, log_Reports); } int nActionCount; { nActionCount = event_Conf.List_Child.Count; } sb.Append(Info_Functions.Name_Library); sb.Append(":"); sb.Append(this.GetType().Name); sb.Append("#ToString: イベント計測 "); sb.Append(" FC["); sb.Append(sName_Control); sb.Append("].EV["); sb.Append(sEventName); sb.Append("]"); if (0 < nActionCount) { sb.Append("アクション数=["); sb.Append(nActionCount); sb.Append("]"); } log_Method.Log_Stopwatch.Message = sb.ToString(); log_Method.Log_Stopwatch.Begin(); } } // ステータスバーに表示する文字列。 { if (sender is Customcontrol) { Customcontrol ccFc = (Customcontrol)sender; if (null == ccFc.ControlCommon.Owner_MemoryApplication) { log_Method.WriteDebug_ToConsole("null==ccFc.ControlCommon.Owner_MemoryApplication がヌルでした。"); } else { ccFc.ControlCommon.Owner_MemoryApplication.MemoryForms.AddStatus_ActionUsercontrolNameBegin(log_Reports); string sName_Usercontrol = sName_Usercontrol = ccFc.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports); ccFc.ControlCommon.Owner_MemoryApplication.MemoryForms.AddStatus_ActionUsercontrolName(sName_Usercontrol, log_Reports); } } } event_Conf.List_Child.ForEach(delegate(Configurationtree_Node s_Action, ref bool bBreak) { Executer3_FunctionImpl exe2 = new Executer3_FunctionImpl(); // イベントハンドラーの作成 Expression_Node_Function expr_Func = exe2.ConfigurationtreeToFunction( s_Action, owner_MemoryApplication, log_Reports ); // システム定義関数の実行 exe2.Execute3_Function( expr_Func, sender, owner_MemoryApplication, log_Reports ); // 他の待機スレッドに、実行順番を譲る。 //TODO: System.Threading.Thread.Sleep(0); //if (Log_ReportsImpl.BDebugmode_Static) //{ // //.WriteLine(this.GetType().Name + "#:\n│\n│\n│\n│"); //} }); log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── /// <summary> /// アクション実行。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override string Execute5_Main(Log_Reports log_Reports) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute5_Main", log_Reports); if (log_Reports.CanStopwatch) { string sFncName0; this.TrySelectAttribute(out sFncName0, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); log_Method.Log_Stopwatch.Message = "Nアクション[" + sFncName0 + "]実行"; log_Method.Log_Stopwatch.Begin(); } // // if (this.EnumEventhandler == EnumEventhandler.O_Kea) { Configurationtree_Node conf_ThisMethod = new Configurationtree_NodeImpl(log_Method.Fullname, null); Keys keys = this.Functionparameterset.KeyEventArgs.KeyCode; // // Form1のKeyPreview属性を true にしておく必要があります。 // switch (keys) { case Keys.F8: // // 「ツール設定ウィンドウ」を開きます。 // //OWrittenPlace oWrittenPlace = new OWrittenPlaceImpl(this.OWrittenPlace.WrittenPlace + "!ハードコーディング_NAction21#(10)"); Expression_Node_Function expr_Func = Collection_Function.NewFunction2( Expression_Node_Function11Impl.NAME_FUNCTION, this, this.Cur_Configuration, this.Owner_MemoryApplication, log_Reports); Configuration_Node cf_Event; { cf_Event = this.Cur_Configuration.GetParentByNodename( NamesNode.S_EVENT, EnumConfiguration.Unknown, false, log_Reports); } expr_Func.Execute4_OnLr( this.Functionparameterset.Sender, log_Reports ); //essageBox.Show("[F8]キーを押しました。", "△情報103!"); break; } } // // log_Method.EndMethod(log_Reports); return(""); }
//──────────────────────────────────────── /// <summary> /// システム定義関数の実行。 /// </summary> /// <param name="fc_EventHandler"></param> /// <param name="sender"></param> /// <param name="eventMonitor"></param> /// <param name="log_Reports"></param> public void Execute3_Function( Expression_Node_Function expr_Func, object sender, MemoryApplication memoryApplication, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute3_Function", log_Reports); if (log_Reports.CanStopwatch) { log_Method.Log_Stopwatch.Begin(); } // // // // string sFncName; expr_Func.TrySelectAttribute(out sFncName, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); // // アクションの実行 // //ystem.Console.WriteLine(this.GetType().Name + "#: 【開始】E_Action実行します。"); if (log_Reports.Successful) { if (null != expr_Func) { if (log_Method.CanWarning()) { log_Method.WriteWarning_ToConsole(" 【実行】イベント=[" + expr_Func.EnumEventhandler + "] システム関数=[" + sFncName + "] "); } switch (expr_Func.EnumEventhandler) { case EnumEventhandler.O_Lr: { expr_Func.Execute4_OnLr( sender, log_Reports ); } break; case EnumEventhandler.O_Ea: { // 変換 OEa → WrRhn。 expr_Func.Execute4_OnLr( sender, log_Reports ); } break; //case EnumEventhandler.O_DEA_P_S_B_WR: // break; default: //エラー goto gt_Error_NotSupportedEnum; } } } else { // // アクションしていない、アクションは終了したという判断。 // } goto gt_EndMethod; // #region 異常系 //──────────────────────────────────────── gt_Error_NotSupportedEnum: // アクションしていない、アクションは終了したという判断。 { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, sFncName, log_Reports); //関数名 tmpl.SetParameter(2, expr_Func.EnumEventhandler.ToString(), log_Reports); //イベントハンドラー名 tmpl.SetParameter(3, log_Method.Fullname, log_Reports); //問題のあったメソッド memoryApplication.CreateErrorReport("Er:110029;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // gt_EndMethod: log_Method.EndMethod(log_Reports); }
protected string Set_OnLstBox( Expression_Node_Function expr_Func, object prm_Sender, object prm_ItemValue, Log_Reports prm_D_LoggingBuffer ) { if (null != expr_Func)//暫定 { expr_Func.EnumEventhandler = EnumEventhandler.O_Lr; expr_Func.Functionparameterset.Sender = prm_Sender; expr_Func.Functionparameterset.ItemValue = prm_ItemValue; } return ""; }
//──────────────────────────────────────── /// <summary> /// システム定義関数の実行。 /// </summary> /// <param name="fc_EventHandler"></param> /// <param name="sender"></param> /// <param name="eventMonitor"></param> /// <param name="log_Reports"></param> public void Execute3_Function( Expression_Node_Function expr_Func, object sender, MemoryApplication memoryApplication, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute3_Function", log_Reports); if (log_Reports.CanStopwatch) { log_Method.Log_Stopwatch.Begin(); } // // // // string sFncName; expr_Func.TrySelectAttribute(out sFncName, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); // // アクションの実行 // //ystem.Console.WriteLine(this.GetType().Name + "#: 【開始】E_Action実行します。"); if (log_Reports.Successful) { if (null != expr_Func) { if (log_Method.CanWarning()) { log_Method.WriteWarning_ToConsole(" 【実行】イベント=[" + expr_Func.EnumEventhandler + "] システム関数=[" + sFncName + "] "); } switch (expr_Func.EnumEventhandler) { case EnumEventhandler.O_Lr: { expr_Func.Execute4_OnLr( sender, log_Reports ); } break; case EnumEventhandler.O_Ea: { // 変換 OEa → WrRhn。 expr_Func.Execute4_OnLr( sender, log_Reports ); } break; //case EnumEventhandler.O_DEA_P_S_B_WR: // break; default: //エラー goto gt_Error_NotSupportedEnum; } } } else { // // アクションしていない、アクションは終了したという判断。 // } goto gt_EndMethod; // #region 異常系 //──────────────────────────────────────── gt_Error_NotSupportedEnum: // アクションしていない、アクションは終了したという判断。 { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, sFncName, log_Reports);//関数名 tmpl.SetParameter(2, expr_Func.EnumEventhandler.ToString(), log_Reports);//イベントハンドラー名 tmpl.SetParameter(3, log_Method.Fullname, log_Reports);//問題のあったメソッド memoryApplication.CreateErrorReport("Er:110029;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// 関数を登録します。 /// </summary> /// <param name="sName_Fnc"></param> /// <param name="expr_Func"></param> public static void SetFunction(string sName_Fnc, Expression_Node_Function expr_Func, Log_Reports log_Reports) { Log_Method log_Method = new Log_MethodImpl(1); log_Method.BeginMethod(Info_Functions.Name_Library, "Collection_Function", "SetFunction",log_Reports); // dictionary_Interlibrary[sName_Fnc] = expr_Func; if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("関数[" + sName_Fnc + "]を登録しました。dictionary.count=[" + dictionary_Interlibrary.Count + "]"); } // log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// ユーザー定義関数を取得。 /// </summary> /// <param name="e_Func"></param> /// <param name="sCall"></param> /// <param name="log_Reports"></param> /// <returns></returns> public bool TryGetFunction(out Expression_Node_Function ec_CommonFunction, string sCall, Log_Reports log_Reports) { bool bResult; if (!this.dictionary_Item.ContainsKey(sCall)) { bResult = false; ec_CommonFunction = null; } else { bResult = true; ec_CommonFunction = this.dictionary_Item[sCall]; } return bResult; }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── public override void Execute4_OnOEa( object sender, EventArgs e ) { Log_Method pg_Method = new Log_MethodImpl(0); Log_Reports log_Reports_ThisMethod = new Log_ReportsImpl(pg_Method); pg_Method.BeginMethod(Info_Controls.Name_Library, this, "Execute4_OnOEa", log_Reports_ThisMethod); // // Customcontrol cct = null; string sName_Usercontrol; if (sender is Customcontrol) { cct = (Customcontrol)sender; sName_Usercontrol = cct.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports_ThisMethod); log_Reports_ThisMethod.Comment_EventCreationMe = "[" + sName_Usercontrol + "]コントロールでOEaアクションが実行されました。"; } else { sName_Usercontrol = ""; log_Reports_ThisMethod.Comment_EventCreationMe = "OEaアクションが実行されました。"; } if (log_Reports_ThisMethod.CanStopwatch) { string sEventName; this.Configurationtree_Event.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sEventName, true, log_Reports_ThisMethod); pg_Method.Log_Stopwatch.Message = Utility_Format.Format( sName_Usercontrol, sEventName ); pg_Method.Log_Stopwatch.Begin(); } // // // // //ystem.Console.WriteLine(Info_Forms.LibraryName + ":" + this.GetType().Name + "#Perform_OEa: 何回呼び出される?(A)"); //EnumEventhandler err_Eh; // // 「登録アクション設定」を元に、「アクション」を作成し、実行順に実行。 // Configurationtree_Event.List_Child.ForEach(delegate(Configurationtree_Node systemFunction_Conf, ref bool bBreak) { Expression_Node_Function expr_Func = cct.ControlCommon.Owner_MemoryApplication.MemoryForms.ConfigurationtreeToFunction.Translate( systemFunction_Conf, true, log_Reports_ThisMethod); if (log_Reports_ThisMethod.Successful) { expr_Func.Execute4_OnOEa(sender, e); } goto gt_EndMethod2; // gt_EndMethod2: ; }); goto gt_EndMethod; // gt_EndMethod: pg_Method.EndMethod(log_Reports_ThisMethod); log_Reports_ThisMethod.EndLogging(pg_Method); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── public override void Execute4_OnOEa( object sender, EventArgs e ) { Log_Method pg_Method = new Log_MethodImpl(0); Log_Reports log_Reports_ThisMethod = new Log_ReportsImpl(pg_Method); pg_Method.BeginMethod(Info_Controls.Name_Library, this, "Execute4_OnOEa", log_Reports_ThisMethod); // // Customcontrol cct = null; string sName_Usercontrol; if (sender is Customcontrol) { cct = (Customcontrol)sender; sName_Usercontrol = cct.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports_ThisMethod); log_Reports_ThisMethod.Comment_EventCreationMe = "[" + sName_Usercontrol + "]コントロールでOEaアクションが実行されました。"; } else { sName_Usercontrol = ""; log_Reports_ThisMethod.Comment_EventCreationMe = "OEaアクションが実行されました。"; } if (log_Reports_ThisMethod.CanStopwatch) { string sEventName; this.Configurationtree_Event.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sEventName, true, log_Reports_ThisMethod); pg_Method.Log_Stopwatch.Message = Utility_Format.Format( sName_Usercontrol, sEventName ); pg_Method.Log_Stopwatch.Begin(); } // // // // // ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ // ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ // ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ { CustomcontrolListbox ccLst = (CustomcontrolListbox)sender; //true || if (this.nIndex_PreSelected != ccLst.SelectedIndex) { //essageBox.Show(Info_Forms.LibraryName + ":" + this.GetType().Name + "#Perform_OEa: FC[" + fcNameStr + "]で、イベント(リストボックスの項目選択等)が起こりました。 .SelectedIndex=[" + .SelectedIndex + "] preSelectedIndex=["+this.preSelectedIndex+"]"); } else { // // リストボックスの selectedIndex が変わっていないとき。 // // ※ dataSourceのテーブルの行が変わったりすると、ここに来ます。 // return; //essageBox.Show(Info_Forms.LibraryName + ":" + this.GetType().Name + "#Perform_OEa: FC[" + fcNameStr + "]で、イベント(リストボックスの項目選択等)が起こっていません。選択項目インデックスが同じです。 .SelectedIndex=[" + .SelectedIndex + "] preSelectedIndex=[" + this.preSelectedIndex + "]"); } this.nIndex_PreSelected = ccLst.SelectedIndex; } // // 「登録アクション設定」を元に、「アクション」を作成し、実行順に実行。 // Configurationtree_Event.List_Child.ForEach(delegate(Configurationtree_Node systemFunction_Conf, ref bool bBreak) { Expression_Node_Function expr_Func = cct.ControlCommon.Owner_MemoryApplication.MemoryForms.ConfigurationtreeToFunction.Translate( systemFunction_Conf, true, log_Reports_ThisMethod ); if (log_Reports_ThisMethod.Successful) { //ystem.Console.WriteLine(Info_Forms.LibraryName + ":" + this.GetType().Name + "#Perform_OEa: 何回呼び出される?(B)"); expr_Func.Execute4_OnOEa(sender, e); } }); goto gt_EndMethod; // gt_EndMethod: pg_Method.EndMethod(log_Reports_ThisMethod); log_Reports_ThisMethod.EndLogging(pg_Method); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── public override string Execute5_Main( Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Expr.Name_Library, this, "Execute5_Main", log_Reports); // // string sResult; // call属性(必須) string sCall; { if (this.TrySelectAttribute(out sCall, PmNames.S_CALL.Name_Pm, EnumHitcount.One, log_Reports)) { } else { sCall = "<エラーcall属性取得失敗>"; // エラー goto gt_Error_CallAttr; } } Expression_Node_Function ec_CommonFunction = (Expression_Node_Function)this.GetParentExpressionOrNull(NamesNode.S_COMMON_FUNCTION); if (null == ec_CommonFunction) { // エラー sResult = "<Xn_L05_E:E_FParamImpl#Execute5_Main f-param開発中 call=\"" + sCall + "\" 親e_CommonFunctionなし>"; } else { // 親「E■function」取得。 string sParam; if (ec_CommonFunction.Dictionary_Expression_Parameter.TrySelect(out sParam, sCall, EnumHitcount.One, log_Reports)) { //sResult = "<Xn_L05_E:E_FParamImpl#Execute5_Main f-param開発中 call=\"" + sCall + "\" 値=”" + e_Param.E_Execute(EnumHitcount.Unconstraint,log_Reports) + "”>"; sResult = sParam; } else { // エラー。 Log_TextIndented s1 = new Log_TextIndentedImpl(); ec_CommonFunction.Dictionary_Expression_Parameter.ToText_Debug(s1, log_Reports); sResult = "<Xn_L05_E:E_FParamImpl#Execute5_Main f-param開発中 call=\"" + sCall + "\" e_Functionノード名=”" + ec_CommonFunction.Cur_Configuration.Name + "” 引数不該当>s1=" + s1.ToString(); } } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_CallAttr: sResult = "エラー。"; { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); this.Owner_MemoryApplication.CreateErrorReport("Er:6040;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); return(sResult); }
//──────────────────────────────────────── protected virtual string E_Execute_NoUse( Expression_Node_Function ec_CommonFunction, string sLibraryName, string sClassName, string sMethodName, EnumEventhandler enumEH, Configuration_Node conf_Node, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Expr.Name_Library, this, "E_Execute_NoUse",log_Reports); // // string sResult = ""; //#このルートはエラー { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, log_Method.Fullname, log_Reports);//問題の起こったメソッド tmpl.SetParameter(2, enumEH.ToString(), log_Reports);//イベントハンドラー string sFncName0; ec_CommonFunction.TrySelectAttribute(out sFncName0, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); tmpl.SetParameter(3, sFncName0, log_Reports);//関数名 tmpl.SetParameter(4, Log_RecordReportsImpl.ToText_Configuration(conf_Node), log_Reports);//設定位置パンくずリスト this.Owner_MemoryApplication.CreateErrorReport("Er:6039;", tmpl, log_Reports); } // ((E_SysFncAbstract)this.E_SystemAction).EventMonitor.BNowActionWorking = false; // // log_Method.EndMethod(log_Reports); return sResult; }
//──────────────────────────────────────── private void Load_Form2_(Log_Reports pg_Logging) { // // // //()メソッド開始 // // // Log_Method pg_Method = new Log_MethodImpl(0); pg_Method.BeginMethod(Info_Toolwindow.Name_Library, this, "Form1_Load", pg_Logging); StringBuilder sb = new StringBuilder(); MemoryAatoolxmlDialog moAatoolxmlDialog; if (null != this.Owner_MemoryApplication) { moAatoolxmlDialog = this.Owner_MemoryApplication.MemoryForms.MemoryAatoolxmlDialog; } else { // ダミーを作成。 pg_Method.WriteInfo_ToConsole("ダミー・MemoryAatoolxmlDialogを作成。"); moAatoolxmlDialog = new MemoryAatoolxmlDialogImpl(this.Owner_MemoryApplication); } moAatoolxmlDialog.MemoryAatoolxml = new MemoryAatoolxmlImpl(this.Owner_MemoryApplication); Configurationtree_Node parent_Conf = new Configurationtree_NodeImpl("!ハードコーディング_" + this.GetType().Name + "#Form1_Load", null); // ツール設定ファイルへのパスは固定とします。 Expression_Node_Filepath ec_Fpath_toolcnf; { Configurationtree_NodeFilepath cf_Fpath = new Configurationtree_NodeFilepathImpl("ファイルパス出典未指定L09TcDlg_3", parent_Conf); cf_Fpath.InitPath( ValuesAttr.S_FPATHR_AATOOLXML, pg_Logging); if (!pg_Logging.Successful) { // 既エラー。 goto gt_EndMethod; } ec_Fpath_toolcnf = new Expression_Node_FilepathImpl(cf_Fpath); } // // // //「ツール設定ファイル」読取り // // // moAatoolxmlDialog.MemoryAatoolxml.LoadFile(ec_Fpath_toolcnf, pg_Logging); if (!pg_Logging.Successful) { // 既エラー。 goto gt_EndMethod; } { UsercontrolListbox uctLst = (UsercontrolListbox)this.UctlstNameProject; uctLst.Clear(); foreach (string sName_Project in moAatoolxmlDialog.MemoryAatoolxml.Dictionary_Editor.Dictionary_Item.Keys) { uctLst.Items.Add(sName_Project); } if ("" == moAatoolxmlDialog.Name_SelectedEditor) { // 選択プロジェクト名が指定されていなければ。 if (0 < uctLst.Items.Count) { // 先頭の要素を選択します。 uctLst.ControlCommon.BAutomaticinputting = true; uctLst.SelectedIndex = 0; uctLst.ControlCommon.BAutomaticinputting = false; } else { // 非選択にします。 uctLst.ControlCommon.BAutomaticinputting = true; uctLst.SelectedIndex = -1; uctLst.ControlCommon.BAutomaticinputting = false; } } else { // 選択プロジェクト名が指定されていれば。 int selectedIndex = uctLst.Items.IndexOf(moAatoolxmlDialog.Name_SelectedEditor); uctLst.ControlCommon.BAutomaticinputting = true; uctLst.SelectedIndex = selectedIndex; uctLst.ControlCommon.BAutomaticinputting = false; } } sb.Append("[◆コマンドライン引数]"); sb.Append(Environment.NewLine); // コマンドライン引数を取得します。 string[] args = System.Environment.GetCommandLineArgs(); //コマンドライン引数の表示 int n = 1; foreach (string sArg in args) { sb.Append("【"); sb.Append(n); sb.Append("】"); sb.Append(sArg); sb.Append(Environment.NewLine); } this.pctxtInformation.Text = sb.ToString(); Expression_Node_String parent_Expression_Null = null; // ■ //■ ■ 「変数書出ボタン」のイベント設定 // ■ { Expression_Node_Function expr_Func = Collection_Function.NewFunction2(Expression_Node_Function45Impl.NAME_FUNCTION, parent_Expression_Null, parent_Conf, this.Owner_MemoryApplication, pg_Logging); expr_Func.SetAttribute(Expression_Node_Function28Impl.PM_MESSAGE, new Expression_Leaf_StringImpl("変数出力試し", null, parent_Conf), pg_Logging); } // ■ //■ ■ 「フォームCSV書出ボタン」のイベント設定 // ■ { Expression_Node_Function expr_Func = Collection_Function.NewFunction2(Expression_Node_Function46Impl.NAME_FUNCTION, parent_Expression_Null, parent_Conf, this.Owner_MemoryApplication, pg_Logging); expr_Func.SetAttribute(Expression_Node_Function28Impl.PM_MESSAGE, new Expression_Leaf_StringImpl("フォームCSV出力試し", null, parent_Conf), pg_Logging); this.uctButton2.UsercontroleventhandlerClick += new EventHandler(expr_Func.Execute4_OnOEa); } goto gt_EndMethod; // // gt_EndMethod: pg_Method.EndMethod(pg_Logging); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── /// <summary> /// アクション実行。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override string Execute5_Main(Log_Reports log_Reports) { //(1)メソッド開始 Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute5_Main", log_Reports); if (this.EnumEventhandler == EnumEventhandler.O_Ea) { string sConfigStack_ThisMethod = "<" + log_Method.Fullname + ":>"; Configurationtree_Node cf_ThisMethod = new Configurationtree_NodeImpl(sConfigStack_ThisMethod, null); //(2)独自実装のモデルをセットアップするタイミング。 this.On_P2_NewModelSetup(log_Reports); //(3).exeのファイルパス string sFpath_Startup = Application.StartupPath; //(4)[F8]キーを押すと、「ツール設定ダイアログ」が開くようにします。 { Expression_Node_Function expr_Func = Collection_Function.NewFunction2( Expression_Node_Function21Impl.NAME_FUNCTION, this, this.Cur_Configuration, this.Owner_MemoryApplication, log_Reports ); this.Owner_MemoryApplication.MemoryForms.Mainwnd_FormWrapping.Form.KeyDown += new System.Windows.Forms.KeyEventHandler(((Expression_Node_FunctionImpl)expr_Func).Execute4_OnKey); } //(5)『ツール設定ファイル』読取。 { this.Owner_MemoryApplication.MemoryAatoolxml.P101_LoadAatoolxml(cf_ThisMethod, log_Reports); } //(6)『ツール設定ダイアログ』の初期設定。 if (log_Reports.Successful) { this.Owner_MemoryApplication.MemoryForms.Form_Toolwindow.Clear(); this.Owner_MemoryApplication.MemoryForms.Form_Toolwindow.InitializeBeforeUse( this.Owner_MemoryApplication ); // 「プロジェクト選択時」のイベントハンドラとして登録。 Expression_Node_Function expr_Func = this.Functionitem_OnProjectSelected.NewInstance( this.Parent_Expression, this.Cur_Configuration, //EnumEventhandler.Unknown, this.Owner_MemoryApplication, log_Reports ); //expr_Func.InitializeBeforeUse(this.Owner_MemoryApplication); this.Owner_MemoryApplication.MemoryForms.Form_Toolwindow.OnEditorSelected += expr_Func.Execute4_OnEditorSelected; } //(7)「プロジェクト選択時」のイベントハンドラーを実行。(アプリケーション起動1回目) if (log_Reports.Successful) { this.Functionitem_OnProjectSelected.Execute4_OnEditorSelected( this.Functionparameterset.Sender, null, false, log_Reports); } //(8)タイトル if (log_Reports.Successful) { // タイトルは、外部ファイルで記述します。 // mainWnd は、UcWindow ではなく UcPanel です。UsercontrolTextに設定しても、ウィンドウのタイトルは変わりません。 // mainWnd は特殊な方法で取得します。 Mainwnd_FormWrapping mainwnd_FormWrapping = this.Owner_MemoryApplication.MemoryForms.Mainwnd_FormWrapping; mainwnd_FormWrapping.ControlCommon.BAutomaticinputting = true; StringBuilder sb; { sb = new StringBuilder(); // エディター設定ファイルに記載されているエディターの表示タイトル。 sb.Append(this.Owner_MemoryApplication.MemoryVariables.GetStringByVariablename( new Expression_Leaf_StringImpl(NamesVar.S_SS_TITLE_EDITOR, null, new Configurationtree_NodeImpl(log_Method.Fullname, null)), false, log_Reports)); // レイアウト・テーブルに記載されているエディター名。 sb.Append(mainwnd_FormWrapping.UsercontrolText); // 自動で付加。 sb.Append(" [CSVE×E " + ValuesAttr.S_VERSION_CSVEXE + "(code " + ValuesAttr.S_VERSION_CODEFILE + ")] - Xenontools (※[F8]キーでツール窓)"); mainwnd_FormWrapping.UsercontrolText = sb.ToString(); } mainwnd_FormWrapping.ControlCommon.BAutomaticinputting = false; } } //(10)メソッド終了 log_Method.EndMethod(log_Reports); return(""); }
//──────────────────────────────────────── public virtual void Translate_Step1( ConfigurationtreeToFunction_Item parentProcesser, Configurationtree_Node action_Conf, Expression_Node_Function cur_Expr_Func, MemoryApplication owner_MemoryApplication, Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Translate_Step1",log_Reports); // // アクション型引数の引数 // string err_sName_Attr; action_Conf.List_Child.ForEach(delegate(Configurationtree_Node s_Arg, ref bool bBreak) { string sName_Attr; s_Arg.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Attr, true, log_Reports); if (cur_Expr_Func.ContainsName_ArgumentDefinition(sName_Attr,log_Reports)) { // // 自解析 // ConfigurationtreeToExpression_F14n16 to = new ConfigurationtreeToExpression_F14_FArgImpl(); to.Translate( s_Arg, cur_Expr_Func, owner_MemoryApplication, pg_ParsingLog, log_Reports ); } else { // エラー err_sName_Attr = sName_Attr; goto gt_Error_UndefinedArgName; } goto gt_EndMethod2; // // gt_Error_UndefinedArgName: bBreak = true; { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, err_sName_Attr, log_Reports);//引数名 tmpl.SetParameter(2, cur_Expr_Func.ToString_ListNameargumentDefinition_ForReport(), log_Reports);//引数名リスト owner_MemoryApplication.CreateErrorReport("Er:110001;", tmpl, log_Reports); } // gt_EndMethod2: ; }); goto gt_EndMethod; gt_EndMethod: log_Method.EndMethod(log_Reports); }
protected void Set_OnOEa( Expression_Node_Function expr_Func, object prm_Sender, EventArgs prm_E ) { if (null != expr_Func)//暫定 { expr_Func.EnumEventhandler = EnumEventhandler.O_Ea; expr_Func.Functionparameterset.Sender = prm_Sender; expr_Func.Functionparameterset.EventArgs = prm_E; } }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── /// <summary> /// プロジェクト読取り時の定形アクション実行。 /// </summary> /// <param name="sender"></param> /// <param name="st_PrevProjectElm_OrNull"></param> /// <param name="bProjectValid"></param> /// <param name="log_Reports"></param> public override string Execute5_Main(Log_Reports log_Reports) { //()メソッド開始 Log_Method log_Method = new Log_MethodImpl(1); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute5_Main", log_Reports); // if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("「プロジェクト選択時」用のイベントハンドラーを実行します。"); } //()タスク_デスクリプション { string sFncName0; this.TrySelectAttribute(out sFncName0, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); if (this.Functionparameterset.Sender is Customcontrol) { Customcontrol ccFc = (Customcontrol)this.Functionparameterset.Sender; string sName_Usercontrol = ccFc.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports); log_Reports.Comment_EventCreationMe += "/追加:[" + sName_Usercontrol + "]コントロールが、[" + sFncName0 + "]アクションを実行。"; } else { log_Reports.Comment_EventCreationMe += "/追加:[" + sFncName0 + "]アクションを実行。"; } } Configurationtree_Node conf_ThisMethod = new Configurationtree_NodeImpl(log_Method.Fullname, null); if (this.EnumEventhandler == EnumEventhandler.Editor_B_Lr) { //(4)独自モデルの取得 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(4)独自モデルの取得"); } // this.On_P04_ReadNewModel(log_Reports); //(5)エディター名。ツール設定ファイルに記載されている方。 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(5)エディター名。ツール設定ファイルに記載されている方。"); } // 表示用の名称。 string sName_SelectingEditor; if (this.Functionparameterset.SelectedProjectElement_Configurationtree == null) { // // 切り替えるプロジェクトが判明していない場合は、空文字列。 // sName_SelectingEditor = ""; } else { // // todo: エディター設定ファイルの方のエディター名を入れても意味ないのでは? // sName_SelectingEditor = ((MemoryAatoolxml_Editor)this.Functionparameterset.SelectedProjectElement_Configurationtree).Name; } //(6)まず、きれいさっぱり プロジェクトをクリアーします。(切替用) if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(6)まず、きれいさっぱり プロジェクトをクリアーします。(切替用)"); } // todo:イベントハンドラーを外してから、フォームを外すこと。リストボックスが誤挙動を起こしている。 this.On_P06_ClearProject(this.Functionparameterset.Sender, log_Reports); //(7)「Aa_Editor.xml」読取。 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(7)「Aa_Editor.xml」読取。"); } // if (!this.Functionparameterset.IsProjectValid || this.Functionparameterset.SelectedProjectElement_Configurationtree == null) { MemoryAatoolxml_Editor moAatoolxml_PrevEditorElm_OrNull = null; // // // // デフォルト・プロジェクト名が指定されていない場合、 // ツール設定ファイルの最初に記述されているプロジェクトを選択します。 // // // if (log_Reports.Successful) { if ("" == sName_SelectingEditor) { // // デフォルト・エディター名が未指定の場合。 // MemoryAatoolxml_Editor moAatoolxml_DefaultEditor = this.Owner_MemoryApplication.MemoryAatoolxml.GetDefaultEditor(true, log_Reports); if (!log_Reports.Successful) { // 既エラー。 goto gt_EndMethod; } // ↓これ要る? sName_SelectingEditor = moAatoolxml_DefaultEditor.Name; } } this.On_P07_SelectDefaultProject(ref sName_SelectingEditor, ref moAatoolxml_PrevEditorElm_OrNull, this.Functionparameterset.IsProjectValid, log_Reports); this.Functionparameterset.SelectedProjectElement_Configurationtree = moAatoolxml_PrevEditorElm_OrNull; // // // //「プロジェクトを開いた時の初期化」イベントハンドラーで使うために、ここで設定します。 // // // this.Functionparameterset.SelectedProjectElement_Configurationtree = this.Owner_MemoryApplication.MemoryAatoolxml.GetEditorByName(sName_SelectingEditor, true, log_Reports); if (!log_Reports.Successful) { // 既エラー。 goto gt_EndMethod; } } // ↓追加 if (null == this.Functionparameterset.SelectedProjectElement_Configurationtree) { { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, sName_SelectingEditor, log_Reports);//エディター名 this.Owner_MemoryApplication.CreateErrorReport("Er:110003;", tmpl, log_Reports); } } // ↑追加 //(13a)エディター・フォルダー。 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(13a)エディター・フォルダーパス類推。"); } // // // Expression_Node_Filepath ec_Fopath_Editor; if (log_Reports.Successful) { MemoryAatoolxml_Editor moAatoolxml_SelectedEditor = (MemoryAatoolxml_Editor)this.Functionparameterset.SelectedProjectElement_Configurationtree; ec_Fopath_Editor = moAatoolxml_SelectedEditor.GetFilepathByFsetvarname( NamesVar.S_SP_EDITOR, this.Owner_MemoryApplication.MemoryVariables, true, log_Reports ); } else { ec_Fopath_Editor = null; } //(13b)「Aa_Editor.xml」読取。 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(13b)「Aa_Editor.xml」ファイルパス類推。"); } // Expression_Node_Filepath ec_Fpath_AaEditorXml; if (log_Reports.Successful) { // // ツール設定ファイルで指定された値から、自動類推で設定されているはず。 // Configurationtree_NodeFilepath cf_Fpath_EditorXml = new Configurationtree_NodeFilepathImpl( "ツール設定ファイル[" + Application.StartupPath + System.IO.Path.DirectorySeparatorChar + ValuesAttr.S_FPATHR_AATOOLXML + "]の中の[" + sName_SelectingEditor + "]エディターへの指定から自動類推", null); // フォルダーパス + \Aa_Editor.xml string sFpatha_Aaeditorxml = ec_Fopath_Editor.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + System.IO.Path.DirectorySeparatorChar + NamesFile.S_AA_EDITOR_XML; // プロジェクト起動時に。 cf_Fpath_EditorXml.InitPath( sFpatha_Aaeditorxml, log_Reports ); ec_Fpath_AaEditorXml = new Expression_Node_FilepathImpl(cf_Fpath_EditorXml); } else { ec_Fpath_AaEditorXml = null; } //(8)「エディター設定ファイル」に記述されている<f-set-var>要素を、「エディター設定ファイル・モデル」に格納。Cf→M if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(8)「エディター設定ファイル」に記述されている<f-set-var>要素を、「エディター設定ファイル・モデル」に格納。Cf→M。この時点で「Sp:Engine;」といったシステム変数は自動類推が終わっている必要があります。"); } // MemoryAaeditorxml_Editor moAaeditorxml_Editor = null; if (log_Reports.Successful) { this.On_P08_SpToVar_( out moAaeditorxml_Editor, ec_Fpath_AaEditorXml, ec_Fopath_Editor, (MemoryAatoolxml_Editor)this.Functionparameterset.SelectedProjectElement_Configurationtree, log_Reports ); } // // // // ここで「Aa_Files.csv」を読み込みたい。 // // // if (log_Reports.Successful) { //(9)変数ファイル読取 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(9)変数ファイル読取"); } // this.Owner_MemoryApplication.MemoryVariables.LoadVariables( Application.StartupPath, log_Reports ); } if (log_Reports.Successful) { //(10)プログラマー用・デバッグモードのON/OFF。 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(10)プログラマー用・デバッグモードのON/OFF。"); } // //mainWndの作成より先に設定する必要がある。ステータスバーを出す、出さないについて。 { Expression_Leaf_StringImpl ec_Varname = new Expression_Leaf_StringImpl(this, this.Cur_Configuration.Parent); ec_Varname.SetString(NamesVar.S_SS_DEBUGMODE_PROGRAMMER, log_Reports); string sValue = this.Owner_MemoryApplication.MemoryVariables.GetStringByVariablename(ec_Varname, false, log_Reports); if (ValuesAttr.S_ON == sValue) { Log_ReportsImpl.BDebugmode_Static = true; } else if (ValuesAttr.S_OFF == sValue) { Log_ReportsImpl.BDebugmode_Static = false; } else if (ValuesAttr.S_EMPTY == sValue) { // 無視 } else { // TODO:エラー } } } if (log_Reports.Successful) { //(11)画面レイアウト・デバッグモードのON/OFF。 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(11)フォーム・デバッグモードのON/OFF。"); } // Expression_Leaf_StringImpl ec_Varname = new Expression_Leaf_StringImpl(this, this.Cur_Configuration.Parent); ec_Varname.SetString(NamesVar.S_SS_DEBUGMODE_FORM, log_Reports); string sValue = this.Owner_MemoryApplication.MemoryVariables.GetStringByVariablename(ec_Varname, false, log_Reports); if (ValuesAttr.S_ON == sValue) { Log_ReportsImpl.BDebugmode_Form = true; } else if (ValuesAttr.S_OFF == sValue) { Log_ReportsImpl.BDebugmode_Form = false; } else if (ValuesAttr.S_EMPTY == sValue) { // 無視 } else { // TODO:エラー } } //(14)「Aa_Files.csv」読取。 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(14)「Aa_Files.csv」読取。"); } // List <Expression_Node_Filepath> ecList_Fpath_BackupRequest; { if (log_Reports.Successful) { // 正常時 Expression_Node_Function function_Expr = Collection_Function.NewFunction2( Expression_Node_Function22Impl.NAME_FUNCTION, this, this.Cur_Configuration, this.Owner_MemoryApplication, log_Reports); // 実行 function_Expr.Execute4_OnLr(this.Functionparameterset.Sender, log_Reports); // 実行後 ecList_Fpath_BackupRequest = ((Expression_Node_Function22Impl)function_Expr).List_Expression_Filepath_BackupRequest_Out; } else { // // エラー // ecList_Fpath_BackupRequest = null; } } //(14b)ユーザー定義関数設定ファイル読取【2012-03-30追加】 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(14b)ユーザー定義関数設定ファイル読取【2012-03-30追加】"); } // if (log_Reports.Successful) { // タイプデータ値。 Expression_Leaf_StringImpl ec_NameVariable = new Expression_Leaf_StringImpl(this, new Configurationtree_NodeImpl("!ハードコーディング", null)); ec_NameVariable.SetString(ValuesTypeData.S_CODE_FUNCTIONS, log_Reports); List <MemoryCodefileinfo> listInfo = null; if (log_Reports.Successful) { listInfo = this.Owner_MemoryApplication.MemoryCodefiles.GetCodefileinfoByTypedata(ec_NameVariable, true, log_Reports); } if (log_Reports.Successful) { foreach (MemoryCodefileinfo scriptfile in listInfo) { if (log_Reports.Successful) { this.Owner_MemoryApplication.MemoryFunctions.LoadFile( scriptfile.Expression_Filepath, log_Reports); } else { break; } } } } //(16)『スタイルシート設定ファイル』読取 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(16)『スタイルシート設定ファイル』読取"); } // if (log_Reports.Successful) { Expression_Node_Function expr_Func = Collection_Function.NewFunction2( Expression_Node_Function19Impl.NAME_FUNCTION, this, this.Cur_Configuration, this.Owner_MemoryApplication, log_Reports); Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(this, conf_ThisMethod); ec_Str.AppendTextNode(NamesVar.S_ST_STYLESHEET, this.Cur_Configuration, log_Reports); expr_Func.SetAttribute(Expression_Node_Function19Impl.PM_NAME_TABLE_STYLESHEET, ec_Str, log_Reports); expr_Func.Execute4_OnLr( this.Functionparameterset.Sender, log_Reports ); } //(17a)「バックアップを取る」前にしておく独自実装をするタイミング。 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(17a)「バックアップを取る」前にしておく独自実装をするタイミング。"); } // this.On_P17a_PreviousBackup( this.Functionparameterset.Sender, moAaeditorxml_Editor, ec_Fpath_AaEditorXml, ec_Fopath_Editor, (MemoryAatoolxml_Editor)this.Functionparameterset.SelectedProjectElement_Configurationtree, log_Reports); //(17b)今日の分のバックアップを取ります。 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(17b)今日の分のバックアップを取ります。"); } // this.On_P17b_DateBackup(ecList_Fpath_BackupRequest, this.Functionparameterset.Sender, log_Reports); //(17c)「新規ウィンドウを開く」前にしておく独自実装をするタイミング。 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(17c)「新規ウィンドウを開く」前にしておく独自実装をするタイミング。"); } // this.On_P17c_PreviousOpenWindow( this.Functionparameterset.Sender, moAaeditorxml_Editor, ec_Fpath_AaEditorXml, ec_Fopath_Editor, (MemoryAatoolxml_Editor)this.Functionparameterset.SelectedProjectElement_Configurationtree, log_Reports); //(18)関数30「新規ウィンドウを開く」実行。引数には関数を2つ指定できる。 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(18)関数30「新規ウィンドウを開く」実行。引数には関数を2つ指定できる。"); } // { Expression_Node_Function expr_Func = Collection_Function.NewFunction2( Expression_Node_Function30Impl.NAME_FUNCTION, this, this.Cur_Configuration, this.Owner_MemoryApplication, log_Reports); { //Expression_Node_Function30Impl f1 = { Expression_Node_StringImpl ec_FormStart; { Expression_FvarImpl ec_Fvar = new Expression_FvarImpl(this, this.Cur_Configuration, this.Owner_MemoryApplication); ec_Fvar.AppendTextNode(NamesVar.S_SS_FORM_START, this.Cur_Configuration, log_Reports); ec_FormStart = new Expression_Node_StringImpl(this, this.Cur_Configuration); ec_FormStart.List_Expression_Child.Add(ec_Fvar, log_Reports); } ((Expression_Node_Function30Impl)expr_Func).SetAttribute(Expression_Node_Function30Impl.PM_NAME_FORM, ec_FormStart, log_Reports); } ((Expression_Node_Function30Impl)expr_Func).In_Subroutine_Function30_1 = this.In_Subroutine_Function30_1_OrNull; ((Expression_Node_Function30Impl)expr_Func).In_Subroutine_Function30_2 = this.In_Subroutine_Function30_2_OrNull; ((Expression_Node_Function30Impl)expr_Func).SetAttribute( Expression_Node_Function30Impl.PM_NAME_TOGETHER, new Expression_Leaf_StringImpl(NamesStg.S_STG_BEGIN_APPLICATION, null, conf_ThisMethod), log_Reports); } expr_Func.Execute4_OnLr( this.Functionparameterset.Sender, log_Reports ); } //(19)最後に if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("(19)最後に"); } // this.On_P19_AtLast( this.Functionparameterset.Sender, (MemoryAatoolxml_Editor)this.Functionparameterset.SelectedProjectElement_Configurationtree, this.Functionparameterset.IsProjectValid, log_Reports); // // 「S」と「E」を出力したい。 if (false) { // 「S」全てのコントロールと、ユーザー定義関数について。 log_Method.WriteInfo_ToConsole("┌──────────┐「S」全てのコントロールについて。"); this.Owner_MemoryApplication.MemoryForms.ForEach_Children(delegate(string sKey, Usercontrol fcUc, ref bool bRemove, ref bool bBreak) { Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("[" + sKey + "]"); s.Newline(); fcUc.ControlCommon.Expression_Control.Cur_Configuration.ToText_Content(s); log_Method.WriteInfo_ToConsole(s.ToString()); }); log_Method.WriteInfo_ToConsole("└──────────┘"); log_Method.WriteInfo_ToConsole("┌──────────┐「S」全てのユーザー定義関数について。"); this.Owner_MemoryApplication.MemoryFunctions.ForEach_Children(delegate(string sKey, Expression_Node_Function ec_CommonFunction, ref bool bRemove, ref bool bBreak) { Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("[" + sKey + "]"); s.Newline(); ec_CommonFunction.Cur_Configuration.ToText_Content(s); log_Method.WriteInfo_ToConsole(s.ToString()); }); log_Method.WriteInfo_ToConsole("└──────────┘"); // 「E」全てのコントロールと、ユーザー定義関数について。 log_Method.WriteInfo_ToConsole("┌──────────┐「E」全てのコントロールについて。"); this.Owner_MemoryApplication.MemoryForms.ForEach_Children(delegate(string sKey, Usercontrol fcUc, ref bool bRemove, ref bool bBreak) { Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("[" + sKey + "]"); s.Newline(); fcUc.ControlCommon.Expression_Control.ToText_Snapshot(s); log_Method.WriteInfo_ToConsole(s.ToString()); }); log_Method.WriteInfo_ToConsole("└──────────┘"); log_Method.WriteInfo_ToConsole("┌──────────┐「E」全てのユーザー定義関数について。"); this.Owner_MemoryApplication.MemoryFunctions.ForEach_Children(delegate(string sKey, Expression_Node_Function ec_CommonFunction, ref bool bRemove, ref bool bBreak) { Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("[" + sKey + "]"); s.Newline(); ec_CommonFunction.ToText_Snapshot(s); log_Method.WriteInfo_ToConsole(s.ToString()); }); log_Method.WriteInfo_ToConsole("└──────────┘"); } log_Method.WriteInfo_ToConsole("◆起動終了"); goto gt_EndMethod; // gt_EndMethod: log_Method.EndMethod(log_Reports); } return(""); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── public virtual void Translate_Step1( ConfigurationtreeToFunction_Item parentProcesser, Configurationtree_Node action_Conf, Expression_Node_Function cur_Expr_Func, MemoryApplication owner_MemoryApplication, Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Translate_Step1", log_Reports); // // アクション型引数の引数 // string err_sName_Attr; action_Conf.List_Child.ForEach(delegate(Configurationtree_Node s_Arg, ref bool bBreak) { string sName_Attr; s_Arg.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Attr, true, log_Reports); if (cur_Expr_Func.ContainsName_ArgumentDefinition(sName_Attr, log_Reports)) { // // 自解析 // ConfigurationtreeToExpression_F14n16 to = new ConfigurationtreeToExpression_F14_FArgImpl(); to.Translate( s_Arg, cur_Expr_Func, owner_MemoryApplication, pg_ParsingLog, log_Reports ); } else { // エラー err_sName_Attr = sName_Attr; goto gt_Error_UndefinedArgName; } goto gt_EndMethod2; // // gt_Error_UndefinedArgName: bBreak = true; { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, err_sName_Attr, log_Reports); //引数名 tmpl.SetParameter(2, cur_Expr_Func.ToString_ListNameargumentDefinition_ForReport(), log_Reports); //引数名リスト owner_MemoryApplication.CreateErrorReport("Er:110001;", tmpl, log_Reports); } // gt_EndMethod2: ; }); goto gt_EndMethod; gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── #endregion #region イベントハンドラー //──────────────────────────────────────── private void Form1_Load(object sender, EventArgs e) { // // // //(1)デバッグモード ※Log_MethodImpl#BeginMethod(...)をする前に必要。 // // // Log_ReportsImpl.BDebugmode_Static = true; Log_Reports pg_Logging_ThisMethod; // // // //(2)メソッド開始 // // // Log_Method pg_Method = new Log_MethodImpl(0); // デバッグモード静的設定の後で。 pg_Method.BeginMethod(Info_CSVEditorImpl.Name_Library, this, "Form1_Load", out pg_Logging_ThisMethod); // Expression_Node_String parent_Expression_Null = null; Configurationtree_Node cur_Conf = new Configurationtree_NodeImpl(pg_Method.Fullname, null); // // // //(3)CSVエディター・モデル(必要に応じて拡張)用意 // // // this.memoryCsvEditor = new MemoryApplicationImpl(); this.MemoryCsvEditor.InitializeBeforeUse( new Mainwnd_FormWrappingImpl(this), new ConfigurationtreeToFunction_ListImpl(parent_Expression_Null, cur_Conf, this.MemoryCsvEditor, pg_Logging_ThisMethod), new Form_ToolwindowImpl(), new MemoryAatoolxmlDialogImpl(this.MemoryCsvEditor), new UsercontrolStyleSetterImpl(), new UsercontrolCreator1Impl(), new XToMemory_FormImpl() ); Form1.RegisterFunctions(pg_Logging_ThisMethod); // // // //(4)アプリケーション・モデル作成後に E_Sf_BootCsvEditorImpl(必要に応じて拡張)実行。 // // // if (pg_Logging_ThisMethod.Successful) { Expression_Node_Function expr_Func = Collection_Function.NewFunction2( Expression_Node_Function_BootCsvEditorExImpl.NAME_FUNCTION, null, cur_Conf, this.MemoryCsvEditor, pg_Logging_ThisMethod ); //expr_Func.InitializeBeforeUse(this.MoCsvEditor); // 実行 expr_Func.Execute4_OnOEa(sender, e); } // // // //(5)エラーログ出力 // // // if (!pg_Logging_ThisMethod.Successful) { // 異常時 this.MemoryCsvEditor.MemoryLogwriter.WriteErrorLog( this.MemoryCsvEditor, pg_Logging_ThisMethod, pg_Method.Fullname ); } // // // //(6)メソッド、ロギング終了 // // // pg_Method.EndMethod(pg_Logging_ThisMethod); pg_Logging_ThisMethod.EndLogging(pg_Method); }