Exemple #1
0
        //────────────────────────────────────────

        /// <summary>
        /// 親要素に、この要素を追加。
        /// </summary>
        protected override void LinkToParent(Configurationtree_Node cur_Cf, Configurationtree_Node parent_Cf, MemoryApplication memoryApplication, Log_Reports log_Reports)
        {
            string sAccess;

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

            bool bHit = false;

            List <string> sList_Access = new CsvTo_ListImpl().Read(sAccess);

            foreach (string sAccess2 in sList_Access)
            {
                if (ValuesAttr.S_FROM == sAccess2)
                {
                    // データソース用。
                    bHit = true;
                }
                else if (ValuesAttr.S_TO == sAccess2)
                {
                    // データターゲット用。
                    bHit = true;
                }
                else
                {
                    // access属性の有無は既にチェック済みのはず。
                    throw new Exception("未定義のaccess属性の値[" + sAccess2 + "]");
                }
            }


            if (bHit)
            {
                parent_Cf.List_Child.Add(cur_Cf, log_Reports);
            }
        }
Exemple #2
0
        //────────────────────────────────────────

        private List <Configurationtree_Node> ConvertTarget2(Configurationtree_Node cf_Together, Log_Reports log_Reports)
        {
            List <Configurationtree_Node> cfList_Result = new List <Configurationtree_Node>();

            string sTargetList;

            cf_Together.Dictionary_Attribute.TryGetValue(PmNames.S_TARGET1, out sTargetList, false, log_Reports);
            List <string> sList_Target = new CsvTo_ListImpl().Read(sTargetList);

            foreach (string sTarget in sList_Target)
            {
                Configurationtree_NodeImpl cf_RfrTarget = new Configurationtree_NodeImpl(NamesNode.S_TARGET, cf_Together);
                cf_RfrTarget.Dictionary_Attribute.Set(PmNames.S_NAME.Name_Pm, sTarget, log_Reports);
                cfList_Result.Add(cf_RfrTarget);
            }

            return(cfList_Result);
        }
