//────────────────────────────────────────
        /// <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);
            //
            //

            Expression_Node_String err_Ev11;
            bool bAllFldsIsEmpty = true;

            Expression_Node_String ec_RecordSetLoadFrom;//ソース情報利用
            bool bHit = this.TrySelectAttribute(out ec_RecordSetLoadFrom, NamesNode.S_RECORD_SET_LOAD_FROM, EnumHitcount.One, log_Reports);

            //
            // 一時記憶に記憶されているレコードセットのコピー内容。
            RecordSet recordSet;
            if (log_Reports.Successful)
            {
                string sRecordSetLoadFrom = ec_RecordSetLoadFrom.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                // #デバッグ中
                System.Console.WriteLine(Info_Expr.Name_Library + ":" + this.GetType().Name + "#E_Execute: ★★ record-set-load-from=[" + sRecordSetLoadFrom + "]");

                recordSet = this.Owner_MemoryApplication.MemoryRecordset.RecordsetStorage.Get(ec_RecordSetLoadFrom,
                    this.Owner_MemoryApplication,
                    log_Reports);
            }
            else
            {
                recordSet = null;
            }

            Value_Humaninput err_OValue;
            string err_SFldName;
            Exception err_Excp;
            string err_SCsv;
            List<string> err_SList;
            if (log_Reports.Successful)
            {
                //
                // 子<f-●●>要素を実行し、文字列連結。
                // 「SK10,LV10,OP10,COND10,COND10x,COND10y,COND10z,PRI10,RATE10,PER10」といった文字列が取得できることを期待。
                StringBuilder sb_Csv = new StringBuilder();
                {
                    List<Expression_Node_String> ecList_Child = this.List_Expression_Child.SelectList(
                        EnumHitcount.Unconstraint,
                        log_Reports
                        );

                    foreach (Expression_Node_String ec_11 in ecList_Child)
                    {
                        if (ec_11 is Expressionv_Elem99)
                        {
                            Expressionv_Elem99 ev_elem = (Expressionv_Elem99)ec_11;
                            ev_elem.SetDataRow(this.DataRow);
                            sb_Csv.Append(ev_elem.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                        }
                        else if (ec_11 is Expression_Node_StringImpl)
                        {
                            sb_Csv.Append(ec_11.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                        }
                        else
                        {
                            err_Ev11 = ec_11;
                            bAllFldsIsEmpty = false;
                            goto gt_Error_UndefinedElementClass;
                        }
                    }
                }

                //
                // コンマ区切り文字列を、リスト化。
                List<string> sList;
                {
                    CsvTo_ListImpl csvTo = new CsvTo_ListImpl();
                    sList = csvTo.Read(sb_Csv.ToString());
                }

                //
                // 全部真なら真、1つでも偽なら偽。
                foreach (string sFldName in sList)
                {
                    // bug: argumentException
                    Value_Humaninput oValue;
                    try
                    {
                        // レコードセットの1件目だけをとりあえず確認。TODO:
                        oValue = recordSet.List_Field[0][sFldName.ToUpper()];
                        //oValue = (OValue)dataRow[fldName];
                    }
                    catch (KeyNotFoundException ex)
                    {
                        err_Excp = ex;
                        err_SFldName = sFldName;
                        err_SCsv = sb_Csv.ToString();
                        err_SList = sList;
                        goto gt_Error_UndefinedFld;
                    }

                    // #デバッグ中
                    System.Console.WriteLine(Info_Expr.Name_Library + ":" + this.GetType().Name + "#E_Execute: oValue.Text=[" + oValue.Text + "]");

                    if (oValue is Int_HumaninputImpl)
                    {
                        Int_HumaninputImpl oInt = (Int_HumaninputImpl)oValue;

                        if ("" != oInt.Text)
                        {
                            bAllFldsIsEmpty = false;
                        }
                    }
                    else if (oValue is String_HumaninputImpl)
                    {
                        String_HumaninputImpl oString = (String_HumaninputImpl)oValue;

                        if ("" != oString.Text)
                        {
                            bAllFldsIsEmpty = false;
                        }
                    }
                    else if (oValue is Bool_HumaninputImpl)
                    {
                        Bool_HumaninputImpl oBool = (Bool_HumaninputImpl)oValue;

                        if ("" != oBool.Text)
                        {
                            bAllFldsIsEmpty = false;
                        }

                        //
                        // TODO: false/trueタイプ、0/1タイプにも対応したい。
                        //
                    }
                    else
                    {
                        //
                        // エラー。
                        err_OValue = oValue;
                        goto gt_Error_UndefinedType;
                    }
                }
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
            gt_Error_UndefinedType:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_OValue.GetType().Name, log_Reports);//値の型名
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(this.Cur_Configuration), log_Reports);//設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:6032;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_Error_UndefinedElementClass:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_Ev11.GetType().Name, log_Reports);//クラス名
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(this.Cur_Configuration), log_Reports);//設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:6033;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_Error_UndefinedFld:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_SFldName.ToUpper(), log_Reports);//フィールド名大文字化
                tmpl.SetParameter(2, err_SCsv, log_Reports);//指定されたフィールド名の文字列

                StringBuilder s1 = new StringBuilder();
                foreach (string str in err_SList)
                {
                    s1.Append("[");
                    s1.Append(str);
                    s1.Append("]");
                    s1.Append(Environment.NewLine);
                }
                tmpl.SetParameter(3, s1.ToString(), log_Reports);//指定されたフィールド名の文字列

                StringBuilder s2 = new StringBuilder();
                // あるフィールド名の一覧
                foreach (DataColumn dataColumn in this.DataRow.Table.Columns)
                {
                    s2.Append("[");
                    s2.Append(dataColumn.ColumnName);
                    s2.Append("]");
                    s2.Append(Environment.NewLine);
                }
                tmpl.SetParameter(4, s1.ToString(), log_Reports);//指定されたフィールド名の文字列

                tmpl.SetParameter(5, Log_RecordReportsImpl.ToText_Configuration(this.Cur_Configuration), log_Reports);//設定位置パンくずリスト
                tmpl.SetParameter(6, Log_RecordReportsImpl.ToText_Exception(err_Excp), log_Reports);//例外メッセージ

                this.Owner_MemoryApplication.CreateErrorReport("Er:6034;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return bAllFldsIsEmpty.ToString();
        }
        //────────────────────────────────────────
        /// <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>
        private static List<Expression_Node_String> SelectItemsByPmAsCsv_Full_(
            List<Expression_Node_String> ecList_Item,
            string sPmName,
            bool bUnconditional,//無条件一致なら真
            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_Full_",log_Reports);
            //
            //
            //Util_E_NodeImpl dammy_This = new Util_E_NodeImpl();

            List<Expression_Node_String> ecList_Result = new List<Expression_Node_String>();

            for (int nI = 0; nI < ecList_Item.Count; nI++ )
            {
                Expression_Node_String ec_Item = ecList_Item[nI];

                if (log_Reports.Successful)
                {
                    Expression_Node_String ec_AttrValue;
                    bool bHit = ec_Item.TrySelectAttribute(out ec_AttrValue, sPmName, EnumHitcount.One_Or_Zero, log_Reports);
                    if (bHit)
                    {
                        string sAttrValue = ec_AttrValue.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);

                        CsvTo_ListImpl to = new CsvTo_ListImpl();
                        List<string> sList_Value = to.Read(sAttrValue);

                        bool bHit10 = false;

                        if(bUnconditional)
                        {
                            //if(""!=sAttrValue)
                            //{
                                bHit = true;
                            //}
                        }
                        else if(sList_Value.Contains(sExpectedValue))
                        {
                            bHit10 = true;
                        }

                        if (bHit10)
                        {
                            ecList_Result.Add(ec_Item);

                            if (bRemove)
                            {
                                // 削除
                                ecList_Item.RemoveAt(nI);
                                nI--;
                            }

                            if (EnumHitcount.First_Exist == hits ||
                                EnumHitcount.First_Exist_Or_Zero == hits)
                            {
                                // 最初の1件で削除は終了。複数件ヒットするかどうかは判定しない。
                                break;
                            }
                        }
                    }
                }
            }

            //ystem.Console.WriteLine(Info_Forms.LibraryName + ":Util_E_NodeImpl.GetItemsByAttrAsCsv: 直後 list_E_Result.Count=[" + list_E_Result.Count + "]");

            if (EnumHitcount.One == hits)
            {
                // 必ず1件だけヒットする想定。

                if (ecList_Result.Count != 1)
                {
                    goto gt_Error_NotOne;
                }
            }
            else if (EnumHitcount.First_Exist == hits)
            {
                // 必ずヒットする。複数件あれば、最初の1件だけ取得。

                if (0 == ecList_Result.Count)
                {
                    goto gt_Error_NoHit;
                }
                else if (1 < ecList_Result.Count)
                {
                    ecList_Result.RemoveRange(1, ecList_Result.Count - 1);
                }
            }
            else if (EnumHitcount.First_Exist_Or_Zero == hits)
            {
                // ヒットすれば最初の1件だけ、ヒットしなければ0件の想定。

                if (1 < ecList_Result.Count)
                {
                    ecList_Result.RemoveRange(1, ecList_Result.Count - 1);
                }
            }
            else
            {
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
            gt_Error_NoHit:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー102!", pg_Method);

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append("必ず、1件以上ヒットする指定でしたが、[");
                s.Append(ecList_Result.Count);
                s.Append("]件ヒットしました。");
                s.Newline();
                s.Newline();

                s.AppendI(1, "ヒット件数=[");
                s.Append(ecList_Result.Count);
                s.Append("]");
                s.Newline();

                s.AppendI(1, "items.Count=[");
                s.Append(ecList_Item.Count);
                s.Append("]");
                s.Newline();

                s.AppendI(1, "sPmName=[");
                s.Append(sPmName);
                s.Append("]");
                s.Newline();

                s.AppendI(1, "無条件一致か?=[");
                s.Append(bUnconditional);
                s.Append("]");
                s.Newline();

                s.AppendI(1, "sExpectedValue=[");
                s.Append(sExpectedValue);
                s.Append("]");
                s.Newline();

                s.AppendI(1, "bRemove=[");
                s.Append(bRemove);
                s.Append("]");
                s.Newline();

                s.AppendI(1, "request_Items=[");
                s.Append(hits);
                s.Append("]");
                s.Newline();

                s.Append("┌────────┐処理後に残った内容 要素数=[");
                s.Append(ecList_Item.Count);
                s.Append("]");
                s.Newline();
                foreach (Expression_Node_String e_Item2 in ecList_Item)
                {
                    string sAttrNameValue;
                    bool bHit = e_Item2.TrySelectAttribute(out sAttrNameValue, sPmName, EnumHitcount.One_Or_Zero, log_Reports);

                    s.AppendI(1, "・「E■[");
                    s.Append(e_Item2.Cur_Configuration.Name);
                    s.Append("] name=”[");
                    s.Append(sAttrNameValue);
                    s.Append("] 値=”[");
                    s.Append(e_Item2.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                    s.Append("]”」");
                    s.Newline();

                    e_Item2.ToText_Snapshot(s);

                }
                s.Append("└────────┘");
                s.Newline();

                // ヒント
                if(1<ecList_Item.Count)
                {
                    Expression_Node_String parent_Expr = ecList_Item[0].Parent_Expression;
                    if (null != parent_Expr)
                    {
                        s.Append("┌────────┐先頭要素の親");
                        s.Newline();
                        parent_Expr.ToText_Snapshot(s);
                        s.Append("└────────┘");
                        s.Newline();
                    }
                }

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_Error_NotOne:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー101!", pg_Method);

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append("必ず、1件のみ取得する指定でしたが、[");
                s.Append(ecList_Result.Count);
                s.Append("]件取得しました。");
                s.Newline();
                s.Newline();

                s.AppendI(1, "sPmName=[");
                s.Append(sPmName);
                s.Append("]");
                s.Newline();

                s.AppendI(1, "無条件一致か?=[");
                s.Append(bUnconditional);
                s.Append("]");
                s.Newline();

                s.AppendI(1, "sExpectedValue=[");
                s.Append(sExpectedValue);
                s.Append("]");
                s.Newline();

                s.AppendI(1, "bRemove=[");
                s.Append(bRemove);
                s.Append("]");
                s.Newline();

                // ヒント

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:
            pg_Method.EndMethod(log_Reports);
            return ecList_Result;
        }
        //────────────────────────────────────────
        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();
            }
            //
            //

            //
            // 指定された引数から、または、
            // この<action>要素を含んでいる control要素から、コントロールの名前を取得。
            List<Usercontrol> list_FcUc = new List<Usercontrol>();
            if (log_Reports.Successful)
            {
                // 正常時

                Expression_Node_String ec_FcName_Prm;
                this.TrySelectAttribute(out ec_FcName_Prm, Expression_Node_Function36Impl.PM_CONTROL_NAME, EnumHitcount.One_Or_Zero, log_Reports);

                string sFcName_Prm = ec_FcName_Prm.Execute4_OnExpressionString(EnumHitcount.Unconstraint,log_Reports);

                List<Expression_Node_String> ecList_FcName = new List<Expression_Node_String>();
                if ("" == sFcName_Prm)
                {
                    //
                    // fcName未設定時は、この<action>要素を含んでいるcontrol要素から
                    // コントロールの名前を取得。
                    //

                    Configuration_Node cf_Event = this.Cur_Configuration.GetParentByNodename(
                        NamesNode.S_EVENT, EnumConfiguration.Unknown, false, log_Reports);

                    if (null != cf_Event)
                    {
                        Configuration_Node owner_Configurationtree_Control = cf_Event.GetParentByNodename(
                            NamesNode.S_CONTROL1, EnumConfiguration.Tree, true, log_Reports);

                        if (null != owner_Configurationtree_Control)
                        {
                            string sName;
                            bool bHit = ((Configurationtree_Node)owner_Configurationtree_Control).Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName, false, log_Reports);

                            if (bHit)
                            {
                                Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(this, this.Cur_Configuration);
                                ec_Str.AppendTextNode(
                                    sName,
                                    this.Cur_Configuration,
                                    log_Reports
                                    );

                                // 上書き
                                ec_FcName_Prm = ec_Str;
                                ecList_FcName.Add(ec_FcName_Prm);
                            }
                            else
                            {
                            }
                        }
                        else
                        {
                            //nFcName_prm = null;
                        }

                    }
                    else
                    {
                        //nFcName_prm = null;
                    }
                }
                else
                {
                    //
                    // fcName 指定時。

                    // カンマ区切りか確認。
                    CsvTo_ListImpl csvTo = new CsvTo_ListImpl();
                    List<string> sList_FcName_Prm = csvTo.Read(sFcName_Prm);

                    foreach (string sFcName2 in sList_FcName_Prm)
                    {
                        // コントロール名。
                        Expression_Node_StringImpl ec_FcName4 = new Expression_Node_StringImpl(this, this.Cur_Configuration);
                        ec_FcName4.AppendTextNode(
                            sFcName2,
                            this.Cur_Configuration,
                            log_Reports
                            );

                        ecList_FcName.Add(ec_FcName4);
                    }

                }

                foreach (Expression_Node_String ec_FcName5 in ecList_FcName)
                {
                    //
                    // 指定のコントロール
                    //
                    List<Usercontrol> list_FcUc2 = this.Owner_MemoryApplication.MemoryForms.GetUsercontrolsByName(
                        ec_FcName5,
                        true,
                        log_Reports
                        );

                    if (0 < list_FcUc2.Count)
                    {
                        Usercontrol fcUc = list_FcUc2[0];
                        list_FcUc.Add(fcUc);
                    }
                }
            }
            else
            {
            }

            foreach (Usercontrol fcUc in list_FcUc)
            {
                if (log_Reports.Successful)
                {
                    ////
                    //// 妥当性判定を行います。
                    ////
                    //if (log_Reports.Successful)
                    //{
                    //    fcUc.JudgeValidity(
                    //        log_Reports
                    //        );

                    //    //.WriteLine(this.GetType().Name + "#: ◆ 妥当性判定を行った。");
                    //}

                    if (fcUc.ControlCommon.BAutomaticinputting)
                    {
                        // コンピューターにより自動入力されたとき。
                    }
                    else
                    {
                        // 手入力による更新。

                        {
                            ToMemory_Performer toM = new ExpressionDataTargetUpdaterImpl();
                            toM.ToMemory(
                                "",// 空文字列
                                fcUc.ControlCommon.Expression_Control,
                                fcUc.ControlCommon.Owner_MemoryApplication,
                                log_Reports
                                );
                        }
                    }
                }
            }

            log_Method.EndMethod(log_Reports);
        }
