//──────────────────────────────────────── /// <summary> /// 内容をデバッグ出力します。 /// </summary> public void CreateMessage_Debug(Log_Reports log_Reports) { Log_Method log_Method = new Log_MethodImpl(0); Log_Reports d_Logging_Dammy = new Log_ReportsImpl(log_Method); log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "CreateMessage_Debug",d_Logging_Dammy); // // //ystem.Console.WriteLine(this.GetType().Name + "#DebugWrite: 【デバッグ出力】 project要素の個数=[" + this.Items.Count + "]"); foreach (MemoryAatoolxml_Editor aatool_Editor in this.Dictionary_Item.Values) { //ystem.Console.WriteLine(this.GetType().Name + "#DebugWrite: 【デバッグ出力】 project名=[" + st_Project.Name + "]"); aatool_Editor.WriteDebug_ToConsole(aatool_Editor.Dictionary_Fsetvar_Configurationtree, log_Reports); } // // d_Logging_Dammy.EndCreateReport(); log_Method.EndMethod(d_Logging_Dammy); if (!d_Logging_Dammy.Successful) { log_Method.WriteDebug_ToConsole(d_Logging_Dammy.ToText()); } }
//──────────────────────────────────────── /// <summary> /// 無条件で、全てのレコードを返す。 /// </summary> /// <param name="dst_Row"></param> /// <param name="isRequired_ExpectedValue"></param> /// <param name="dataTable"></param> /// <param name="s_ParentNode_query"></param> /// <param name="log_Reports"></param> public void Select( out List<DataRow> out_List_DstRow, bool isRequired_ExpectedValue, DataTable dataTable, Configuration_Node parent_Conf, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(); log_Method.BeginMethod(Info_Table.Name_Library, this, "Select",log_Reports); // // // // out_List_DstRow = new List<DataRow>(); foreach (DataRow row in dataTable.Rows) { out_List_DstRow.Add(row); } goto gt_EndMethod; // // // // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <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 (this.EnumEventhandler == EnumEventhandler.O_Lr) { this.Execute6_Sub( log_Reports ); } else if (this.EnumEventhandler == EnumEventhandler.O_Ea) { this.Execute6_Sub( log_Reports ); } // // log_Method.EndMethod(log_Reports); return ""; }
//──────────────────────────────────────── /// <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_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute5_Main",log_Reports); string sFncName0; this.TrySelectAttribute(out sFncName0, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); if (this.EnumEventhandler == EnumEventhandler.O_Ea) { 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 + "]アクションを実行。"; } ListBox pcLst = (ListBox)this.Functionparameterset.Sender; this.Execute6_Sub(pcLst, log_Reports); } log_Method.EndMethod(log_Reports); return ""; }
//──────────────────────────────────────── /// <summary> /// 追加。 /// </summary> /// <param name="nItems"></param> /// <param name="request"></param> /// <param name="log_Reports"></param> public void Add( Expression_Node_String ec_Child, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_Syntax.Name_Library, this, "Add",log_Reports); if (ec_Child is Expression_Node_StringImpl) { ((Expression_Node_StringImpl)ec_Child).Parent_Expression = this.owner_Expression; } else if (ec_Child is Expression_Leaf_StringImpl) { ((Expression_Leaf_StringImpl)ec_Child).Parent_Expression = this.owner_Expression; } else if (ec_Child is Expression_TexttemplateP1pImpl) { ((Expression_TexttemplateP1pImpl)ec_Child).Parent_Expression = this.owner_Expression; } else { log_Method.WriteWarning_ToConsole(" 想定外のクラス=[" + ec_Child.GetType().Name + "]"); } this.listExpression_Item.Add(ec_Child); log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// 追加。 /// </summary> public void Add( Configurationtree_Node cur_Conf, Log_Reports log_Reports ) { this.list_Configurationtree_Node.Add(cur_Conf); }
//──────────────────────────────────────── 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); } } }
//──────────────────────────────────────── /// <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); string sFncName0; this.TrySelectAttribute(out sFncName0, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); if (log_Reports.CanStopwatch) { log_Method.Log_Stopwatch.Message = "「E■[" + sFncName0 + "]アクション」実行(A)"; log_Method.Log_Stopwatch.Begin(); } // // if (this.EnumEventhandler == EnumEventhandler.O_Lr) { this.Execute6_Sub(log_Reports); } else if (this.EnumEventhandler == EnumEventhandler.O_Ea) { this.Execute6_Sub(log_Reports); } goto gt_EndMethod; // // gt_EndMethod: log_Method.EndMethod(log_Reports); return ""; }
//──────────────────────────────────────── public static void ParseChild_InAnotherLibrary( Configurationtree_Node cur_Cf, Expression_Node_String parent_Expr,//nAcase,nFelemの両方の場合がある。 MemoryApplication memoryApplication, Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, "SToE_AbstractImpl", "ParseChild_InAnotherLibrary",log_Reports); ConfigurationtreeToExpression_F14n16 dammy = new ConfigurationtreeToExpression_F14_FncImpl_();//メソッドが使いたいだけなので、何でもいい。 dammy.ParseChild_InConfigurationtreeToExpression( cur_Cf, parent_Expr, memoryApplication, pg_ParsingLog, log_Reports ); goto gt_EndMethod; // // gt_EndMethod: if (Log_ReportsImpl.BDebugmode_Static) { //d_ParsingLog.Decrement(s_Cur.Name_Node); } log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// 「ツール設定ウィンドウ」を開きます。 /// </summary> /// <param name="sender"></param> /// <param name="eventMonitor"></param> /// <param name="log_Reports"></param> public override string Execute5_Main(Log_Reports log_Reports) { 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_Lr) { if (log_Reports.CanStopwatch) { string sFncName; this.TrySelectAttribute(out sFncName, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); log_Method.Log_Stopwatch.Message = "Nアクション[" + sFncName + "]実行"; log_Method.Log_Stopwatch.Begin(); } // // // // // ツール設定モデルを共有します。 this.Owner_MemoryApplication.MemoryForms.MemoryAatoolxmlDialog.MemoryAatoolxml = this.Owner_MemoryApplication.MemoryAatoolxml; // 「SelectedIndexイベント」を必ず動かすために、リストボックスを空にします。 this.Owner_MemoryApplication.MemoryForms.Form_Toolwindow.Clear(); // ダイアログボックスを出します。 ((Form)this.Owner_MemoryApplication.MemoryForms.Form_Toolwindow).ShowDialog(this.Owner_MemoryApplication.MemoryForms.Mainwnd_FormWrapping.Form); } log_Method.EndMethod(log_Reports); return ""; }
//──────────────────────────────────────── public void AddValidator( Expressionv_Validator_Old ecv_Validator, Log_Reports log_Reports ) { // 未実装 TODO 実装すること。 }
//──────────────────────────────────────── /// <summary> /// グリッド領域を追加します。(エラー対応処理付き) /// </summary> /// <param name="gridAreaName"></param> /// <param name="gridArea"></param> /// <param name="log_Reports"></param> public void Add( string sName_Gridarea, Grid gridArea, Log_Reports log_Reports, string sLogStack ) { Log_Method pg_Method = new Log_MethodImpl(0); pg_Method.BeginMethod(Info_GridPanel.Name_Library, this, "Add",log_Reports); Exception err_Excp; try { this.Dictionary_Item.Add(sName_Gridarea, gridArea); } catch (Exception e) { // エラー err_Excp = e; goto gt_Error_Exception; } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_Exception: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー50404!", pg_Method); StringBuilder t = new StringBuilder(); t.Append("グリッドパネルの利用"); t.Append(Environment.NewLine); t.Append(Environment.NewLine); t.Append("["); t.Append(sName_Gridarea); t.Append("]要素の追加時に失敗しました。"); t.Append(Environment.NewLine); t.Append(Environment.NewLine); t.Append("エラー:"); t.Append(err_Excp.Message); t.Append(Environment.NewLine); t.Append(Environment.NewLine); t.Append("実行経路ヒント:"); t.Append(sLogStack); r.Message = t.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: pg_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// リスト・ビュー1の内容を、リスト・ビュー2へ、コピーします。 /// </summary> /// <param name="listView"></param> /// <param name="listView"></param> public void CopyTo(ListView listView1, ListView listView2, Log_Reports log_Reports) { // リスト・ビュー2を空にします。 listView2.Clear(); // 編集テーブルを、並び順変更先テーブルにコピーします。 foreach (ColumnHeader columnHeader in listView1.Columns) { listView2.Columns.Add(columnHeader.Text); } foreach (ListViewItem listViewItem in listView1.Items) { // [0]列目を初期値として設定します。 ListViewItem newItem = new ListViewItem(listViewItem.Text); // 最初の[0]列目は既に追加済みなので、[1]列目以降から追加します。 for (int nIndex = 1; nIndex < listViewItem.SubItems.Count; nIndex++) { newItem.SubItems.Add(listViewItem.SubItems[nIndex]); } listView2.Items.Add(newItem); } goto gt_EndMethod; // gt_EndMethod: ; }
//──────────────────────────────────────── public void SetDataSource(Table_Humaninput o_Table, Log_Reports log_Reports) { this.table_Humaninput = o_Table; Utility_TableviewImpl u_tblView = new Utility_TableviewImpl(); u_tblView.IsVisibled_Fieldtype = true; u_tblView.SetDataSourceToListView( o_Table, this.listView1, log_Reports); if (!log_Reports.Successful) { // 既エラー。 goto gt_EndMethod; } u_tblView.CopyTo(this.listView1, this.listView2, log_Reports); if (!log_Reports.Successful) { // 既エラー。 goto gt_EndMethod; } // gt_EndMethod: return; }
//──────────────────────────────────────── /// <summary> /// イベントハンドラーの作成。 /// </summary> /// <param name="s_Action"></param> /// <param name="log_Reports"></param> /// <returns></returns> public Expression_Node_Function ConfigurationtreeToFunction( Configurationtree_Node action_Conf, MemoryApplication owner_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, "ConfigurationtreeToFunction",log_Reports); if (log_Reports.CanStopwatch) { log_Method.Log_Stopwatch.Begin(); } // Expression_Node_Function expr_Func; if (log_Reports.Successful) { expr_Func = owner_MemoryApplication.MemoryForms.ConfigurationtreeToFunction.Translate( action_Conf, true, log_Reports ); } else { expr_Func = null; } goto gt_EndMethod; // gt_EndMethod: log_Method.EndMethod(log_Reports); return expr_Func; }
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; }
//──────────────────────────────────────── /// <summary> /// 例えば ("access",”from”)と指定すれば、 /// 指定リストの要素の中で <~ access=”from,to”> といった属性を持つものはヒットする。 /// /// 選択アイテムをリストから除外するなら bRemove=true にします。 /// </summary> /// <param name="sName"></param> /// <param name="sExpectedValue"></param> /// <param name="request_Items"></param> /// <param name="log_Reports"></param> /// <returns></returns> public static List<Expression_Node_String> SelectItemsByPmAsCsv( List<Expression_Node_String> ecList_Item, string sPmName, string sExpectedValue, bool bRemove, EnumHitcount hits, Log_Reports log_Reports) { Log_Method pg_Method = new Log_MethodImpl(0); pg_Method.BeginMethod(Info_Controls.Name_Library, "Util_E_NodeImpl", "SelectItemsByAttrAsCsv",log_Reports); // // //Util_E_NodeImpl dammy_This = new Util_E_NodeImpl(); List<Expression_Node_String> ecList_Result; ecList_Result = Utility_Expression_NodeImpl.SelectItemsByPmAsCsv_Full_( ecList_Item, sPmName, false, sExpectedValue, bRemove, hits, log_Reports ); goto gt_EndMethod; // // gt_EndMethod: pg_Method.EndMethod(log_Reports); // 正常終了 return ecList_Result; }
//──────────────────────────────────────── /// <summary> /// レコードセットを、一時記憶。 /// </summary> /// <param name="p3_RecordSet"></param> /// <param name="RecordSetSaveTo_or_null"></param> /// <param name="log_Reports"></param> public void P4_Save( RecordSet recordSet_toSave, Expressionv_4ASelectRecord ecvRequest_SelRec_OrNull,//where Log_Reports log_Reports ) { if (null != ecvRequest_SelRec_OrNull) { // // "RECORD_SAVE_TO:FC_mr_skillLst_001" といった、名前。 string sStorage = ecvRequest_SelRec_OrNull.Expression_Storage.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports); if ("" != sStorage.Trim()) { // // 内容のコピー。 //p3_Selectstatement.NFld = nRequest_saveTo_orNull.NField; //p3_Selectstatement.NLookupValue = nRequest_saveTo_orNull.NLookupValue; //p3_Selectstatement.NRequired = nRequest_saveTo_orNull.NRequired; //p3_Selectstatement.NFrom = nRequest_saveTo_orNull.NFrom; //p3_Selectstatement.NStorage = nRequest_saveTo_orNull.NStorage; //p3_Selectstatement.NDescription = nRequest_saveTo_orNull.NDescription; // // レコードセットを一時記憶。 this.Owner_MemoryApplication.MemoryRecordset.RecordsetStorage.Add( ecvRequest_SelRec_OrNull.Expression_Storage, recordSet_toSave,// p3_Selectstatement, this.Owner_MemoryApplication, log_Reports); } } }
//──────────────────────────────────────── /// <summary> /// 再帰関数です。 /// </summary> /// <param name="result">.luaファイルのパスが追加されます。</param> /// <param name="folderpath"></param> public void SearchLua(List<string> result, string folderpath, Log_Reports log_Reports) { Log_Method log_Method = new Log_MethodImpl(); log_Method.BeginMethod(Info_Actorslist.Name_Library, this, "SearchLua", log_Reports); if (log_Reports.Successful) { if (!Directory.Exists(folderpath)) { System.Console.WriteLine("SearchLua エラー"); goto gt_Error_Folder; } string[] filepaths = Directory.GetFileSystemEntries(folderpath); foreach (string filepath in filepaths) { if (Directory.Exists(filepath)) { //System.Console.WriteLine("dir=[" + filepath + "]"); this.SearchLua(result, filepath, log_Reports); } else { Match m1 = this.Regex.Match(filepath); if (m1.Success) { result.Add(filepath); //System.Console.WriteLine("file=[" + filepath + "]"); } } } } goto gt_EndMethod; #region 異常系 //──────────────────────────────────────── gt_Error_Folder: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー13001!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("存在するフォルダーを指定してください。"); s.Append(Environment.NewLine); s.Append(" folderpath=["); s.Append(folderpath); s.Append("]"); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── protected override void Parse_ChildNodes( XmlElement cur_X, Configurationtree_Node cf_Cur, MemoryApplication memoryApplication, Log_Reports log_Reports ) { }
//──────────────────────────────────────── protected override Configurationtree_Node CreateMyself( XmlElement cur_X, Configurationtree_Node parent_Cf, MemoryApplication memoryApplication, Log_Reports log_Reports) { Configurationtree_Node cur_Cf; cur_Cf = new Configurationtree_NodeImpl(NamesNode.S_F_LISTBOX_VALIDATION, parent_Cf); return cur_Cf; }
//──────────────────────────────────────── /// <summary> /// 独自実装のモデルをセットアップするタイミング。 /// </summary> protected override void On_P2_NewModelSetup(Log_Reports pg_Logging) { // このエディター用に、ノレンをカスタマイズ。 // 上書き this.Owner_MemoryApplication.MemoryForms.UsercontrolCreator1.Dictionary_UsercontrolCreator[NamesF.S_LST] = new UsercontrolCreator2_Lst03Impl(); }
//──────────────────────────────────────── public override string P2b_GetStyleName( int nCurIx, CustomcontrolListbox cctLst, Log_Reports pg_Logging ) { Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); pg_Method.BeginMethod(Info_LayoutImpl.Name_Library, this, "P2_GetStyleAttrNames",pg_Logging); // // string sResult; // 行をセットしたので、取り出されるのも行です。 // DataRowをセットしましたが、取り出されるのは DataRowViewになるようです。 DataRowView row = (DataRowView)cctLst.Items[nCurIx]; // スタイルのNAME値が入っている。 Value_Humaninput valueH = Utility_Row.GetFieldvalue( NamesFld.S_EXPL_SS, row.Row, false,//該当なしも可 pg_Logging, Info_LayoutImpl.Name_Library+":"+this.GetType().Name+"#P2_:リストボックスのEXPL-SS" ); if (!pg_Logging.Successful) { // 既エラー。 sResult = ""; goto gt_EndMethod; } if (pg_Logging.Successful) { // 正常時 if (null == valueH) { sResult = ""; } else { sResult = ((Value_Humaninput)valueH).Text; } } else { sResult = ""; } goto gt_EndMethod; // // // // gt_EndMethod: pg_Method.EndMethod(pg_Logging); return sResult; }
//──────────────────────────────────────── public XenonStyle Parse(string sText, Log_Reports log_Reports) { Log_Method pg_Method = new Log_MethodImpl(0); pg_Method.BeginMethod(Info_Operating.Name_Library, this, "Parse",log_Reports); XenonStyle o_Style = new XenonStyleImpl(); string[] properties = sText.Split(';'); foreach (string sProperty in properties) { string[] keyValue = sProperty.Split(':'); if (2 <= keyValue.Length) { if ("color" == keyValue[0].Trim().ToLower()) { string sValue = keyValue[1].Trim().ToLower(); ColorResult colorResult = BuilderColor.Parse(keyValue[1].Trim().ToLower(), Color.Black, true); if (colorResult.BNotFound) { // 該当がなければ // #連続エラー処理 if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー4301!", pg_Method); r.Message = "color属性に["+sValue+"]が指定されましたが、対応していない値です。"; log_Reports.EndCreateReport(); } } else { o_Style.ForeXenonColor = new XenonColorImpl(); o_Style.ForeXenonColor.Color = colorResult.Color; o_Style.ForeXenonColor.Name_Color = sValue; } } else { // 無視 } } else { // エラー処理 } } goto gt_EndMethod; // // gt_EndMethod: pg_Method.EndMethod(log_Reports); return o_Style; }
/// <summary> /// 構成カスタム・コントロールを全て破棄します。 /// </summary> public void DestractAllCustomcontrols(Log_Reports log_Reports) { foreach (Customcontrol cct in this.List_Customcontrol) { cct.Destruct( log_Reports ); } }
//──────────────────────────────────────── /// <summary> /// 未実装。 /// </summary> /// <param name="oFStrNode"></param> /// <param name="nFAelem"></param> /// <param name="memoryApplication"></param> /// <param name="log_Reports"></param> public override void Translate( Configurationtree_Node cur_Cf,//<def-param> Expression_Node_String parent_Ec,//親<●●>要素。汎用。 MemoryApplication memoryApplication, Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog, Log_Reports log_Reports ) { }
//──────────────────────────────────────── /// <summary> /// コンストラクター。 /// </summary> /// <param name="form"></param> public ConfigurationtreeToFunction_ListImpl( Expression_Node_String parent_Expression, Configuration_Node cur_Conf, MemoryApplication owner_MemoryApplication, Log_Reports log_Reports ) { this.owner_MemoryApplication = owner_MemoryApplication; }
//──────────────────────────────────────── /// <summary> /// イベント アクション リストを作成します。 /// </summary> /// <param nFcName="eventName"></param> /// <param nFcName="nActionSuper"></param> /// <param nFcName="log_Reports"></param> public Functionlist CreateFunctionlist( ConfigurationtreeToExpression_Event sToE_Event, MemoryApplication owner_MemoryApplication, Log_Reports log_Reports ) { Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); pg_Method.BeginMethod(Info_Controls.Name_Library, this, "CreateFunctionlist",log_Reports); // // Functionlist fw_Result = null; //.WriteLine(this.GetType().Name + "#CreateEventActionList: <構築>【開始】 イベントに対応ついたアクションリストを追加します。 (ウィンドウ)"); switch (sToE_Event.Name) { case NamesSe.S_LOAD: { // // このコントロールの「アプリケーション起動時」。 // // (NActionPerformEnum.O_EA) // // // 無視します。 // } break; default: goto gt_Error_NotSupportedEvent; } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_NotSupportedEvent: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, this.GetType().Name, log_Reports);//クラス名 tmpl.SetParameter(2, sToE_Event.Name, log_Reports);//イベント名 tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(sToE_Event.Configurationtree_Event), log_Reports);//設定位置パンくずリスト this.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:515;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: pg_Method.EndMethod(log_Reports); return fw_Result; }
//──────────────────────────────────────── /// <summary> /// ユーザー定義プログラムの実行。 /// </summary> /// <param name="hits"></param> /// <param name="log_Reports"></param> /// <returns></returns> public override string Execute4_OnExpressionString( EnumHitcount hits, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Expr.Name_Library, this, "Execute4_OnExpressionString",log_Reports); // // // // 子<a-●●>要素の実行。 // // 全部真なら真、1つでも偽なら偽。 bool bResult = true; { List<Expression_Node_String> ecList_Child = this.List_Expression_Child.SelectList(//Nv_Elem EnumHitcount.Unconstraint, log_Reports ); // ★★★★★★★★★ここが遅い? 42項目あると、42個全部調べることになります。 //ystem.Console.WriteLine(this.GetType().Name + "#GetString: 全部真か? childNList.Count=[" + childNList.Count + "]"); foreach (Expression_Node_String ec_11 in ecList_Child) { Expressionv_Elem99 ecv_Elem = (Expressionv_Elem99)ec_11; ecv_Elem.SetDataRow(this.DataRow); string str = ecv_Elem.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports); // ★★★★★★★★★ここが遅い? 42項目あると、42個全部調べることになります。 //ystem.Console.WriteLine(this.GetType().Name + "#GetString: str=[" + str + "]"); bool bChild; if (Boolean.TryParse(str, out bChild)) { if (!bChild) { bResult = false; goto loop_end; } } } loop_end: ;//空文 } // // // // log_Method.EndMethod(log_Reports); return bResult.ToString(); }
//──────────────────────────────────────── /// <summary> /// 妥当性判定ロジックを追加します。 /// </summary> /// <param nFcName="nValidator"></param> public void AddValidator( Expressionv_Validator_Old ecv_Validator, Log_Reports log_Reports ) { if (ecv_Validator is Expressionv_TextValidator_Old) { this.list_Expressionv_Validator.Add((Expressionv_TextValidator_Old)ecv_Validator); } }
//──────────────────────────────────────── protected virtual void Test_ChildNodes(XmlElement cur_X, Configurationtree_Node cur_Cf, Log_Reports log_Reports) { }
//──────────────────────────────────────── protected override void Parse_ChildNodes( XmlElement cur_X, Configurationtree_Node cur_Cf, MemoryApplication memoryApplication, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "Parse_ChildNodes", log_Reports); // XmlElement err_XADisplay = null; Usercontrol uct = null; if (log_Reports.Successful) { Configuration_Node cf_Control = cur_Cf.GetParentByNodename( NamesNode.S_CONTROL1, EnumConfiguration.Tree, true, log_Reports); if (log_Reports.Successful) { uct = Utility_XmlToConfigurationtree_NodeImpl.GetUsercontrol( (Configurationtree_Node)cf_Control, memoryApplication, log_Reports); } } if (log_Reports.Successful) { if (uct is UsercontrolListbox) { // // リストボックスなら。 UsercontrolListbox uctLst = (UsercontrolListbox)uct; // // <a-select-record>、<a-display>要素 // XmlNodeList child_XNl = cur_X.ChildNodes; foreach (XmlNode x_childNode in child_XNl) { if (XmlNodeType.Element == x_childNode.NodeType) { XmlElement xChild = (XmlElement)x_childNode; err_XADisplay = xChild; string child_SName_Fnc = xChild.GetAttribute(PmNames.S_NAME.Name_Attribute); // // if (NamesFnc.S_VLD_DISPLAY == child_SName_Fnc)//【変更 2012-07-19】 { XmlToConfigurationtree_C15_Elm to = XmlToConfigurationtree_Collection.GetTranslatorByFncName(child_SName_Fnc, log_Reports); to.XmlToConfigurationtree( xChild, cur_Cf, memoryApplication, log_Reports ); } else if (NamesFnc.S_VLD_SELECT_RECORD == child_SName_Fnc) { // Sf:Vld-SelectRecord; XmlToConfigurationtree_C15_Elm to = XmlToConfigurationtree_Collection.GetTranslatorByFncName(child_SName_Fnc, log_Reports); to.XmlToConfigurationtree( xChild, cur_Cf, memoryApplication, log_Reports ); } else { // // エラー。 goto gt_Error_UndefinedChild11; } } } } } goto gt_EndMethod; // #region 異常系 //──────────────────────────────────────── gt_Error_UndefinedChild11: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー385!", log_Method); StringBuilder s = new StringBuilder(); s.Append("<f-list-box-validation>要素に、<a-display><a-select-record>要素以外の要素"); s.Append(Environment.NewLine); s.Append("["); s.Append(err_XADisplay.Name); s.Append("]が含まれていました。"); s.Append(Environment.NewLine); s.Append(Environment.NewLine); // ヒント r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_UndefinedClass: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー386!", log_Method); StringBuilder s = new StringBuilder(); s.Append("なんらかのエラー。"); s.Append(Environment.NewLine); // ヒント r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── protected override Configurationtree_Node CreateMyself( XmlElement cur_X, Configurationtree_Node parent_Cf, MemoryApplication memoryApplication, Log_Reports log_Reports) { Configurationtree_Node cur_Cf; cur_Cf = new Configurationtree_NodeImpl(NamesNode.S_F_LISTBOX_VALIDATION, parent_Cf); return(cur_Cf); }
//──────────────────────────────────────── protected void Execute6_Sub( ListBox pcLst, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute6_Sub", 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(); } DataRowView selectedDataRow = (DataRowView)pcLst.SelectedItem; if (null == selectedDataRow) { // 選択している行がなければ。 goto gt_Error_NotFoundSelectedRow; } Expression_Node_String ec_ArgTableName; this.TrySelectAttribute(out ec_ArgTableName, Expression_Node_Function32Impl.PM_NAME_TABLE, EnumHitcount.One_Or_Zero, log_Reports); Table_Humaninput o_Table = this.Owner_MemoryApplication.MemoryTables.GetTable_HumaninputByName( ec_ArgTableName, true, log_Reports ); if (null == o_Table) { // エラー中断。 goto gt_EndMethod; } DataTable dataTable = o_Table.DataTable; //.WriteLine(this.GetType().Name + "#: ◆ テーブルはあった。"); // 現在選択しているレコードの NOフィールドの値を取得します。 { string sArgFieldName; this.TrySelectAttribute(out sArgFieldName, Expression_Node_Function32Impl.PM_NAME_FIELD, EnumHitcount.One_Or_Zero, log_Reports); Int_HumaninputImpl cellData = (Int_HumaninputImpl)selectedDataRow[sArgFieldName]; string sFieldValue = cellData.Text.Trim(); //.WriteLine(this.GetType().Name + "#: ◆ fieldValue=[" + fieldValue + "]"); Expression_Node_String ec_ArgDestinationFcName; this.TrySelectAttribute(out ec_ArgDestinationFcName, Expression_Node_Function32Impl.PM_NAME_CONTROL_DESTINATION, EnumHitcount.One_Or_Zero, log_Reports); // コントロールに格納します。 List <Usercontrol> list_FcUc; { list_FcUc = this.Owner_MemoryApplication.MemoryForms.GetUsercontrolsByName( ec_ArgDestinationFcName, true, log_Reports ); } if (log_Reports.Successful) { Usercontrol fcUc = list_FcUc[0]; fcUc.UsercontrolText = sFieldValue; } } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_NotFoundSelectedRow: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, pcLst.SelectedIndex.ToString(), log_Reports);//リストボックスで選択している項目のindex this.Owner_MemoryApplication.CreateErrorReport("Er:110016;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── /// <summary> /// パーサーのハブ。 /// /// </summary> /// <param name="request_ReadsTable">テーブルに付けたい名前や、ファイルパスの要求。</param> /// <param name="xenonTableFormat_puts">テーブルの行列が逆になっているなどの、設定。</param> /// <param name="isRequired">テーブルが無かった場合、エラーとするなら真。</param> /// <param name="out_sErrorMsg"></param> /// <returns></returns> public Table_Humaninput Read( Request_ReadsTable request_ReadsTable, Format_Table_Humaninput xenonTableFormat_puts, bool isRequired, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(); log_Method.BeginMethod(Info_Table.Name_Library, this, "Read", log_Reports); Table_Humaninput xenonTable_Result; string filepathabsolute_Csv = request_ReadsTable.Expression_Filepath.Execute4_OnExpressionString( EnumHitcount.Unconstraint, log_Reports); if (!log_Reports.Successful) { // 既エラー。 xenonTable_Result = null; goto gt_EndMethod; } string string_Csv; // CSVテキスト Exception error_Excp; if (CsvTo_Table_HumaninputImpl.S_WRITE_ONLY != request_ReadsTable.Use) { // 書き出し専用でなければ。 // ファイル読取を実行します。 try { if (!System.IO.File.Exists(filepathabsolute_Csv)) { // ファイルが存在しない場合。 xenonTable_Result = null; goto gt_Error_NotExistsFile; } // TODO:IOException 別スレッドで開いているときなど。 string_Csv = System.IO.File.ReadAllText(filepathabsolute_Csv, Global.ENCODING_CSV); //log_Method.WriteDebug_ToConsole(string_Csv); } catch (System.IO.IOException e) { // エラー処理。 xenonTable_Result = null; string_Csv = ""; error_Excp = e; goto gt_Error_FileOpen; } catch (Exception e) { // エラー処理。 xenonTable_Result = null; string_Csv = ""; error_Excp = e; goto gt_Error_Exception; } } else { string_Csv = ""; } xenonTable_Result = this.Read( string_Csv, request_ReadsTable, xenonTableFormat_puts, log_Reports ); if (!log_Reports.Successful) { // 既エラー。 goto gt_EndMethod; } // NOフィールドの値を 0からの連番に振りなおします。 xenonTable_Result.RenumberingNoField(); if (isRequired && null == xenonTable_Result) { goto gt_Error_NullTable; } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_FileOpen: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("Er:201;", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("ファイルの読取りに失敗しました。"); s.Newline(); s.Newline(); s.Append(" ファイル=["); s.Append(filepathabsolute_Csv); s.Append("]"); s.Newline(); s.Newline(); s.Append("もしかして?"); s.Newline(); s.Append(" ・ファイルの有無、ファイル名、ファイル パスを確認してください。"); s.Newline(); s.Append(" ・別アプリケーションで ファイルを開いていれば、閉じてください。"); s.Newline(); s.Newline(); // // ヒント request_ReadsTable.Expression_Filepath.Cur_Configuration.ToText_Locationbreadcrumbs(s); s.Append(error_Excp.Message); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_NotExistsFile: if (log_Reports.CanCreateReport) { if ("" == request_ReadsTable.Expression_Filepath.Directory_Base) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("Er:202;", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("指定されたファイルはありませんでした。CSVファイルを読み込もうとしたとき。"); s.Newline(); s.Newline(); s.AppendI(1, "指定されたファイルパス=["); s.Append(filepathabsolute_Csv); s.Append("]"); s.Newline(); { s.AppendI(1, "ベース・ディレクトリは指定されていません。"); s.Newline(); s.AppendI(2, "もし相対パスが指定されていた場合、実行した.exeファイルからの相対パスとします。"); s.Newline(); s.Newline(); } s.Append(" ヒント:ファイルの有無、ファイル名、ファイル パスを確認してください。"); s.Newline(); // ヒント s.Append(r.Message_Configuration( request_ReadsTable.Expression_Filepath.Cur_Configuration)); r.Message = s.ToString(); } else { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー235!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("指定されたファイルはありませんでした。CSVファイルを読み込もうとしたとき。"); s.Newline(); s.Newline(); s.AppendI(1, "指定されたファイルパス=["); s.Append(filepathabsolute_Csv); s.Append("]"); s.Newline(); { s.AppendI(1, "指定されたベース・ディレクトリ=["); s.Append(request_ReadsTable.Expression_Filepath.Directory_Base); s.Append("]"); s.Newline(); s.Newline(); } s.Append(" ヒント:ファイルの有無、ファイル名、ファイル パスを確認してください。"); s.Newline(); // ヒント s.Append(r.Message_Configuration( request_ReadsTable.Expression_Filepath.Cur_Configuration)); r.Message = s.ToString(); } log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_Exception: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー104!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("▲エラー4030!(" + Info_Table.Name_Library + ")"); s.Newline(); s.Append("CSV読み取り中にエラーが発生しました。"); s.Append(Environment.NewLine); s.Append(Environment.NewLine); s.Append("指定CSVファイル=["); s.Append(filepathabsolute_Csv); s.Append("]"); s.Append(Environment.NewLine); s.Append(Environment.NewLine); // // ヒント request_ReadsTable.Expression_Filepath.Cur_Configuration.ToText_Locationbreadcrumbs(s); s.Append("エラーの種類:"); s.Append(error_Excp.GetType().Name); s.Append(Environment.NewLine); s.Append(Environment.NewLine); s.Append("エラーメッセージ:"); s.Append(error_Excp.Message); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_NullTable: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー105!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("▲エラー131!"); s.Newline(); s.Append("["); s.Append(request_ReadsTable.Name_PutToTable); s.Append("]テーブルがありませんでした。"); s.Append(Environment.NewLine); s.Append(Environment.NewLine); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); return(xenonTable_Result); }
//──────────────────────────────────────── public void Translate( Configurationtree_Node cur_Conf, Expressionv_4ADisplayImpl exprv_ADisplay, MemoryApplication memoryApplication, Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports); if (log_Method.CanDebug(1)) { pg_ParsingLog.Increment("(38)" + cur_Conf.Name); } // // // // // // 自 // // // Expressionv_5FAllTrueImpl cur_Exprv = new Expressionv_5FAllTrueImpl(exprv_ADisplay, cur_Conf, memoryApplication); // // // // 子 // // // if (log_Reports.Successful) { exprv_ADisplay.List_Expression_Child.Add( cur_Exprv, log_Reports ); } // // // // 子 // // // List <Configurationtree_Node> cfList_Fnc = cur_Conf.GetChildrenByNodename(NamesNode.S_FNC, false, log_Reports); foreach (Configurationtree_Node cf_Child in cfList_Fnc) { string child_SName_Fnc; cf_Child.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out child_SName_Fnc, true, log_Reports); if (NamesFnc.S_VLD_EMPTY_FIELD == child_SName_Fnc) { // <a-empty-field>要素 ConfigurationtreeToExpression_V55_AEmptyFieldImpl_ to = new ConfigurationtreeToExpression_V55_AEmptyFieldImpl_(); to.Translate( cf_Child, cur_Exprv, memoryApplication, pg_ParsingLog, log_Reports ); } else { if (log_Method.CanDebug(0)) { log_Method.WriteError_ToConsole("未実装です。"); } throw new Exception("未実装です。"); } } goto gt_EndMethod; // // // // gt_EndMethod: if (Log_ReportsImpl.BDebugmode_Static) { pg_ParsingLog.Decrement(cur_Conf.Name); } log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// データ・ターゲットへの出力を行います。 /// /// イベント・ハンドラー以外でも、直接、データターゲットへの出力を行うことができます。 /// </summary> public void UsercontrolToMemory( Log_Reports log_Reports ) { Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); pg_Method.BeginMethod(Info_Controls.Name_Library, this, "UsercontrolToMemory(10)", log_Reports); // // if (null == this.ControlCommon.Expression_Control) { // このコントロールに対応づくテーブル等の設定がなく、ただの空箱の場合。 // Visual Studio のビジュアルエディターで直接置いただけの時は、ここに来ます。 // 何もせず終了。 goto gt_EndMethod; } List <Expression_Node_String> ecList_Data = this.ControlCommon.Expression_Control.SelectDirectchildByNodename(NamesNode.S_DATA, false, EnumHitcount.Unconstraint, log_Reports); List <Expression_Node_String> ecList_DataTarget = Utility_Expression_NodeImpl.SelectItemsByPmAsCsv(ecList_Data, PmNames.S_ACCESS.Name_Pm, ValuesAttr.S_TO, false, EnumHitcount.First_Exist, log_Reports); if (!log_Reports.Successful) { goto gt_EndMethod; } Expression_Node_String ec_DataTarget = ecList_DataTarget[0]; if (null == ec_DataTarget) { // エラー: データターゲットが未設定のとき goto gt_Error_NullDatatarget; } else { // データターゲットが設定されているとき CustomcontrolCheckbox ccCheckBox = this;//イベントハンドラーのsender引数と一致すること。 // TODO 数値型テキストボックスで空白を出力しようとしたときにエラーになるのはバグなので修正したい。 // 特にトリムは行いません。 switch (this.enumCheckboxValuetype) { case EnumCheckboxValuetype.Bool: { ToMemory_Performer nDataTargetUpdater = new ExpressionDataTargetUpdaterImpl(); nDataTargetUpdater.ToMemory( ccCheckBox.Checked.ToString(), this.ControlCommon.Expression_Control, this.ControlCommon.Owner_MemoryApplication, log_Reports ); } break; case EnumCheckboxValuetype.Zero_One: { int nCheckedInt; if (ccCheckBox.Checked) { nCheckedInt = 1; } else { nCheckedInt = 0; } ToMemory_Performer nDataTargetUpdater = new ExpressionDataTargetUpdaterImpl(); nDataTargetUpdater.ToMemory( nCheckedInt.ToString(), this.ControlCommon.Expression_Control, this.ControlCommon.Owner_MemoryApplication, log_Reports ); } break; default: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, this.enumCheckboxValuetype.ToString(), log_Reports); //未定義のEnum値。 this.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:506;", tmpl, log_Reports); } break; } if (log_Reports.Successful) { // 成功時 ccCheckBox.BackColor = System.Drawing.SystemColors.Window; } else { // 設定失敗時。 ccCheckBox.BackColor = Color.Yellow; } } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_NullDatatarget: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, this.Name, log_Reports);//コントロール名 this.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:502;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: pg_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// 例えば "data" と指定すれば、 /// 直下の子要素の中で <data > といったノード名を持つものはヒットする。 /// </summary> /// <param name="sName"></param> /// <param name="sExpectedValue"></param> /// <param name="request"></param> /// <param name="log_Reports"></param> /// <returns></returns> public static List <Expr_String> SelectItemByNodeName( List <Expr_String> eItems, string sName_ExpectedNode, bool bRemove, EnumHitcount request, Log_Reports log_Reports) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_Syntax.Name_Library, "Expression_Node_StringImpl", "SelectItemByNodeName", log_Reports); List <Expr_String> result = new List <Expr_String>(); for (int nI = 0; nI < eItems.Count; nI++) { Expr_String eItem = eItems[nI]; if (log_Reports.Successful) { if (eItem.Conf.Name == sName_ExpectedNode) { result.Add(eItem); if (bRemove) { // 削除を要求します。 eItems.RemoveAt(nI); nI--; } if (EnumHitcount.First_Exist == request || EnumHitcount.First_Exist_Or_Zero == request) { // 最初の1件で終了。複数件ヒットするかどうかは判定しない。 break; } } } } if (EnumHitcount.One == request) { // 必ず1件だけヒットする想定。 if (result.Count != 1) { goto gt_errorNotOne; } } else if (EnumHitcount.First_Exist == request) { // 必ずヒットする。複数件あれば、最初の1件だけ取得。 if (0 == result.Count) { goto gt_errorNoHit; } else if (1 < result.Count) { result.RemoveRange(1, result.Count - 1); } } else if (EnumHitcount.First_Exist_Or_Zero == request) { // ヒットすれば最初の1件だけ、ヒットしなければ0件の想定。 if (1 < result.Count) { result.RemoveRange(1, result.Count - 1); } } else { } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_errorNoHit: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー102!", log_Method); StringBuilder sb = new StringBuilder(); sb.Append("必ず、1件以上ヒットする指定でしたが、["); sb.Append(result.Count); sb.Append("]件ヒットしました。"); sb.Append(Environment.NewLine); sb.Append(Environment.NewLine); // ヒント r.Message = sb.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; // // gt_errorNotOne: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー101!", log_Method); StringBuilder sb = new StringBuilder(); sb.Append("必ず、1件のみ取得する指定でしたが、["); sb.Append(result.Count); sb.Append("]件取得しました。"); sb.Append(Environment.NewLine); sb.Append(Environment.NewLine); // ヒント r.Message = sb.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); return(result); }
//──────────────────────────────────────── /// <summary> /// 例えば "data" と指定すれば、 /// 直下の子要素の中で <data > といったノード名を持つものはヒットする。 /// </summary> /// <param name="sName"></param> /// <param name="sExpectedValue"></param> /// <param name="request"></param> /// <param name="log_Reports"></param> /// <returns></returns> public List <Expr_String> SelectDirectchildByNodename( string sExpectedNodeName, bool bRemove, EnumHitcount request, Log_Reports log_Reports) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_Syntax.Name_Library, this, "Divide3Blocks", log_Reports); List <Expr_String> result = new List <Expr_String>(); this.ChildNodes.ForEach(delegate(Expr_String eChild, ref bool bRemove2, ref bool bBreak2) { if (log_Reports.Successful) { if (eChild.Conf.Name == sExpectedNodeName) { result.Add(eChild); if (bRemove) { // 削除要求1があるとき、削除要求2を出します。 bRemove2 = true; } if (EnumHitcount.First_Exist == request || EnumHitcount.First_Exist_Or_Zero == request) { // 最初の1件で削除は終了。複数件ヒットするかどうかは判定しない。 bBreak2 = true; } } } }); if (EnumHitcount.One == request) { // 必ず1件だけヒットする想定。 if (result.Count != 1) { goto gt_errorNotOne; } } else if (EnumHitcount.First_Exist == request) { // 必ずヒットする。複数件あれば、最初の1件だけ取得。 if (0 == result.Count) { goto gt_errorNoHit; } else if (1 < result.Count) { result.RemoveRange(1, result.Count - 1); } } else if (EnumHitcount.First_Exist_Or_Zero == request) { // ヒットすれば最初の1件だけ、ヒットしなければ0件の想定。 if (1 < result.Count) { result.RemoveRange(1, result.Count - 1); } } else { } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_errorNoHit: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー102!", log_Method); StringBuilder sb = new StringBuilder(); sb.Append("必ず、1件以上ヒットする指定でしたが、["); sb.Append(result.Count); sb.Append("]件ヒットしました。"); sb.Append(Environment.NewLine); sb.Append(Environment.NewLine); // ヒント r.Message = sb.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; // // gt_errorNotOne: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー101!", log_Method); StringBuilder sb = new StringBuilder(); sb.Append("必ず、1件のみ取得する指定でしたが、["); sb.Append(result.Count); sb.Append("]件取得しました。"); sb.Append(Environment.NewLine); sb.Append(Environment.NewLine); // ヒント r.Message = sb.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); return(result); }
//──────────────────────────────────────── /// <summary> /// こんなイベントハンドラーを持っていますよ、という情報を作成。 /// </summary> /// <param nFcName="entry"></param> /// <param nFcName="delegateFI"></param> /// <param nFcName="keyFI"></param> /// <param nFcName="nextFI"></param> private void BuildListWalk( object head,//entry FieldInfo fi_Handler, FieldInfo fi_Key, FieldInfo fi_Next, MemoryApplication owner_MemoryApplication, Log_Reports log_Reports ) { Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); pg_Method.BeginMethod(Info_Controls.Name_Library, this, "BuildListWalk", log_Reports); // // Exception err_Excp = null; Delegate err_Dele = null; object err_Key = null; object err_Next = null; if (log_Reports.Successful) { //.Console.WriteLine(this.GetType().NFcName + "#BuildListWalk: 【実行】"); try { if (null != head) { Delegate dele = (Delegate)fi_Handler.GetValue(head); if (null != dele) { object key = fi_Key.GetValue(head); object next = fi_Next.GetValue(head); err_Dele = dele; err_Key = key; err_Next = next; // デリゲーターの呼び出しリスト Delegate[] listeners = dele.GetInvocationList(); if (listeners != null && 0 < listeners.Length) { dictionary_EventHandler.Add(key, listeners); } if (null != next) { this.BuildListWalk( next, fi_Handler, fi_Key, fi_Next, owner_MemoryApplication, log_Reports ); } } } } catch (Exception e) { err_Excp = e; goto gt_Error_Exception; } } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_Exception: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, err_Excp.GetType().Name, log_Reports); //例外の型名 tmpl.SetParameter(2, err_Excp.Message, log_Reports); //例外メッセージ //fi_Handlerの型名 if (null == fi_Handler) { tmpl.SetParameter(3, "ヌル", log_Reports); } else { tmpl.SetParameter(3, fi_Handler.GetType().Name, log_Reports); } //err_Deleの型名 if (null == err_Dele) { tmpl.SetParameter(4, "ヌル", log_Reports); } else { tmpl.SetParameter(4, err_Dele.GetType().Name, log_Reports); } //fi_Keyの型名 if (null == fi_Key) { tmpl.SetParameter(5, "ヌル", log_Reports); } else { tmpl.SetParameter(5, fi_Key.GetType().Name, log_Reports); } //err_Keyの型名 if (null == err_Key) { tmpl.SetParameter(6, "ヌル", log_Reports); } else { tmpl.SetParameter(6, err_Key.GetType().Name, log_Reports); } //nextFIの型名 if (null == fi_Next) { tmpl.SetParameter(7, "ヌル", log_Reports); } else { tmpl.SetParameter(7, fi_Next.GetType().Name, log_Reports); } //err_Nextの型名 if (null == fi_Next) { tmpl.SetParameter(8, "ヌル", log_Reports); } else { tmpl.SetParameter(8, err_Next.GetType().Name, log_Reports); } owner_MemoryApplication.CreateErrorReport("Er:529;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: pg_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// こんなイベントハンドラーを持っていますよ、という情報を作成。 /// </summary> /// <param nFcName="log_Reports"></param> private void BuildList( MemoryApplication owner_MemoryApplication, Log_Reports log_Reports ) { Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); pg_Method.BeginMethod(Info_Controls.Name_Library, this, "BulidList", log_Reports); // // Exception err_Excp; if (log_Reports.Successful) { try { this.dictionary_EventHandler = new Dictionary <object, Delegate[]>(); object head = this.fieldinfo_Head_EventHandlerListType_Control.GetValue( this.eventHandlerList_Control); if (head != null) { // クラスの情報を直接見ます。(listEntryType) Type type = head.GetType(); BindingFlags flag = BindingFlags.NonPublic | BindingFlags.Instance; // クラスのフィールドの情報を直接見ます。 FieldInfo fi_Handler = type.GetField( Remover_AllEventhandlersImpl.S_HANDLER, flag); FieldInfo fi_Key = type.GetField( Remover_AllEventhandlersImpl.S_KEY, flag); FieldInfo fi_Next = type.GetField( Remover_AllEventhandlersImpl.S_NEXT, flag); this.BuildListWalk( head, fi_Handler, fi_Key, fi_Next, owner_MemoryApplication, log_Reports ); } } catch (Exception e) { //エラー err_Excp = e; goto gt_Error_AnotherEvent; } } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_AnotherEvent: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, err_Excp.GetType().Name, log_Reports); //例外の型名 tmpl.SetParameter(2, err_Excp.Message, log_Reports); //例外メッセージ owner_MemoryApplication.CreateErrorReport("Er:528;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: pg_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── public Remover_AllEventhandlersImpl( Control control, MemoryApplication owner_MemoryApplication, Log_Reports log_Reports ) { Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); pg_Method.BeginMethod(Info_Controls.Name_Library, this, "Remover_AllEventhandlersImpl", log_Reports); // // if (control == null) { goto gt_Error_NullControl; } Exception err_Excp; Type err_Type_Control = null; Type err_Type_EventHandlerListType_Control = null; try { Type type_Control = control.GetType(); err_Type_Control = type_Control; BindingFlags flag = BindingFlags.NonPublic | BindingFlags.Instance; PropertyInfo propertyinfo_SrcControlEvents = type_Control.GetProperty( Remover_AllEventhandlersImpl.S_EVENTS, flag); this.eventHandlerList_Control = (EventHandlerList)propertyinfo_SrcControlEvents.GetValue( control, null); Type type_EventHandlerListType_Control = this.eventHandlerList_Control.GetType(); err_Type_EventHandlerListType_Control = type_EventHandlerListType_Control; this.fieldinfo_Head_EventHandlerListType_Control = type_EventHandlerListType_Control.GetField( Remover_AllEventhandlersImpl.S_HEAD, flag); } catch (Exception e) { // エラー err_Excp = e; goto gt_Error_Exception; } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_NullControl: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); //%N%なし owner_MemoryApplication.CreateErrorReport("Er:514;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_Exception: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, err_Excp.GetType().Name, log_Reports); //例外の型名 tmpl.SetParameter(2, err_Excp.Message, log_Reports); //例外メッセージ if (null == err_Type_Control) { tmpl.SetParameter(3, "ヌル", log_Reports);//コントロールの型名 } else { tmpl.SetParameter(3, err_Type_Control.GetType().Name, log_Reports);//コントロールの型名 } if (null == this.eventHandlerList_Control) { tmpl.SetParameter(4, "ヌル", log_Reports);//イベントハンドラーリストの型名 } else { tmpl.SetParameter(4, this.eventHandlerList_Control.GetType().Name, log_Reports);//イベントハンドラーリストの型名 } owner_MemoryApplication.CreateErrorReport("Er:527;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: pg_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// 全てのイベントハンドラーを削除します。 /// </summary> public void Suppress( MemoryApplication owner_MemoryApplication, Log_Reports log_Reports ) { Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); pg_Method.BeginMethod(Info_Controls.Name_Library, this, "Suppress", log_Reports); // // Exception err_Excp; if (log_Reports.Successful) { try { if (dictionary_EventHandler != null) { throw new ApplicationException("Events are already being suppressed."); } this.BuildList( owner_MemoryApplication, log_Reports ); foreach (KeyValuePair <object, Delegate[]> pair in dictionary_EventHandler) { for (int nX = pair.Value.Length - 1; nX >= 0; nX--) { this.eventHandlerList_Control.RemoveHandler(pair.Key, pair.Value[nX]); } } } catch (Exception e) { err_Excp = e; goto gt_Error_Exception; } } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_Exception: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, err_Excp.GetType().Name, log_Reports); //例外の型名 tmpl.SetParameter(2, err_Excp.Message, log_Reports); //例外メッセージ owner_MemoryApplication.CreateErrorReport("Er:531;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: pg_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// <要素名 属性=”☆”> の、属性部分を解析。 /// </summary> /// <param name="x_Cur"></param> /// <param name="s_Cur"></param> /// <param name="memoryApplication"></param> /// <param name="log_Reports"></param> protected virtual void Parse_SAttribute( XmlElement cur_X, Configurationtree_Node cur_Cf, MemoryApplication memoryApplication, Log_Reports log_Reports ) { // // // //()メソッド開始 // // // Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "Parse_SAttr", log_Reports); // // // //()全属性解析 // // // XmlAttribute err_XAttr = null; foreach (XmlAttribute xAttr in cur_X.Attributes) { if (this.List_SName_Attribute.Contains(xAttr.Name)) { // ① PmName pmName = PmNames.FromSAttribute(xAttr.Name); if (null != pmName) { cur_Cf.Dictionary_Attribute.Add(pmName.Name_Pm, xAttr.Value, cur_Cf, true, log_Reports); } else { // エラー err_XAttr = xAttr; goto gt_Error_UndefinedAttr; //// 【廃止方針】 //if (log_Method.CanInfo()) //{ // log_Method.WriteInfo_ToConsole("廃止方針のAdd([" + x_Attr.Name + "], [" + x_Attr.Value + "])"); //} //throw new Exception("廃止方針のAdd([" + x_Attr.Name + "], [" + x_Attr.Value + "])"); //s_Cur.Dictionary_Attribute.Add(x_Attr.Name, x_Attr.Value, s_Cur, true, log_Reports); } } else { err_XAttr = xAttr; goto gt_Error_UndefinedAttr; } } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_UndefinedAttr: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, cur_X.Name, log_Reports); //設定ノード名 tmpl.SetParameter(2, err_XAttr.Name, log_Reports); //属性名 tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports); //設定位置パンくずリスト memoryApplication.CreateErrorReport("Er:8008;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── public String Perform(Log_Reports log_Reports) { String sTxtTmpl = this.Text; StringBuilder sb = new StringBuilder(); int nCur = 0; while (nCur < sTxtTmpl.Length) { if (!log_Reports.Successful) { //エラー時は抜ける。 goto gt_EndMethod; } int nPreCur = nCur; //.WriteLine(this.GetType().Name + "#Perform: ループ開始 cur=[" + cur + "] preCur=[" + preCur + "] txtTmpl.Length=[" + txtTmpl.Length + "]"); // 開き%記号(open percent) int nOp = sTxtTmpl.IndexOf('%', nCur); //.WriteLine(this.GetType().Name + "#Perform: op=[" + op + "]"); if (nOp != -1) { // 開き%記号があった。 //.WriteLine(this.GetType().Name + "#Perform: 開き%記号があった。"); nCur = nOp + 1;//「開き%」の次へ。 //.WriteLine(this.GetType().Name + "#Perform: cur=[" + cur + "]"); // 閉じ%記号(close percent) int nCp = sTxtTmpl.IndexOf('%', nCur); //.WriteLine(this.GetType().Name + "#Perform: cp=[" + cp + "]"); if (nCp != -1) { // 閉じ%記号があれば。 //.WriteLine(this.GetType().Name + "#Perform: 閉じ%記号があった。"); nCur = nCp + 1;//「閉じ%」の次へ。 //.WriteLine(this.GetType().Name + "#Perform: cur=[" + cur + "]"); // 「%」と「%」の間に数字があるはず。 // 「開き%」の次から、「閉じ% - 開き% - 1」文字分。(-1しないと、終了%を含んでしまう) string sMarker = sTxtTmpl.Substring(nOp + 1, nCp - nOp - 1); //.WriteLine(this.GetType().Name + "#Perform: marker=[" + marker + "]"); int nParameterIndex; try { nParameterIndex = Int32.Parse(sMarker); //.WriteLine(this.GetType().Name + "#Perform: parameterIndex=[" + parameterIndex + "]"); // %数字%を、引数の内容に置換。 //.WriteLine(this.GetType().Name + "#Perform: %数字%を、引数の内容に置換。"); // 開き「%」までを、まず文字列化。 int nPreLen = nOp - nPreCur; string sPre = sTxtTmpl.Substring(nPreCur, nPreLen); sb.Append(sPre); //string paramValue = this.Parameters[parameterIndex]; string sParamValue; //sParamValue = this.Dictionary_NumberAndValue_Parameter[nParameterIndex]; this.TryGetParameter(out sParamValue, nParameterIndex, log_Reports); sb.Append(sParamValue); } catch (Exception) { // 数字でないようなら。 // 今回の判定は失敗したものとして、残りの長さ全て int nRestLen = sTxtTmpl.Length - nPreCur; sb.Append(sTxtTmpl.Substring(nPreCur, nRestLen)); nCur = sTxtTmpl.Length;//終了(最後の文字の次へカーソルを出す) } } else { // 閉じ%がなければ。 //.WriteLine(this.GetType().Name + "#Perform: 閉じ%がなければ。"); // 今回の判定は失敗したものとして、残りの長さ全て int nRestLen = sTxtTmpl.Length - nPreCur; //.WriteLine(this.GetType().Name + "#Perform: restLen=[" + restLen + "]"); sb.Append(sTxtTmpl.Substring(nPreCur, nRestLen)); //.WriteLine(this.GetType().Name + "#Perform: resultTxt=[" + resultTxt.ToString() + "]"); nCur = sTxtTmpl.Length;//終了(最後の文字の次へカーソルを出す) //.WriteLine(this.GetType().Name + "#Perform: cur=[" + cur + "]"); } } else { // 開き%がなければ。 //.WriteLine(this.GetType().Name + "#Perform: 開き%がなければ。"); // 残りの長さ全て int nRestLen = sTxtTmpl.Length - nCur; //.WriteLine(this.GetType().Name + "#Perform: restLen=[" + restLen + "]"); sb.Append(sTxtTmpl.Substring(nCur, nRestLen)); //.WriteLine(this.GetType().Name + "#Perform: resultTxt=[" + resultTxt.ToString() + "]"); nCur = sTxtTmpl.Length;//終了(最後の文字の次へカーソルを出す) //.WriteLine(this.GetType().Name + "#Perform: cur=[" + cur + "]"); } } goto gt_EndMethod; // gt_EndMethod: return(sb.ToString()); }
//──────────────────────────────────────── public virtual string Lv5_Implement( Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(); log_Method.BeginMethod(Info_Syntax.Name_Library, this, "Lv5_Implement", log_Reports); // // StringBuilder sb_Result = new StringBuilder(); List <Expr_String> eChildList = this.ChildNodes.SelectList(EnumHitcount.Unconstraint, log_Reports); switch (this.enumHitcount) { case EnumHitcount.First_Exist: { // // 最初の1件のみ。存在しない場合エラー。 // if (0 < eChildList.Count) { Expr_String eChild = eChildList[0]; string s = eChild.Lv4Execute_OnImplement(this.enumHitcount, log_Reports); sb_Result.Append(s); } else { // // エラー goto gt_Error_NotFoundOne; } } break; case EnumHitcount.First_Exist_Or_Zero: { // // 最初の1件のみ。存在しない場合、空文字列。 // if (0 < eChildList.Count) { Expr_String eChild = eChildList[0]; string s = eChild.Lv4Execute_OnImplement(this.enumHitcount, log_Reports); sb_Result.Append(s); } else { // // 存在しないので、空文字列。 // // そのままスルー。 } } break; case EnumHitcount.Unconstraint: { // // 制限なし // foreach (Expr_String eChild in eChildList) { string s = eChild.Lv4Execute_OnImplement(this.enumHitcount, log_Reports); sb_Result.Append(s); } } break; default: { // // エラー goto gt_Error_UndefinedEnum; } } goto gt_EndMethod; // #region 異常系 //──────────────────────────────────────── gt_Error_NotFoundOne: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー111!", log_Method); StringBuilder sb = new StringBuilder(); sb.Append("必ず、最初の1件を取得する指定でしたが、1件も存在しませんでした。"); sb.Append(Environment.NewLine); sb.Append(Environment.NewLine); // ヒント r.Message = sb_Result.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_UndefinedEnum: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー113!", log_Method); StringBuilder sb = new StringBuilder(); sb.Append("this.requestItems.VolumeConstraintEnum=["); sb.Append(this.enumHitcount.ToString()); sb.Append("]には、プログラム側でまだ未対応です。"); // ヒント r.Message = sb_Result.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // gt_EndMethod: log_Method.EndMethod(log_Reports); return(sb_Result.ToString()); }
//──────────────────────────────────────── public Expression_Node_String Compile( Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(); log_Method.BeginMethod(Info_Syntax.Name_Library, this, "Compile", log_Reports); // String sTxtTmpl = this.Text; Configurationtree_Node parent_Cnf = new Configurationtree_NodeImpl("!ハードコーディング_TextTemplateImpl#Compile", null); Expression_Node_StringImpl result = new Expression_Node_StringImpl(null, parent_Cnf); int nCur = 0; while (nCur < sTxtTmpl.Length) { int nPreCur = nCur; // 開き%記号(open percent) int nOp = sTxtTmpl.IndexOf('%', nCur); if (nOp != -1) { // 開き%記号があった。 nCur = nOp + 1;//「開き%」の次へ。 // 閉じ%記号(close percent) int cp = sTxtTmpl.IndexOf('%', nCur); if (cp != -1) { // 閉じ%記号があれば。 nCur = cp + 1;//「閉じ%」の次へ。 // 「%」と「%」の間に数字があるはず。 // 「開き%」の次から、「閉じ% - 開き% - 1」文字分。(-1しないと、終了%を含んでしまう) string sMarker = sTxtTmpl.Substring(nOp + 1, cp - nOp - 1); // 「%1%」といった記号の数字部分。 int nParameterIndex; try { nParameterIndex = Int32.Parse(sMarker); // 開き「%」までを、まず文字列化。 int nPreLen = nOp - nPreCur; string sPre = sTxtTmpl.Substring(nPreCur, nPreLen); result.AppendTextNode( sPre, parent_Cnf, log_Reports ); // 引数から値を取得。 // %数字%を、Expression化して追加。 Expression_TexttemplateP1pImpl expr_P1p = new Expression_TexttemplateP1pImpl(null, parent_Cnf); expr_P1p.NumberP1p = nParameterIndex; expr_P1p.Dictionary_P1p = this.Dictionary_NumberAndValue_Parameter; result.List_Expression_Child.Add( expr_P1p, log_Reports ); // 続行。 } catch (Exception) { // 数字でないようなら。 // 今回の判定は失敗したものとして、残りの長さ全て int nRestLen = sTxtTmpl.Length - nPreCur; result.AppendTextNode( sTxtTmpl.Substring(nPreCur, nRestLen), parent_Cnf, log_Reports ); nCur = sTxtTmpl.Length;//終了(最後の文字の次へカーソルを出す) } } else { // 閉じ%がなければ。 // 今回の判定は失敗したものとして、残りの長さ全て int nRestLen = sTxtTmpl.Length - nPreCur; result.AppendTextNode( sTxtTmpl.Substring(nPreCur, nRestLen), parent_Cnf, log_Reports ); nCur = sTxtTmpl.Length;//終了(最後の文字の次へカーソルを出す) } } else { // 開き%がなければ。 // 残りの長さ全て int nRestLen = sTxtTmpl.Length - nCur; result.AppendTextNode( sTxtTmpl.Substring(nCur, nRestLen), parent_Cnf, log_Reports ); nCur = sTxtTmpl.Length;//終了(最後の文字の次へカーソルを出す) } } // // log_Method.EndMethod(log_Reports); return(result); }
public void BeginMethod(string sName_Library, string sName_StaticClass, string sName_Method, out Log_Reports log_Reports) { this.name_Library = sName_Library; this.name_Class = sName_StaticClass; this.isStatic = true; this.name_Method = sName_Method; log_Reports = new Log_ReportsImpl(this); // デバッグを行うなら、コールスタックにこのメソッドパスを追加。 if (Log_ReportsImpl.BDebugmode_Static) { log_Reports.Log_Callstack.Push(this); } this.IsActive = true; }
//──────────────────────────────────────── public void Judge( out bool isJudge, string name_KeyField, string value_Expected, bool isRequired_ExpectedValue, DataRow row, Configuration_Node parent_Query, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(); log_Method.BeginMethod(Info_Table.Name_Library, this, "Judge", log_Reports); // try { object obj = row[name_KeyField]; if (obj is DBNull) { isJudge = false; goto gt_Error_DBNull; } Value_Humaninput valueH = (Value_Humaninput)obj; // (5)キーが空欄で、検索ヒット必須でなければ、無視します。【int型フィールドの場合】 if (Int_HumaninputImpl.IsSpaces(valueH)) { isJudge = false; goto gt_EndMethod; } // (6)この行の、キー_フィールドの値を取得。 int keyValue; bool bParsedSuccessful = Int_HumaninputImpl.TryParse( valueH, out keyValue, EnumOperationIfErrorvalue.Error, null, log_Reports ); if (log_Reports.Successful) { if (!bParsedSuccessful) { isJudge = false; if (log_Reports.CanCreateReport) { Log_RecordReports d_Report = log_Reports.BeginCreateReport(EnumReport.Error); d_Report.SetTitle("▲エラー698!", log_Method); d_Report.Message = "int型パース失敗。"; log_Reports.EndCreateReport(); } goto gt_EndMethod; } } // (7)キー値をint型に変換します。 int expectedValue; if (log_Reports.Successful) { bool bParseSuccessful2 = int.TryParse(value_Expected, out expectedValue); if (!bParseSuccessful2) { isJudge = false; if (isRequired_ExpectedValue) { goto gt_Error_Parse; } goto gt_EndMethod; } } else { expectedValue = 0; } if (log_Reports.Successful) { // (8)該当行をレコードセットに追加。 if (keyValue == expectedValue) { // // 該当行なら。 isJudge = true; } else { isJudge = false; } } else { isJudge = false; } } catch (RowNotInTableException) { // (9)指定行がなかった場合は、スルー。 isJudge = false; // // 指定の行は、テーブルの中にありませんでした。 // 再描画と、行の削除が被ったのかもしれません。 // いわゆる「処理中」です。 // //.WriteLine(this.GetType().Name+"#GetValueStringList: ["+refTable.Name+"]テーブルには、["+ttbwIndex+"]行が存在しませんでした。もしかすると、削除されたのかもしれません。エラー:"+e.Message); } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_DBNull: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー244!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("検索キーに指定した["); s.Append(name_KeyField); s.Append("]というフィールドは無いです。"); s.Newline(); // ヒント parent_Query.ToText_Locationbreadcrumbs(s); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_Parse: // 空値ではダメという設定の場合。 if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー287!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.AppendI(0, "<Select_KeyIntImplクラス>"); s.Newline(); s.AppendI(1, "これはint型値のプログラムです。他の型のプログラムを使ってください。"); s.Newline(); s.AppendI(1, "・ヒント:変数が見つからなかった場合もここに来ます。例えば、変数名「$aaa」を書こうとして、「aaa」と書いていませんか?"); s.Newline(); s.AppendI(1, "・ヒント:数値が大きすぎた場合もここに来ます。"); s.Newline(); s.AppendI(1, "sExpectedValue=["); s.Append(value_Expected); s.Append("]"); s.Newline(); s.Newline(); // // ヒント parent_Query.ToText_Locationbreadcrumbs(s); s.AppendI(0, "</Select_KeyIntImplクラス>"); s.Newline(); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); }
public void BeginMethod(string sName_Library, object thisClass, string sName_Method, Log_Reports log_Reports) { this.name_Library = sName_Library; this.name_Class = thisClass.GetType().Name; this.isStatic = false; this.name_Method = sName_Method; // デバッグを行うなら、コールスタックにこのメソッドパスを追加。 if (Log_ReportsImpl.BDebugmode_Static) { log_Reports.Log_Callstack.Push(this); } this.IsActive = true; }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── /// <summary> /// データソースから値を取得し、コントロールに取り込みます。 /// /// データソースが設定されていない場合は、フォームのクリアーになります。 /// </summary> public void RefreshData( Log_Reports log_Reports ) { Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); pg_Method.BeginMethod(Info_Controls.Name_Library, this, "RefreshData", log_Reports); // // List <Expression_Node_String> list_Expr_Data = this.ControlCommon.Expression_Control.SelectDirectchildByNodename(NamesNode.S_DATA, false, EnumHitcount.Unconstraint, log_Reports); List <Expression_Node_String> list_Expr_Datasource = Utility_Expression_NodeImpl.SelectItemsByPmAsCsv(list_Expr_Data, PmNames.S_ACCESS.Name_Pm, ValuesAttr.S_FROM, false, EnumHitcount.First_Exist, log_Reports); if (!log_Reports.Successful) { goto gt_EndMethod; } Expression_Node_String expr_Datasource = list_Expr_Datasource[0]; if (null == expr_Datasource) { // データソースが設定されていないとき this.Clear(); } else { if (log_Reports.Successful) { if (0 < expr_Datasource.List_Expression_Child.Count) { expr_Datasource.List_Expression_Child.ForEach(delegate(Expression_Node_String expr_First, ref bool bRemove, ref bool bBreak) { if (log_Reports.Successful) { // // 最初の1件。なければ空文字列。 // string sValue; if (null == expr_First) { sValue = ""; } else { Expression_Node_String e_str = (Expression_Node_String)expr_First; sValue = e_str.Execute4_OnExpressionString(EnumHitcount.First_Exist_Or_Zero, log_Reports); } switch (this.EnumCheckboxValuetype) { case EnumCheckboxValuetype.Bool: // // // // bool型のチェックボックス // // // { if ("" == sValue.Trim()) { // // 暫定: 空白は、falseとして扱います。 // sValue = "false"; } this.ControlCommon.BAutomaticinputting = true; bool bChecked; bool bResult = bool.TryParse(sValue, out bChecked); this.Checked = bChecked; if (!bResult) { // エラー this.Checked = false; this.BackColor = Color.Red; //#内部メソッド内のエラー { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, sValue, log_Reports); //値 // データソース要素のソースを調べますが、「どのテーブルから取ってきたか」ではなく、 // 「設定ファイルに何と書かれていたか」を取ってきます。 //tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(expr_Datasource.Cur_Configurationtree), log_Reports);//設定位置パンくずリスト tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration( expr_First.Cur_Configuration), log_Reports);//設定位置パンくずリスト this.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:539;", tmpl, log_Reports); } } this.ControlCommon.BAutomaticinputting = false; } break; case EnumCheckboxValuetype.Zero_One: // // // // 0,1型のチェックボックス // // // { if ("" == sValue.Trim()) { // // 暫定: 空白は、0(偽)として扱います。 // sValue = "0"; } this.ControlCommon.BAutomaticinputting = true; int nCheckedInt; bool bResult = int.TryParse(sValue, out nCheckedInt); if (bResult) { if (0 == nCheckedInt) { this.Checked = false; } else if (1 == nCheckedInt) { this.Checked = true; } else { // // 警告 // this.Checked = false; this.BackColor = Color.Red; //#内部メソッド内のエラー { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, nCheckedInt.ToString(), log_Reports); //値 tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(expr_First.Cur_Configuration), log_Reports); //設定位置パンくずリスト this.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:540;", tmpl, log_Reports); } } } else { // // エラー // this.Checked = false; this.BackColor = Color.Red; //#内部メソッド内のエラー { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Configuration(expr_First.Cur_Configuration), log_Reports); //設定位置パンくずリスト this.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:541;", tmpl, log_Reports); } } goto automatic_input_end; // // // // automatic_input_end: this.ControlCommon.BAutomaticinputting = false; } break; default: { // // エラー // this.Checked = false; this.BackColor = Color.Red; //#内部メソッド内のエラー { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Configuration(expr_First.Cur_Configuration), log_Reports); //設定位置パンくずリスト this.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:542;", tmpl, log_Reports); } } break; } } // // 最初の1件のみ。 bBreak = true; }); } else { // 件数が無ければ。 this.ControlCommon.BAutomaticinputting = true; this.Checked = false;// 空にする。 this.ControlCommon.BAutomaticinputting = false; } } else { } } goto gt_EndMethod; // // gt_EndMethod: pg_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── protected void Execute6_Sub( Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute6_Sub", log_Reports); string sFncName0; this.TrySelectAttribute(out sFncName0, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); if (log_Reports.CanStopwatch) { log_Method.Log_Stopwatch.Message = "Nアクション[" + sFncName0 + "]実行"; log_Method.Log_Stopwatch.Begin(); } // // 指定された引数から、または、 // このNAction29要素を含んでいる control要素から、コントロールの名前を取得。 List <Usercontrol> list_Usercontrol; if (log_Reports.Successful) { // 正常時 Expression_Node_String ec_Name_Control; // // コントロール名が指定されていれば、そのコントロール名。 // this.TrySelectAttribute(out ec_Name_Control, Expression_Node_Function29Impl.PM_NAME_CONTROL, EnumHitcount.One_Or_Zero, log_Reports); string sName_Control = ec_Name_Control.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports); if ("" == sName_Control.Trim()) { //コントロール名が指定されていない場合。 // // ・このシステム関数を含んでいるイベント要素→コントロール要素と辿り、コントロール名を取得。 Configuration_Node cf_Event = this.Cur_Configuration.GetParentByNodename( NamesNode.S_EVENT, EnumConfiguration.Unknown, false, log_Reports); if (null != cf_Event) { Configuration_Node owner_Configuration_Control = cf_Event.GetParentByNodename( NamesNode.S_CONTROL1, EnumConfiguration.Tree, true, log_Reports); if (null != (Configurationtree_Node)owner_Configuration_Control) { bool bHit = ((Configurationtree_Node)owner_Configuration_Control).Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Control, false, log_Reports); if (bHit) { ec_Name_Control = new Expression_Node_StringImpl(this, this.Cur_Configuration); ec_Name_Control.AppendTextNode( sName_Control, this.Cur_Configuration, log_Reports ); } } else { //nFcName_prm = null; } } else { //nFcName_prm = null; } } // // 指定のコントロール // list_Usercontrol = this.Owner_MemoryApplication.MemoryForms.GetUsercontrolsByName( ec_Name_Control, true, log_Reports ); } else { list_Usercontrol = new List <Usercontrol>(); } // // 妥当性判定を行います。 // if (log_Reports.Successful) { if (0 < list_Usercontrol.Count) { Usercontrol uct = list_Usercontrol[0]; uct.JudgeValidity(log_Reports); } //.WriteLine(this.GetType().Name + "#: ◆ 妥当性判定を行った。"); } if (log_Reports.Successful) { // // 指定のコントロールの内容を、データ・ソースから読取り直して最新表示します。 // if (0 < list_Usercontrol.Count) { Usercontrol uct = list_Usercontrol[0]; //.WriteLine(this.GetType().Name + "#: ◆ 指定のコントロールに、データのアップデートを指示。"); if (uct.ControlCommon.BAutomaticinputting) { // コンピューターにより自動入力されたとき。 //essageBox.Show("コンピュータによって自動入力されました。 コントロールID=[" + this.FormObjectId + "]", "デバッグ"); } else { // 手入力による更新。 uct.UsercontrolToMemory(log_Reports); } } //.WriteLine(this.GetType().Name + "#: ◆ 指示終了。"); } // // log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// 「フィールド名=値」という条件1つで検索。該当するレコード0~N件を返す。 /// </summary> /// <param name="dst_Row"></param> /// <param name="name_KeyField"></param> /// <param name="value_Expected"></param> /// <param name="isRequired_ExpectedValue"></param> /// <param name="fielddefinition_Key"></param> /// <param name="dataTable"></param> /// <param name="s_ParentNode_query"></param> /// <param name="log_Reports"></param> public void Select( out List <DataRow> out_List_DstRow, string name_KeyField, string value_Expected, bool isRequired_ExpectedValue, Fielddefinition fielddefinition_Key, DataTable dataTable, Configuration_Node parent_Query, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(); log_Method.BeginMethod(Info_Table.Name_Library, this, "Select", log_Reports); // // // // out_List_DstRow = new List <DataRow>(); Judge_FieldBoolImpl judgeB = new Judge_FieldBoolImpl(); Judge_FieldIntImpl judgeI = new Judge_FieldIntImpl(); Judge_FieldStringImpl judgeS = new Judge_FieldStringImpl(); foreach (DataRow row in dataTable.Rows) { bool bJudge; switch (fielddefinition_Key.Type_Field) { case EnumTypeFielddefinition.String: { // string型フィールドなら judgeS.Judge( out bJudge, name_KeyField, value_Expected, isRequired_ExpectedValue, row, parent_Query, log_Reports ); } break; case EnumTypeFielddefinition.Int: { // int型フィールドなら judgeI.Judge( out bJudge, name_KeyField, value_Expected, isRequired_ExpectedValue, row, parent_Query, log_Reports ); } break; case EnumTypeFielddefinition.Bool: { // bool型フィールドなら judgeB.Judge( out bJudge, name_KeyField, value_Expected, isRequired_ExpectedValue, row, parent_Query, log_Reports ); } break; default: { // エラー。 goto gt_Error_UndefinedClass; } break; } if (!log_Reports.Successful) { // 既エラー。 goto gt_EndMethod; } if (bJudge) { out_List_DstRow.Add(row); } } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_UndefinedClass: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー899", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.AppendI(0, "<NFuncCellUpdaterImplクラス>"); s.Append(Environment.NewLine); s.AppendI(1, "予期しない型です。"); s.Append(Environment.NewLine); s.AppendI(1, "keyFldDefinition.Type=["); s.Append(fielddefinition_Key.ToString_Type()); s.Append("]"); s.Append(Environment.NewLine); s.Append(Environment.NewLine); // ヒント s.AppendI(1, r.Message_Configuration(parent_Query)); s.AppendI(0, "</NFuncCellUpdaterImplクラス>"); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); }
/// <summary> /// 登録されている「%1%」、「%2%」といった記号の数字を一覧します。 /// リストに「1」、「2」といった数字に置き換えて返します。 /// </summary> /// <returns></returns> public List <int> ExistsP1pNumbers( Dictionary_Expression_Node_String ecDic_Attr, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(); log_Method.BeginMethod(Info_Syntax.Name_Library, this, "GetP1pNumbers", log_Reports); // // // // List <int> list = new List <int>(); Dictionary <string, Expression_Node_String> .KeyCollection ecDic_Key = ecDic_Attr.Keys(log_Reports); foreach (string sKey in ecDic_Key) { // // // // p1p,p2p,p3p...といった名前かどうかを判定。 // // // int nParamNameMatchedCount = 0; int nP1pNumber = 0; { //正規表現 System.Text.RegularExpressions.Regex regexp = new System.Text.RegularExpressions.Regex( @"p([0-9])+p", // @"p[0-9]+p", System.Text.RegularExpressions.RegexOptions.IgnoreCase ); //文字列検索を1回する。 System.Text.RegularExpressions.Match match = regexp.Match(sKey); while (match.Success) { nParamNameMatchedCount++; bool parsedSuccessful = int.TryParse(match.Groups[1].Value, out nP1pNumber); match = match.NextMatch(); } } if (1 == nParamNameMatchedCount) { // // // // p1p,p2p,p3p...といった名前。 // // // list.Add(nP1pNumber); } else { } } // // log_Method.EndMethod(log_Reports); return(list); }
//──────────────────────────────────────── /// <summary> /// /// </summary> /// <param name="string_Csv"></param> /// <param name="request_ReadsTable"></param> /// <param name="xenonTableFormat_puts"></param> /// <param name="out_SErrorMsg"></param> /// <returns></returns> public Table_Humaninput Read( string string_Csv, Request_ReadsTable request_ReadsTable, Format_Table_Humaninput xenonTableFormat_puts, Log_Reports log_Reports ) { Table_Humaninput result; if (xenonTableFormat_puts.IsRowcolumnreverse) { // // 縦、横がひっくりかえっているCSVテーブルを読み込みます。 // if (xenonTableFormat_puts.IsAllintfieldsActivated) { // // 型定義のレコードがなく、全てのフィールドがint型のCSVテーブルを読み込みます。 // CsvTo_Table_Humaninput_ReverseAllIntsImpl csvTo = new CsvTo_Table_Humaninput_ReverseAllIntsImpl(); csvTo.CharSeparator = this.CharSeparator; Table_Humaninput xenonTable = csvTo.Read( string_Csv, request_ReadsTable, xenonTableFormat_puts, log_Reports ); if (!log_Reports.Successful) { // 既エラー。 result = null; goto gt_EndMethod; } result = xenonTable; } else { CsvTo_Table_Humaninput_ReverseImpl csvTo = new CsvTo_Table_Humaninput_ReverseImpl(); csvTo.CharSeparator = this.CharSeparator; Table_Humaninput xenonTable = csvTo.Read( string_Csv, request_ReadsTable, xenonTableFormat_puts, log_Reports ); if (!log_Reports.Successful) { // 既エラー。 result = null; goto gt_EndMethod; } result = xenonTable; } } else { // // 縦、横そのままのCSVテーブルを読み込みます。 // CsvTo_Table_Humaninput_RegularImpl csvTo = new CsvTo_Table_Humaninput_RegularImpl(); csvTo.CharSeparator = this.CharSeparator; Table_Humaninput xenonTable = csvTo.Read( string_Csv, request_ReadsTable, xenonTableFormat_puts, log_Reports ); if (!log_Reports.Successful) { // 既エラー。 result = null; goto gt_EndMethod; } result = xenonTable; } goto gt_EndMethod; // // // // gt_EndMethod: return(result); }
public void TryGetParameter(out string out_Value, int key, Log_Reports log_Reports) { out_Value = this.dictionary_NumberAndValue_Parameter[key]; }
//──────────────────────────────────────── protected override void LinkToParent( Configurationtree_Node cur_Cf, Configurationtree_Node parent_Cf, MemoryApplication memoryApplication, Log_Reports log_Reports) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "LinkToParent", log_Reports); Usercontrol uct = null; if (log_Reports.Successful) { Configuration_Node cf_Control = cur_Cf.GetParentByNodename( NamesNode.S_CONTROL1, EnumConfiguration.Tree, true, log_Reports); if (log_Reports.Successful) { uct = Utility_XmlToConfigurationtree_NodeImpl.GetUsercontrol( (Configurationtree_Node)cf_Control, memoryApplication, log_Reports); } } uct.ControlCommon.Configurationtree_Control.List_Child.Add(cur_Cf, log_Reports); goto gt_EndMethod; // #region 異常系 //──────────────────────────────────────── gt_Error_UndefinedClass: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー386!", log_Method); StringBuilder s = new StringBuilder(); s.Append("なんらかのエラー。"); s.Append(Environment.NewLine); // ヒント r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── /// <summary> /// [1]=101 /// [2]=赤 /// といったディクショナリー。 /// /// キーは %1%や、%2%といった名前の中の数字。[1]から始める。 /// Xn_L05_E:E_FtextTemplate#E_ExecuteでAddされます。 /// </summary> /// <param name="key"></param> /// <param name="value"></param> /// <param name="log_Reports"></param> public void SetParameter(int key, string value, Log_Reports log_Reports) { this.dictionary_NumberAndValue_Parameter.Add(key, value); }
//──────────────────────────────────────── protected virtual Configurationtree_Node CreateMyself( XmlElement cur_X, Configurationtree_Node parent_Cf, MemoryApplication memoryApplication, Log_Reports log_Reports) { Configurationtree_Node cf_Cur = new Configurationtree_NodeImpl(cur_X.Name, parent_Cf); return(cf_Cur); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── /// <summary> /// input要素を、name属性を検索キーにして検索し、取得します。 /// 該当がなければヌルを返します。 /// </summary> /// <param name="inputName">name属性</param> /// <param name="bRequired">該当するデータがない場合、エラー</param> /// <returns></returns> public Configurationtree_Node GetFsetvar( string sNameVar, bool bRequired, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "GetFsetvar", log_Reports); // // Configurationtree_Node cf_Result = null; if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("子<f-set-var>要素数=[" + this.List_Child.Count + "]"); } this.List_Child.ForEach(delegate(Configurationtree_Node cf_Child, ref bool bBreak) { string sNamevar1; cf_Child.Dictionary_Attribute.TryGetValue(PmNames.S_NAME_VAR, out sNamevar1, true, log_Reports); if (sNamevar1 == sNameVar) { // input要素のname-var属性を検索し、該当するinput要素があれば。 cf_Result = cf_Child; } }); if (null == cf_Result) { if (bRequired) { // エラーとして扱います。 goto gt_Error_Null; } } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_Null: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー261!", log_Method); StringBuilder s = new StringBuilder(); s.Append("指定されたinput要素=[" + sNameVar + "]は存在しませんでした。"); s.Append(Environment.NewLine); s.Append(Environment.NewLine); s.Append("もしかして?"); s.Append(Environment.NewLine); s.Append(" ・名前のスペルは合っていますか?"); s.Append(Environment.NewLine); s.Append(Environment.NewLine); s.Append("input要素名=["); s.Append(sNameVar); s.Append("]"); s.Append(Environment.NewLine); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); return(cf_Result); }