Exemple #3
0
        //────────────────────────────────────────

        /// <summary>
        /// <f-cell>→M
        /// </summary>
        /// <param name="outputValueStr"></param>
        /// <param name="nKeyExpected"></param>
        /// <param name="nFcell"></param>
        /// <param name="moApplication"></param>
        /// <param name="log_Reports"></param>
        public void Translate(
            string sOutputValue,
            Expression_Node_String ec_KeyExpected,
            Expression_Node_String ec_SfCell,//Sf:cell;相当と想定。
            MemoryApplication moApplication,
            Log_Reports log_Reports
            )
        {
            Log_Method pg_Method = new Log_MethodImpl(0);

            pg_Method.BeginMethod(Info_Controls.Name_Library, this, "EToM2", log_Reports);
            //
            //

            string sName_Fnc;

            ec_SfCell.TrySelectAttribute(out sName_Fnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One, log_Reports);
            if (NamesFnc.S_CELL != sName_Fnc)
            {
                // エラー。
                goto gt_Error_NotSfcell;
            }


            string sSelectedFldName;

            if (log_Reports.Successful)
            {
                bool bHit = ec_SfCell.TrySelectAttribute(
                    out sSelectedFldName,
                    PmNames.S_SELECT.Name_Pm,
                    EnumHitcount.One_Or_Zero,
                    log_Reports
                    );

                //if (!bHit)
                //{
                //    // 【追加 2012-07-10】
                //    // Sf:cell; の子要素arg1 には、name="select" のものがある。本来これは属性連結しておいて欲しい。
                //    List<Expression_Node_String> list_Arg1 = e_SfCell.SelectDirectchildByNodename(NamesNode.S_ARG1, false, EnumHitcount.Unconstraint, log_Reports);

                //    d_InMethod.WriteDebug_ToConsole(1, "sSelectedFldNameが属性になかった。子要素arg1(" + list_Arg1 .Count+ "個)から探す。");
                //    if (0<d_InMethod.NDebugLevel && list_Arg1.Count<=0)
                //    {
                //        Log_TextIndented s = new Log_TextIndentedImpl();
                //        e_SfCell.ToText_Snapshot(s);
                //        d_InMethod.WriteDebug_ToConsole(1, s.ToString());
                //    }

                //    EUtil_NodeImpl.SelectItemsByAttrAsCsv(list_Arg1, PmNames.NAME.SAttrName, ValuesAttr.S_SELECT, false, EnumHitcount.First_Exist, log_Reports);

                //    if (log_Reports.Successful)
                //    {
                //        sSelectedFldName = list_Arg1[0].Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                //    }
                //}
            }
            else
            {
                sSelectedFldName = "";
            }


            Expression_Node_String ec_KeyFldName1 = null;

            if (log_Reports.Successful)
            {
                Expression_Node_String ec_Where = null;

                //
                // 「E■where」は子要素。
                //

                // 再検索。
                ec_SfCell.List_Expression_Child.ForEach(delegate(Expression_Node_String ec_Child, ref bool bRemove, ref bool bBreak)
                {
                    string sValue;
                    ec_Child.TrySelectAttribute(out sValue, PmNames.S_NAME.Name_Pm, EnumHitcount.One, log_Reports);

                    if (NamesNode.S_FNC == ec_Child.Cur_Configuration.Name &&
                        NamesFnc.S_WHERE == sValue)
                    {
                        ec_Where = ec_Child;

                        if (pg_Method.CanDebug(2))
                        {
                            pg_Method.WriteDebug_ToConsole("子「E■[" + ec_Child.Cur_Configuration.Name + "]」。子要素数=[" + ec_Where.List_Expression_Child.Count + "]");
                        }

                        ec_Where.List_Expression_Child.ForEach(delegate(Expression_Node_String e_Item, ref bool bRemove2, ref bool bBreak2)
                        {
                            if (NamesNode.S_FNC == e_Item.Cur_Configuration.Name)
                            {
                                Expression_Node_String ec_Field;
                                bool bHit3 = e_Item.TrySelectAttribute(out ec_Field, PmNames.S_FIELD.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);
                                if (bHit3)
                                {
                                    //「E■f-cell」/「E■@where」/「E■fnc field=”★”」。
                                    ec_KeyFldName1 = ec_Field;

                                    if (pg_Method.CanDebug(2))
                                    {
                                        pg_Method.WriteDebug_ToConsole("「E■f-cell」/「E■a-where」/「E■fnc field=”[" + ec_KeyFldName1.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]”」。");
                                    }
                                }
                                else
                                {
                                    throw new Exception("ここは通らない?");
                                }
                            }
                            else
                            {
                                // #エラー
                                System.Console.WriteLine(Info_Controls.Name_Library + ":" + this.GetType().Name + "#EToM: 「E■fnc」がありませんでした。");
                            }
                        });
                    }
                    else
                    {
                        if (pg_Method.CanDebug(2))
                        {
                            pg_Method.WriteDebug_ToConsole("(無視)  子「E■[" + ec_Child.Cur_Configuration.Name + "]」。");
                        }
                    }
                });

                if (null == ec_Where)
                {
                    // #エラー
                    System.Console.WriteLine(Info_Controls.Name_Library + ":" + this.GetType().Name + "#EToM: 「E■f-cell」に、子「E■where」が無かった? そういう場合(無条件)もある。");
                }
            }
            else
            {
                ec_KeyFldName1 = null;
            }


            //
            // from
            //
            Expression_Node_String ec_TableName1;//ソース情報利用

            if (log_Reports.Successful)
            {
                // Sf:cell; に from が指定されていない?
                bool bHit = ec_SfCell.TrySelectAttribute(
                    out ec_TableName1,
                    PmNames.S_FROM.Name_Pm,
                    EnumHitcount.One,
                    log_Reports
                    );

                //if (null == e_TableName1)
                //{
                //    d_InMethod.WriteDebug_ToConsole(1, "e_TableName1が属性になかった。子要素arg1から探す。");
                //    // 【追加 2012-07-10】
                //    // Sf:cell; の子要素arg1 には、name=”from” のものがある。本来これは属性連結しておいて欲しい。
                //    List<Expression_Node_String> list_Arg1 = e_SfCell.SelectDirectchildByNodename(NamesNode.S_ARG1, false, EnumHitcount.Unconstraint, log_Reports);
                //    EUtil_NodeImpl.SelectItemsByAttrAsCsv(list_Arg1, PmNames.NAME.SAttrName, ValuesAttr.S_FROM, false, EnumHitcount.First_Exist, log_Reports);

                //    if (log_Reports.Successful)
                //    {
                //        e_TableName1 = list_Arg1[0];
                //    }
                //}
            }
            else
            {
                ec_TableName1 = null;
            }


            //
            // required
            //
            bool bExpectedValueRequired = false;

            if (log_Reports.Successful)
            {
                string sRequired1;
                bool   bHit = ec_SfCell.TrySelectAttribute(out sRequired1, PmNames.S_REQUIRED.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);
                if (bHit)
                {
                    // 【旧仕様】
                    bool bParseSuccessful = bool.TryParse(sRequired1, out bExpectedValueRequired);
                }
                else
                {
                    // 【新仕様】

                    //
                    // 新仕様では、「E■f-cell/@E■where/E■prm name=”required”」。
                    //
                    {
                        Expression_Node_String ec_Where;
                        bool bHit1 = ec_SfCell.TrySelectAttribute(out ec_Where, PmNames.S_WHERE.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);
                        if (bHit1)
                        {
                            throw new Exception("こーこは通らない?");
                        }
                    }
                }
            }
            else
            {
            }


            // e_TableName を取得してから引数エラーチェック。
            if (null == ec_KeyExpected)
            {
                // エラー
                goto gt_Error_NullKeyExpected;
            }

            // ──────────

            Table_Humaninput o_Table;

            if (log_Reports.Successful)
            {
                o_Table = moApplication.MemoryTables.GetTable_HumaninputByName(ec_TableName1, true, log_Reports);
                // エラー時には、エラーメッセージを出させます。

                if (null == o_Table)
                {
                    //
                    // エラー中断。
                    goto gt_Error_NotFoundTable;
                }
                else
                {
                    //
                    // 正常時
                    //
                    //.WriteLine("(" + Info_Forms .LibraryName+ ")" + this.GetType().NFcName + "#...: (1)テーブル検索終了 refOTable=[" + refOTable.SourceFilePath + "]");
                }
            }
            else
            {
                o_Table = null;
            }


            string err_SKeyFldName;
            string err_SSelectedFldName;

            // field=""。
            Fielddefinition o_KeyFldDef;

            if (log_Reports.Successful)
            {
                //
                // 検索のキーとなるフィールドの定義を調べます。
                //

                List <string> sList_KeyFldName;
                {
                    sList_KeyFldName = new List <string>();

                    string sKeyFldName = ec_KeyFldName1.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                    if ("" == sKeyFldName.Trim())
                    {
                        // エラー
                        err_SKeyFldName = sKeyFldName;
                        goto gt_Error_EmptyKeyField;
                    }
                    sList_KeyFldName.Add(sKeyFldName);
                    if (sList_KeyFldName.Count < 1)
                    {
                        // エラー
                        err_SKeyFldName = sKeyFldName;
                        goto gt_Error_ZeroKeyField;
                    }
                }

                RecordFielddefinition recordFielddefinition;
                bool bHit = o_Table.TryGetFieldDefinitionByName(
                    out recordFielddefinition,
                    sList_KeyFldName,
                    true,
                    log_Reports
                    );
                if (!log_Reports.Successful || !bHit)
                {
                    goto gt_EndMethod;
                }

                o_KeyFldDef = recordFielddefinition.ValueAt(0);
            }
            else
            {
                o_KeyFldDef = null;
            }


            RecordFielddefinition recordFielddefinition_Selected;

            if (log_Reports.Successful)
            {
                // 選択対象のフィールドの定義を調べます。

                List <string> sList_SelectedFldName;
                {
                    sList_SelectedFldName = new CsvTo_ListImpl().Read(sSelectedFldName);
                    foreach (string sName in sList_SelectedFldName)
                    {
                        if ("" == sName.Trim())
                        {
                            // エラー
                            err_SSelectedFldName = sSelectedFldName;
                            goto gt_Error_EmptySelectField;
                        }
                    }

                    if (sList_SelectedFldName.Count < 1)
                    {
                        // エラー
                        err_SSelectedFldName = sSelectedFldName;
                        goto gt_Error_ZeroSelectField;
                    }
                }

                bool bHit = o_Table.TryGetFieldDefinitionByName(
                    out recordFielddefinition_Selected,
                    sList_SelectedFldName,
                    false,
                    log_Reports
                    );
                if (!log_Reports.Successful || !bHit)
                {
                    goto gt_EndMethod;
                }
            }
            else
            {
                recordFielddefinition_Selected = null;
            }



            if (log_Reports.Successful)
            {
                if (null == o_KeyFldDef)
                {
                    //
                    // エラー中断。
                    goto gt_Error_NotFoundKeyFldDefinition;
                }
            }



            if (log_Reports.Successful)
            {
                if (recordFielddefinition_Selected.Count < 1)
                {
                    //
                    // エラー中断。
                    goto gt_Error_NotFoundSelectFldDefinition;
                }
            }


            if (log_Reports.Successful)
            {
                List <DataRow> dst_Row = new List <DataRow>();


                string             sKeyFieldName         = ec_KeyFldName1.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                string             sExpectedValue        = ec_KeyExpected.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                Configuration_Node cf_WrittenPlace_Query = ec_SfCell.Cur_Configuration;

                SelectPerformerImpl sp = new SelectPerformerImpl();
                sp.Select(
                    out dst_Row,
                    sKeyFieldName,
                    sExpectedValue,
                    bExpectedValueRequired,
                    o_KeyFldDef,
                    o_Table.DataTable,
                    cf_WrittenPlace_Query,
                    log_Reports
                    );



                if (0 < dst_Row.Count)
                {
                    //.WriteLine("(" + Info_Forms .LibraryName+ ")" + this.GetType().NFcName + "#...: (6a)該当 recordSet.Count=[" + recordSet.Count + "]");

                    foreach (DataRow row in dst_Row)
                    {
                        ToMemory_CellImpl updater = new ToMemory_CellImpl();

                        recordFielddefinition_Selected.ForEach(delegate(Fielddefinition fielddefinition_Selected, ref bool isBreak2, Log_Reports log_Reports2)
                        {
                            updater.ToMemory_ToSelectedField(
                                sOutputValue,
                                ec_SfCell,
                                row,
                                fielddefinition_Selected,
                                log_Reports
                                );
                        }, log_Reports);
                    }
                }
                else
                {
                    // エラー。
                    goto gt_Error_NotFoundRecord;
                }
            }

            goto gt_EndMethod;
            //
            //
gt_Error_NotSfcell:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー909!", pg_Method);

                Log_TextIndented s = new Log_TextIndentedImpl();

                s.Append("Sf:cell;でないExpression_Node_Stringが指定されました。");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                // ヒント
                s.Append(r.Message_Configuration(ec_SfCell.Cur_Configuration));
                if (null != ec_SfCell)
                {
                    ec_SfCell.ToText_Snapshot(s);
                }

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

                StringBuilder s = new StringBuilder();

                s.Append("引数e_KeyExpectedにヌルが指定されました。 e_KeyExpected=[");
                s.Append(ec_KeyExpected);
                s.Append("]");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                s.Append("  this.TableName=[");
                s.Append(ec_TableName1.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                s.Append("]");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                // ヒント
                s.Append(r.Message_Configuration(ec_SfCell.Cur_Configuration));

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;

gt_Error_EmptyKeyField:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー903!", pg_Method);

                StringBuilder s = new StringBuilder();

                s.Append("fieldで指定されたキーフィールドの名前が空文字列でした。 err_SKeyFldName=[");
                s.Append(err_SKeyFldName);
                s.Append("]");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                s.Append("  this.TableName=[");
                s.Append(ec_TableName1.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                s.Append("]");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                // ヒント
                s.Append(r.Message_Configuration(ec_SfCell.Cur_Configuration));

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;

gt_Error_ZeroKeyField:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー902!", pg_Method);

                StringBuilder s = new StringBuilder();

                s.Append("fieldで指定されたキーフィールドの個数が0個でした。 err_SKeyFldName=[");
                s.Append(err_SKeyFldName);
                s.Append("]");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                s.Append("  this.TableName=[");
                s.Append(ec_TableName1.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                s.Append("]");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                // ヒント
                s.Append(r.Message_Configuration(ec_SfCell.Cur_Configuration));

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;

gt_Error_EmptySelectField:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー904!", pg_Method);

                StringBuilder s = new StringBuilder();

                s.Append("selectで指定されたフィールドの名前に空文字列がありました。 err_SSelectedFldName=[");
                s.Append(err_SSelectedFldName);
                s.Append("]");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                s.Append("  this.TableName=[");
                s.Append(ec_TableName1.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                s.Append("]");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                // ヒント
                s.Append(r.Message_Configuration(ec_SfCell.Cur_Configuration));

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;

gt_Error_ZeroSelectField:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー901!", pg_Method);

                StringBuilder s = new StringBuilder();

                s.Append("selectで指定されたフィールドの個数が0個でした。 err_SSelectedFldName=[");
                s.Append(err_SSelectedFldName);
                s.Append("]");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                s.Append("  this.TableName=[");
                s.Append(ec_TableName1.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                s.Append("]");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                // ヒント
                s.Append(r.Message_Configuration(ec_SfCell.Cur_Configuration));

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;

            // エラー。
gt_Error_NotFoundTable:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー1011!", pg_Method);

                StringBuilder s = new StringBuilder();

                s.Append(" ヌル=refTable");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                s.Append("  this.TableName=[");
                s.Append(ec_TableName1.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                s.Append("]");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                // ヒント
                s.Append(r.Message_Configuration(ec_SfCell.Cur_Configuration));

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;

gt_Error_NotFoundKeyFldDefinition:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー478!", pg_Method);

                StringBuilder t = new StringBuilder();

                t.Append(" キーフィールドの定義を取得できませんでした。");
                t.Append(Environment.NewLine);

                t.Append("「E■[");
                t.Append(ec_KeyFldName1.Cur_Configuration.Name);
                t.Append("]」、キーフィールド名=[");
                t.Append(ec_KeyFldName1.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                t.Append("]");
                t.Append(Environment.NewLine);
                t.Append(Environment.NewLine);

                // ヒント
                t.Append(r.Message_Configuration(ec_SfCell.Cur_Configuration));

                r.Message = t.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;

gt_Error_NotFoundSelectFldDefinition:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー479!", pg_Method);

                StringBuilder t = new StringBuilder();

                t.Append(" 取得データが入っているはずのフィールドの定義を取得できませんでした。");
                t.Append(Environment.NewLine);
                t.Append("  指定されたフィールド名=[");
                t.Append(sSelectedFldName);
                t.Append("]");
                t.Append(Environment.NewLine);
                t.Append(Environment.NewLine);

                // ヒント
                t.Append(r.Message_Configuration(ec_SfCell.Cur_Configuration));

                r.Message = t.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;

gt_Error_NotFoundRecord:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー344!", pg_Method);

                string sDebugExceptedKey = ec_KeyExpected.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);

                Log_TextIndented s = new Log_TextIndentedImpl();

                s.Append("【失敗】");
                s.Newline();
                s.Newline();

                s.Append("[");
                s.Append(o_Table.Name);
                s.Append("](テーブル)には、");
                s.Append(Environment.NewLine);

                s.Append("[");
                s.Append(ec_KeyFldName1.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                s.Append("]フィールドに");

                s.Append("[");
                s.Append(sDebugExceptedKey);
                s.Append("]が入っているレコードは、見つかりませんでした。");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);
                s.Append("この入力したデータは、入力が確定されず、無視されています。");
                s.Append(Environment.NewLine);

                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);
                s.Append("もしかして?");
                s.Append(Environment.NewLine);
                s.Append(" ・ツールの不便さにより、手入力で");
                s.Append(Environment.NewLine);
                s.Append("  指定のテーブルに ID付きのレコードの空欄を");
                s.Append(Environment.NewLine);
                s.Append("  予め 作っておかなければならなかった、といった決まりごとはありませんか?");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);
                s.Append(" ・それとも、それ以外の理由?");
                s.Append(Environment.NewLine);

                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);
                s.Append("────────以下はプログラマー用の情報。");
                s.Append(Environment.NewLine);


                // ヒント
                s.Append(r.Message_Configuration(ec_SfCell.Cur_Configuration));

                r.Message = s.ToString();

                //essageBox.Show(r.SMsg(log_Reports), Info_Forms.LibraryName + ":" + this.GetType().Name );
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //
            //
gt_EndMethod:
            pg_Method.EndMethod(log_Reports);
        }
Exemple #4
0
        //────────────────────────────────────────
        #endregion



        #region アクション
        //────────────────────────────────────────

        /// <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());
        }
Exemple #5
0
        //────────────────────────────────────────

        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);
        }