Esempio n. 4
0
        //────────────────────────────────────────
        /// <summary>
        /// 値を算出します。
        /// </summary>
        /// <returns></returns>
        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);
            //
            //

            StringBuilder sResult = new StringBuilder();

            //
            // switchValue="" の有無を確認。
            string sSwitchValue;
            {
                // <arg1 name=”switchValue” >
                log_Reports.Log_Callstack.Push(log_Method, "①");
                this.TrySelectAttribute(out sSwitchValue, PmNames.S_VALUE_SWITCH.Name_Pm, EnumHitcount.One, log_Reports);
                log_Reports.Log_Callstack.Pop(log_Method, "①");
            }

            if ("" == sSwitchValue)
            {
                //
                //
                //
                // 子要素を計算して、 switch="" の値とします。
                //
                //
                //

                //sResult.Append("<Sf:switch;の子要素全部>");
                StringBuilder sb = new StringBuilder();

                List<Expression_Node_String> ecList = this.List_Expression_Child.SelectList(
                    EnumHitcount.Unconstraint,
                    log_Reports
                    );

                foreach (Expression_Node_String ec_Child in ecList)
                {
                    sb.Append(ec_Child.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                }
                sSwitchValue = sb.ToString();
            }

            sSwitchValue = sSwitchValue.Trim();

            bool bHit = false;//case文に一致するものがあれば真、default文に行くならfalse。

            foreach (Expression_SfcaseImpl ec_SfCase in this.List_Expression_Sfcase)
            {
                //
                // caseValue="1,2,3" とか書いてある部分。
                //
                string sExpected;
                {
                    log_Reports.Log_Callstack.Push(log_Method, "②");
                    ec_SfCase.TrySelectAttribute(out sExpected, PmNames.S_VALUE_CASE.Name_Pm, EnumHitcount.One, log_Reports);
                    log_Reports.Log_Callstack.Pop(log_Method, "②");
                }

                CsvTo_ListImpl csvTo = new CsvTo_ListImpl();
                List<string> sList_Expected = csvTo.Read(sExpected);
                List<string> sList_ExpectedTrim = new List<string>();
                //
                // 要素数が 0 の場合、「空文字列」をヒットさせます。
                //
                if (0 == sList_Expected.Count)
                {
                    // 「空文字列要素」1個だけを持つリスト。
                    sList_ExpectedTrim.Add("");
                }
                else
                {
                    // デバッグ
                    foreach (string sExpectedTrim in sList_Expected)
                    {
                        string sTrim = sExpectedTrim.Trim();

                        // デバッグ
                        //onsole.Write("[" + sTrim + "]");

                        sList_ExpectedTrim.Add(sTrim);
                    }
                    // デバッグ
                    //onsole.WriteLine("");
                }

                if (sList_ExpectedTrim.Contains(sSwitchValue))
                {
                    log_Reports.Log_Callstack.Push(log_Method, "④");
                    string sHit = ec_SfCase.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                    log_Reports.Log_Callstack.Pop(log_Method, "④");

                    sResult.Append(sHit);
                    bHit = true;
                }
            }

            //
            // <a-default>未実装
            //

            goto gt_EndMethod;
            //
            //
            //
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return sResult.ToString();
        }
        //────────────────────────────────────────
        /// <summary>
        /// 属性テスト
        /// </summary>
        /// <param name="x_Cur"></param>
        /// <param name="s_Cur"></param>
        /// <param name="log_Reports"></param>
        protected override void Test_Attributes(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, "Test_Attributes",log_Reports);

            string sMemory;
            cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_MEMORY, out sMemory, false, log_Reports);

            string sAccess_Src;
            cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_ACCESS, out sAccess_Src, false, log_Reports);

            //
            // access
            //
            bool bExists_To=false;
            string err_sAccess;
            {
                CsvTo_ListImpl to = new CsvTo_ListImpl();
                List<string> listS = to.Read(sAccess_Src);
                foreach (string sAccess1 in listS)
                {
                    if (ValuesAttr.S_FROM == sAccess1)
                    {
                        // ・読取り。(読取り専用とは限らない。writeは別<data>で書く可能性もある)。
                    }
                    else if (ValuesAttr.S_TO == sAccess1)
                    {
                        // ・書出し。(書出し専用とは限らない。readは別<data>で書く可能性もある)。
                        bExists_To = true;
                    }
                    //else if (ValuesAttr.S_FROM + "," + ValuesAttr.S_TO == sAccess)//"from,to"
                    //{
                    //    // ・読み書き両用。
                    //}
                    else
                    {
                        // fromでも、toでもないものが指定されていれば、エラー。
                        err_sAccess = sAccess1;
                        goto gt_Error_AttrAccess;
                    }
                }

            }

            //
            //memory
            //
            if (!(
                ValuesAttr.S_NONE == sMemory ||
                ValuesAttr.S_CELL == sMemory ||
                ValuesAttr.S_RECORDS == sMemory ||
                ValuesAttr.S_VARIABLE == sMemory
                ))
            {
                // 無いものを指定したらエラー
                goto gt_Error_AttrType;
            }

            //
            //access属性に「to」が指定されていない時に、memory属性に「none」「cell」「records」以外のものが設定されていれば、エラー。
            //
            if (!bExists_To && (ValuesAttr.S_NONE != sMemory && ValuesAttr.S_CELL != sMemory && ValuesAttr.S_RECORDS != sMemory))
            {
                goto gt_Error_GhostTarget;
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
            gt_Error_GhostTarget:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, PmNames.S_ACCESS.Name_Attribute, log_Reports);//属性名access
                tmpl.SetParameter(2, ValuesAttr.S_TO, log_Reports);//属性値to
                tmpl.SetParameter(3, PmNames.S_MEMORY.Name_Attribute, log_Reports);//属性名memory

                StringBuilder s1 = new StringBuilder();
                s1.Append("「");
                s1.Append(ValuesAttr.S_NONE);
                s1.Append("」「");
                s1.Append(ValuesAttr.S_CELL);
                s1.Append("」「");
                s1.Append(ValuesAttr.S_RECORDS);
                s1.Append("」");
                tmpl.SetParameter(4, s1.ToString(), log_Reports);//属性値

                tmpl.SetParameter(5, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports);//設定位置パンくずリスト

                //access属性に「to」が指定されていない時に、target属性に「none」「cell」「listbox」以外のものが設定されていました。これはエラーです。
                //
                //access属性に「to」が指定されていない場合は、target属性は「none」「cell」「listbox」のいずれかにしなければなりません。

                memoryApplication.CreateErrorReport("Er:8020;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_Error_AttrType:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, PmNames.S_MEMORY.Name_Attribute, log_Reports);//属性名memory
                tmpl.SetParameter(2, sMemory, log_Reports);//属性名memoryの値

                StringBuilder s1 = new StringBuilder();
                s1.Append("「");
                s1.Append(ValuesAttr.S_CELL);
                s1.Append("」「");
                s1.Append(ValuesAttr.S_RECORDS);
                s1.Append("」「");
                s1.Append(ValuesAttr.S_VARIABLE);
                s1.Append("」");
                tmpl.SetParameter(3, s1.ToString(), log_Reports);//属性値

                tmpl.SetParameter(4, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports);//設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:8021;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_Error_AttrAccess:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, PmNames.S_ACCESS.Name_Attribute, log_Reports);//属性名access
                tmpl.SetParameter(2, err_sAccess, log_Reports);//access属性の値
                tmpl.SetParameter(3, sAccess_Src, log_Reports);//access指定値全文

                StringBuilder s1 = new StringBuilder();
                s1.Append("「");
                s1.Append(ValuesAttr.S_FROM);
                s1.Append("」「");
                s1.Append(ValuesAttr.S_TO);
                s1.Append("」指定なし");
                tmpl.SetParameter(4, s1.ToString(), log_Reports);//属性値

                tmpl.SetParameter(5, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports);//設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:8022;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <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<Configurationtree_Node> SelectItemsBySAttrAsCsv(
            List<Configurationtree_Node> items,
            PmName pmName/*string sName_Attr*/,
            string sValue_Expected,
            bool bRemove,
            EnumHitcount hits,
            MemoryApplication memoryApplication,
            Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            log_Method.BeginMethod(Info_XmlToConf.Name_Library, "Util_XmlToConfigurationtree_NodeImpl", "SelectItemsBySAttrAsCsv",log_Reports);

            List<Configurationtree_Node> cfList_Result = new List<Configurationtree_Node>();

            for (int nI = 0; nI < items.Count; nI++ )
            {
                Configurationtree_Node cf_Item = items[nI];

                if (log_Reports.Successful)
                {
                    string sValue_Attr;
                    bool bHit = cf_Item.Dictionary_Attribute.TryGetValue(pmName, out sValue_Attr, false, log_Reports);
                    if (bHit)
                    {
                        CsvTo_ListImpl to = new CsvTo_ListImpl();
                        List<string> sList_Value = to.Read(sValue_Attr);

                        if (sList_Value.Contains(sValue_Expected))
                        {
                            cfList_Result.Add(cf_Item);

                            if (bRemove)
                            {
                                // 削除
                                items.RemoveAt(nI);
                                nI--;
                            }

                            if (EnumHitcount.First_Exist == hits ||
                                EnumHitcount.First_Exist_Or_Zero == hits)
                            {
                                // 最初の1件で削除は終了。複数件ヒットするかどうかは判定しない。
                                break;
                            }
                        }
                    }
                }
            }

            //ystem.Console.WriteLine(Info_Forms.LibraryName + ":EUtil_NodeImpl.GetItemsByAttrAsCsv: 直後 list_Result.Count=[" + list_Result.Count + "]");

            if (EnumHitcount.One == hits)
            {
                // 必ず1件だけヒットする想定。

                if (cfList_Result.Count != 1)
                {
                    goto gt_errorNotOne;
                }
            }
            else if (EnumHitcount.First_Exist == hits)
            {
                // 必ずヒットする。複数件あれば、最初の1件だけ取得。

                if (0 == cfList_Result.Count)
                {
                    goto gt_errorNoHit;
                }
                else if (1 < cfList_Result.Count)
                {
                    cfList_Result.RemoveRange(1, cfList_Result.Count - 1);
                }
            }
            else if (EnumHitcount.First_Exist_Or_Zero == hits)
            {
                // ヒットすれば最初の1件だけ、ヒットしなければ0件の想定。

                if (1 < cfList_Result.Count)
                {
                    cfList_Result.RemoveRange(1, cfList_Result.Count - 1);
                }
            }
            else
            {
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
            gt_errorNoHit:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, cfList_Result.Count.ToString(), log_Reports);//検索ヒット数

                memoryApplication.CreateErrorReport("Er:8002;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_errorNotOne:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, cfList_Result.Count.ToString(), log_Reports);//検索ヒット数

                memoryApplication.CreateErrorReport("Er:8003;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            gt_EndMethod:
            return cfList_Result;
        }