Exemple #6
0
        //────────────────────────────────────────
        #endregion



        #region アクション
        //────────────────────────────────────────

        /// <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_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)
            {
                string sName_Usercontrol;
                if (this.Functionparameterset.Sender is Customcontrol)
                {
                    Customcontrol ccFc = (Customcontrol)this.Functionparameterset.Sender;

                    sName_Usercontrol = ccFc.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);

                    log_Reports.Comment_EventCreationMe += "/追記:[" + sName_Usercontrol + "]コントロールが、[" + sFncName0 + "]アクションを実行。";
                }
                else
                {
                    sName_Usercontrol = "(▲不明101!)";
                    log_Reports.Comment_EventCreationMe += "/追記:[" + sFncName0 + "]アクションを実行。";
                }

                //
                //
                //
                //

                List <Usercontrol> ucFcList;
                if (log_Reports.Successful)
                {
                    // 正常時

                    // テーブルデータをコントロールにセットします。

                    //
                    // 指定のコントロール(無指定の場合、自コントロール)を
                    // まず取得。
                    //
                    Expression_Node_String ec_ArgListboxName;
                    this.TrySelectAttribute(out ec_ArgListboxName, Expression_Node_Function20Impl.PM_NAME_CONTROL_LISTBOX, EnumHitcount.One_Or_Zero, log_Reports);

                    ucFcList = this.Owner_MemoryApplication.MemoryForms.GetUsercontrolsByName(
                        ec_ArgListboxName, true, log_Reports);
                }
                else
                {
                    ucFcList = new List <Usercontrol>();
                }


                // リストボックスにテーブルのデータソースを関連付けます。
                if (log_Reports.Successful)
                {
                    // 正常時

                    // リストボックス コントロール。
                    Usercontrol fcUc = ucFcList[0];


                    Expression_Node_String ec_TableName = null;
                    string sTableName;
                    this.TrySelectAttribute(out sTableName, Expression_Node_Function20Impl.PM_NAME_TABLE, EnumHitcount.One_Or_Zero, log_Reports);

                    if ("" != sTableName)//this.E_SysArgDic.ContainsKey(E_SysFnc20Impl.S_ARG_TABLE_NAME)
                    {
                        //テーブル名を指定(アクション用引数)
                        this.TrySelectAttribute(out ec_TableName, Expression_Node_Function20Impl.PM_NAME_TABLE, EnumHitcount.One_Or_Zero, log_Reports);

                        // #デバッグ
                        if (log_Method.CanWarning())
                        {
                            log_Method.WriteWarning_ToConsole(" <arg3 tableName=”[" + ec_TableName.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]”>属性でした。");
                        }
                    }
                    else
                    {
                        // #デバッグ
                        if (log_Method.CanWarning())
                        {
                            log_Method.WriteWarning_ToConsole(" <arg3 tableName=”☆”>属性が未指定でした。");
                        }



                        Configuration_Node owner_Configurationtree_Control;
                        {
                            owner_Configurationtree_Control = this.Cur_Configuration.GetParentByNodename(
                                NamesNode.S_CONTROL1, EnumConfiguration.Tree, true, log_Reports);
                        }

                        //
                        // 次を期待。
                        // <data target=”list-box”>
                        //     <arg5 name=”tableName” value=”☆”>
                        //
                        List <Configurationtree_Node> cfList_Data = ((Configurationtree_Node)owner_Configurationtree_Control).GetChildrenByNodename(
                            NamesNode.S_DATA, false, log_Reports);
                        foreach (Configurationtree_Node cf_Data in cfList_Data)
                        {
                            string sAccess;
                            cf_Data.Dictionary_Attribute.TryGetValue(PmNames.S_ACCESS, out sAccess, false, log_Reports);

                            List <string> sList_Access = new CsvTo_ListImpl().Read(sAccess);

                            if (sList_Access.Contains(ValuesAttr.S_FROM))
                            {
                                // <data access=”from”>

                                string sDataMemory;
                                cf_Data.Dictionary_Attribute.TryGetValue(PmNames.S_MEMORY, out sDataMemory, true, log_Reports);

                                if (!log_Reports.Successful)
                                {
                                    goto gt_EndMethod;
                                }

                                if (ValuesAttr.S_RECORDS == sDataMemory)
                                {
                                    cf_Data.Dictionary_Attribute.TryGetValue(PmNames.S_NAME_TABLE, out sTableName, true, log_Reports);
                                    if (!log_Reports.Successful)
                                    {
                                        goto gt_EndMethod;
                                    }

                                    ec_TableName = new Expression_Leaf_StringImpl(sTableName, this, cf_Data);

                                    // #デバッグ
                                    if (log_Method.CanWarning())
                                    {
                                        log_Method.WriteWarning_ToConsole(" <data tableName=”[" + sTableName + "]”>属性でした。");
                                    }
                                }
                                else
                                {
                                    //#連続エラー
                                    {
                                        Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                                        tmpl.SetParameter(1, sDataMemory, log_Reports);//属性memoryの値

                                        this.Owner_MemoryApplication.CreateErrorReport("Er:110007;", tmpl, log_Reports);
                                    }
                                }
                            }
                        }



                        if (null == ec_TableName)
                        {
                            // エラー処理?
                            if (log_Method.CanError())
                            {
                                log_Method.WriteError_ToConsole(" 直接指定されなかったので、既に<data>にtableName属性があると期待しましたが、ありませんでした。");
                            }

                            sTableName   = "";                                                                                //string sTableName = "";
                            ec_TableName = new Expression_Leaf_StringImpl(sTableName, this, owner_Configurationtree_Control); // owner_Cf_Fc.S_DataSource
                        }
                    }

                    //↓この中で時間かかってる。
                    Utility_Listbox.BindTableToDatasource(
                        fcUc,// リストボックス・コントロール
                        ec_TableName,
                        this.Owner_MemoryApplication,
                        log_Reports
                        );
                    //↑この中で時間かかってる。
                }
            }

            goto gt_EndMethod;
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return("");
        }
Exemple #7
0
        //────────────────────────────────────────
        #endregion



        #region アクション
        //────────────────────────────────────────

        /// <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());
        }
Exemple #8
0
        //────────────────────────────────────────

        /// <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);
        }
Exemple #9
0
        //────────────────────────────────────────

        /// <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);
        }
Exemple #10
0
        //────────────────────────────────────────

        public void Translate(
            Configurationtree_Node cur_Cf, //コントロール
            Expression_Node_String ec_Cur, //「E■form-component」
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            List <Configurationtree_Node> cfList_Data = cur_Cf.GetChildrenByNodename(NamesNode.S_DATA, false, log_Reports);

            foreach (Configurationtree_Node cf_Data in cfList_Data)
            {
                string sAccess;
                cf_Data.Dictionary_Attribute.TryGetValue(PmNames.S_ACCESS, out sAccess, false, log_Reports);

                List <string> sList_Access = new CsvTo_ListImpl().Read(sAccess);

                if (sList_Access.Contains(ValuesAttr.S_FROM))
                {
                    // <data>要素(access="from")を S→E。

                    ConfigurationtreeToExpression_F12_ to = new ConfigurationtreeToExpression_F12_DataImpl_();
                    to.Translate(
                        cf_Data,
                        ec_Cur,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );
                }

                // fromとtoは、両方持つこともある。

                if (sList_Access.Contains(ValuesAttr.S_TO))
                {
                    // <data>(access="to")要素要素を S→E。

                    ConfigurationtreeToExpression_F12_ to = new ConfigurationtreeToExpression_F12_DataImpl_();
                    to.Translate(
                        cf_Data,
                        ec_Cur,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );
                }
            }



            //
            // <view>要素を S→E。
            List <Configurationtree_Node> sList_View = cur_Cf.GetChildrenByNodename(NamesNode.S_VIEW, false, log_Reports);

            if (1 < sList_View.Count)
            {
                // <view>要素は1個だけあるという前提。
                throw new Exception("<[" + NamesNode.S_VIEW + "]>要素が2個以上あるのはエラー。");
            }
            else if (0 < sList_View.Count)
            {
                Configurationtree_Node cf_View = sList_View[0];

                ConfigurationtreeToExpression_F12_ViewImpl_ to = new ConfigurationtreeToExpression_F12_ViewImpl_();
                to.Translate(
                    cf_View,
                    ec_Cur,//.E_View,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }
            else
            {
            }
        }
Exemple #11
0
        //────────────────────────────────────────

        /// <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);
        }
Exemple #12
0
        //────────────────────────────────────────

        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 sName_Fnc;

            this.TrySelectAttribute(out sName_Fnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);

            if (log_Reports.CanStopwatch)
            {
                log_Method.Log_Stopwatch.Message = "Nアクション[" + sName_Fnc + "]実行";
                log_Method.Log_Stopwatch.Begin();
            }


            Exception error_Exception;
            string    error_Filepath_Export;


            Expression_Node_Filepath pm_FileImportListfile_Expr;

            this.TrySelectAttribute_ExpressionFilepath(out pm_FileImportListfile_Expr, Expression_Node_Function49Impl.PM_FILE_IMPORT_LISTFILE, EnumHitcount.One_Or_Zero, log_Reports);

            Expression_Node_String pm_FieldImportListfile_Expr;

            this.TrySelectAttribute(out pm_FieldImportListfile_Expr, Expression_Node_Function49Impl.PM_FIELD_IMPORT_LISTFILE, EnumHitcount.One, log_Reports);

            Expression_Node_String pm_FilterExtensionImport_Expr;

            this.TrySelectAttribute(out pm_FilterExtensionImport_Expr, Expression_Node_Function49Impl.PM_FILTER_EXTENSION_IMPORT, EnumHitcount.One, log_Reports);


            Expression_Node_Filepath pm_FileExportListfile_Expr;

            this.TrySelectAttribute_ExpressionFilepath(out pm_FileExportListfile_Expr, Expression_Node_Function49Impl.PM_FILE_EXPORT_LISTFILE, EnumHitcount.One_Or_Zero, log_Reports);

            Expression_Node_String pm_FieldExportListfile_Expr;

            this.TrySelectAttribute(out pm_FieldExportListfile_Expr, Expression_Node_Function49Impl.PM_FIELD_EXPORT_LISTFILE, EnumHitcount.One, log_Reports);

            Expression_Node_String pm_TypefieldExportListfile_Expr;

            this.TrySelectAttribute(out pm_TypefieldExportListfile_Expr, Expression_Node_Function49Impl.PM_TYPEFIELD_EXPORT_LISTFILE, EnumHitcount.One, log_Reports);

            Expression_Node_String pm_CommentfieldExportListfile_Expr;

            this.TrySelectAttribute(out pm_CommentfieldExportListfile_Expr, Expression_Node_Function49Impl.PM_COMMENTFIELD_EXPORT_LISTFILE, EnumHitcount.One, log_Reports);


            Expression_Node_String pm_RegularexpressionReplacebeforeNamefileexport_Expr;

            this.TrySelectAttribute(out pm_RegularexpressionReplacebeforeNamefileexport_Expr, Expression_Node_Function49Impl.PM_REGULAREXPRESSION_REPLACEBEFORE_NAMEFILEEXPORT, EnumHitcount.One_Or_Zero, log_Reports);

            Expression_Node_String pm_RegularexpressionReplaceafterNamefileexport_Expr;

            this.TrySelectAttribute(out pm_RegularexpressionReplaceafterNamefileexport_Expr, Expression_Node_Function49Impl.PM_REGULAREXPRESSION_REPLACEAFTER_NAMEFILEEXPORT, EnumHitcount.One_Or_Zero, log_Reports);


            Expression_Node_Filepath pm_FolderSource_Expr;

            this.TrySelectAttribute_ExpressionFilepath(out pm_FolderSource_Expr, Expression_Node_Function49Impl.PM_FOLDER_SOURCE, EnumHitcount.One_Or_Zero, log_Reports);

            Expression_Node_Filepath pm_FolderDestination_Expr;

            this.TrySelectAttribute_ExpressionFilepath(out pm_FolderDestination_Expr, Expression_Node_Function49Impl.PM_FOLDER_DESTINATION, EnumHitcount.One_Or_Zero, log_Reports);

            //ポップアップ指定
            string pm_Popup;

            this.TrySelectAttribute(out pm_Popup, Expression_Node_Function49Impl.PM_POPUP, EnumHitcount.One_Or_Zero, log_Reports);
            pm_Popup = pm_Popup.Trim();



            // メッセージボックスの表示。
            {
                Log_TextIndented str_Messagebox = new Log_TextIndentedImpl();
                str_Messagebox.Append(log_Method.Fullname);
                str_Messagebox.Append(":");
                str_Messagebox.Append(Environment.NewLine);

                this.Dictionary_Expression_Attribute.ToText_Debug(str_Messagebox, log_Reports);

                str_Messagebox.Append(
                    "file-import-listfile=[" + pm_FileImportListfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]\n\n" +
                    "field-import-listfile=[" + pm_FieldImportListfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]\n\n" +
                    "filter-extension-import=[" + pm_FilterExtensionImport_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]\n\n" +

                    "file-export-listfile=[" + pm_FileExportListfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]\n\n" +
                    "field-export-listfile=[" + pm_FieldExportListfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]\n\n" +
                    "typefield-export-listfile=[" + pm_TypefieldExportListfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]\n\n" +
                    "commentfield-export-listfile=[" + pm_CommentfieldExportListfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]\n\n" +

                    "regularexpression-replacebefore-namefileexport=[" + pm_RegularexpressionReplacebeforeNamefileexport_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]\n\n" +
                    "regularexpression-replaceafter-namefileexport=[" + pm_RegularexpressionReplaceafterNamefileexport_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]\n\n" +

                    "folder-source=[" + pm_FolderSource_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]\n\n" +
                    "folder-destination=[" + pm_FolderDestination_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]\n\n" +
                    "pm_Popup=[" + pm_Popup + "]\n\n"
                    );

                MessageBox.Show(str_Messagebox.ToString(), "デバッグ表示");
            }

            //書出し先ファイルパス。
            string filepath_Export = "";

            try
            {
                filepath_Export = pm_FileExportListfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);

                if ("" == filepath_Export)
                {
                    //エラー
                    error_Exception       = null;
                    error_Filepath_Export = filepath_Export;
                    goto gt_Error_FilepathExport;
                }
            }
            catch (Exception ex)
            {
                //エラー
                error_Exception       = ex;
                error_Filepath_Export = filepath_Export;
                goto gt_Error_FilepathExport;
            }


            // 「ファイル・リスト」CSVファイル読取り
            Table_Humaninput tableH;

            if (log_Reports.Successful)
            {
                CsvTo_Table_HumaninputImpl reader = new CsvTo_Table_HumaninputImpl();

                Request_ReadsTable      request_Reads  = new Request_ReadsTableImpl();
                Format_Table_Humaninput tblFormat_puts = new Format_Table_HumaninputImpl();
                request_Reads.Name_PutToTable     = log_Method.Fullname;//暫定
                request_Reads.Expression_Filepath = pm_FileImportListfile_Expr;

                tableH = reader.Read(
                    request_Reads,
                    tblFormat_puts,
                    true,
                    log_Reports
                    );
            }
            else
            {
                tableH = null;
            }

            // CSVに列追加。
            string name_FieldNew;
            int    index_FieldNew;

            if (log_Reports.Successful)
            {
                name_FieldNew = pm_FieldExportListfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                string          name_Typefield      = pm_TypefieldExportListfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                Fielddefinition fielddefinition_New = new FielddefinitionImpl(name_FieldNew, FielddefinitionImpl.TypefieldFromString(name_Typefield, true, log_Reports));
                fielddefinition_New.Comment = pm_CommentfieldExportListfile_Expr.Execute4_OnExpressionString(Syntax.EnumHitcount.Unconstraint, log_Reports);
                tableH.AddField(fielddefinition_New, true, log_Reports);

                index_FieldNew = tableH.RecordFielddefinition.ColumnIndexOf_Trimupper(name_FieldNew);
            }
            else
            {
                index_FieldNew = -1;
            }


            string regularexpression_Replacebefore_Namefileexport = pm_RegularexpressionReplacebeforeNamefileexport_Expr.Execute4_OnExpressionString(Syntax.EnumHitcount.Unconstraint, log_Reports);
            string regularexpression_Replaceafter_Namefileexport  = pm_RegularexpressionReplaceafterNamefileexport_Expr.Execute4_OnExpressionString(Syntax.EnumHitcount.Unconstraint, log_Reports);
            string name_FieldSource = pm_FieldImportListfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);// "FILE"

            if (log_Reports.Successful)
            {
                //
                // CSVソースファイル読取
                //

                int rowNumber = 1;
                tableH.ForEach_Datapart(delegate(Record_Humaninput recordH, ref bool isBreak2, Log_Reports log_Reports2)
                {
                    //記述されているファイルパス
                    string filepath_Source_Cur;
                    if (log_Reports.Successful)
                    {
                        String_HumaninputImpl.TryParse(
                            recordH.ValueAt(name_FieldSource),
                            out filepath_Source_Cur, "", "", log_Method, log_Reports);
                    }
                    else
                    {
                        filepath_Source_Cur = "";
                    }

                    if ("" == filepath_Source_Cur)
                    {
                        //空欄なら無視。
                        goto gt_EndInnermethod;
                    }

                    Configurationtree_NodeFilepath filepathCur_Conf;
                    if (log_Reports.Successful)
                    {
                        filepathCur_Conf = new Configurationtree_NodeFilepathImpl(log_Method.Fullname, null);
                        filepathCur_Conf.InitPath(filepath_Source_Cur, log_Reports);
                    }
                    else
                    {
                        filepathCur_Conf = null;
                    }

                    Expression_Node_Filepath filepathCur_Expr;
                    if (log_Reports.Successful)
                    {
                        filepathCur_Expr = new Expression_Node_FilepathImpl(filepathCur_Conf);
                    }
                    else
                    {
                        filepathCur_Expr = null;
                    }

                    //頭をカットする
                    Expression_Node_Filepath fileDestination_Expr;
                    if (log_Reports.Successful)
                    {
                        string filepath_Destination_New1;
                        filepathCur_Expr.TryCutFolderpath(out filepath_Destination_New1, pm_FolderSource_Expr, true, log_Reports);

                        //転送先パスの作成
                        Configurationtree_NodeFilepath fileDestination_Conf = new Configurationtree_NodeFilepathImpl(log_Method.Fullname, null);
                        fileDestination_Conf.InitPath(pm_FolderDestination_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports), filepath_Destination_New1, log_Reports);

                        fileDestination_Expr = new Expression_Node_FilepathImpl(fileDestination_Conf);
                    }
                    else
                    {
                        fileDestination_Expr = null;
                    }

                    if (!log_Reports.Successful)
                    {
                        //エラー
                        isBreak2 = true;
                        goto gt_EndInnermethod;
                    }

                    //
                    //ソース側の拡張子を確認したい。
                    //
                    string extension;
                    string filterExtension             = pm_FilterExtensionImport_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                    List <string> list_FilterExtension = new CsvTo_ListImpl().Read(filterExtension);
                    fileDestination_Expr.TryGetExtension(out extension, log_Reports);
                    //log_Method.WriteDebug_ToConsole("拡張子=[" + extension + "](要素数=" + list_FilterExtension.Count + ") フィルター=[" + filterExtension + "] 含まれる?=[" + list_FilterExtension.Contains(extension) + "]");

                    if (list_FilterExtension.Contains(extension))
                    {
                        //フィルターに含まれる

                        //出力側のファイルパス
                        Value_Humaninput valueH_New = new String_HumaninputImpl(log_Method.Fullname);
                        valueH_New.Text             = fileDestination_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);

                        //ファイル名を正規表現で置換をするか否か
                        if ("" != regularexpression_Replacebefore_Namefileexport)
                        {
                            Match m1 = Regex.Match(valueH_New.Text, regularexpression_Replacebefore_Namefileexport);
                            if (m1.Success)
                            {
                                //ファイルパスを正規表現で置換します。
                                valueH_New.Text = System.Text.RegularExpressions.Regex.Replace(
                                    valueH_New.Text,
                                    regularexpression_Replacebefore_Namefileexport,
                                    regularexpression_Replaceafter_Namefileexport
                                    );
                            }
                            else
                            {
                                //【2012-10-24 追加】
                                //置換が指定されているのに置換ができなかった場合は、空文字列に変換します。
                                valueH_New.Text = "";
                            }
                        }

                        //
                        // レコードの追加列に値セット。
                        //
                        recordH.SetValueAt(index_FieldNew, valueH_New, log_Reports);
                    }
                    else
                    {
                    }


                    //
                    gt_EndInnermethod:
                    rowNumber++;
                }, log_Reports);
            }

            //自動連番を振ります。
            if (log_Reports.Successful)
            {
                tableH.RenumberingNoField();
            }

            //CSVファイルの書出し
            if (log_Reports.Successful)
            {
                string text_Csv = new ToCsv_Table_Humaninput_Impl().ToCsvText(tableH, log_Reports);

                try
                {
                    System.IO.File.WriteAllText(
                        filepath_Export,
                        text_Csv,
                        Global.ENCODING_CSV
                        );

                    if (pm_Popup != S_BLOCK)
                    {
                        Log_TextIndented s = new Log_TextIndentedImpl();

                        s.Append("ファイルに書き込みました。");
                        s.Newline();
                        s.Append("[");
                        s.Append(filepath_Export);
                        s.Append("]");
                        s.Newline();
                        s.Newline();

                        MessageBox.Show(s.ToString(), "▲実行結果!(L02)");
                    }
                }
                catch (Exception ex)
                {
                    //エラー
                    error_Exception       = ex;
                    error_Filepath_Export = filepath_Export;
                    goto gt_Error_Exception;
                }
            }


            goto gt_EndMethod;
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_FilepathExport:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Exception(error_Exception), log_Reports); //例外メッセージ
                tmpl.SetParameter(2, error_Filepath_Export, log_Reports);                                   //出力先ファイルパス

                this.Owner_MemoryApplication.CreateErrorReport("Er:110031;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_Exception:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Exception(error_Exception), log_Reports); //例外メッセージ
                tmpl.SetParameter(2, error_Filepath_Export, log_Reports);                                   //出力先ファイルパス

                this.Owner_MemoryApplication.CreateErrorReport("Er:110032;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }