Ejemplo n.º 1
0
        //────────────────────────────────────────

        /// <summary>
        /// 子要素を追加します。
        /// </summary>
        /// <param name="sName"></param>
        /// <param name="nItem"></param>
        /// <param name="request"></param>
        /// <param name="log_Reports"></param>
        public void Set(
            string sName,
            Expression_Node_String ec_Item,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0);

            log_Method.BeginMethod(Info_Syntax.Name_Library, this, "Set", log_Reports);


            if (!this.dicExpression_Item.ContainsKey(sName))
            {
                // 新規項目なら

                // そのまま追加。
                this.dicExpression_Item.Add(sName, ec_Item);
            }
            else
            {
                // 既存項目なら

                // 上書きします。
                this.dicExpression_Item.Remove(sName);
                this.dicExpression_Item.Add(sName, ec_Item);


                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole(" 既に追加されていた項目を削除して、上書きしました。[" + sName + "]");
                }
            }

            log_Method.EndMethod(log_Reports);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// クリアーします。
        /// </summary>
        public void Clear(MemoryApplication owner_MemoryApplication)
        {
            Log_Method log_Method = new Log_MethodImpl(1, Log_ReportsImpl.BDebugmode_Static);
            Log_Reports log_Reports_ThisMethod = new Log_ReportsImpl(log_Method);
            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "Clear",log_Reports_ThisMethod);
            //

            this.owner_MemoryApplication = owner_MemoryApplication;

            if (null == this.DictionaryExpression_Item)
            {
                this.dictionaryExpression_Item = new Dictionary<string, Expression_Node_String>();
            }
            else
            {
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("次の変数を消します。");
                    log_Method.WriteDebug_ToConsole("────────────────────");
                    foreach (KeyValuePair<string, Expression_Node_String> kvp in this.DictionaryExpression_Item)
                    {
                        log_Method.WriteDebug_ToConsole("  " + kvp.Key + "=" + kvp.Value.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports_ThisMethod));
                    }
                    log_Method.WriteDebug_ToConsole("────────────────────");
                }

                this.DictionaryExpression_Item.Clear();
            }

            this.parent_Variablesconfig_Configurationtree = null;

            goto gt_EndMethod;
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports_ThisMethod);
            log_Reports_ThisMethod.EndLogging(log_Method);
        }
Ejemplo n.º 3
0
        //────────────────────────────────────────
        /// <summary>
        /// 「変数設定ファイル」のテーブルを読み取り、変数を登録します。
        /// </summary>
        /// <param oVariableName="varOTable"></param>
        /// <param oVariableName="log_Reports"></param>
        public void Load(
            Table_Humaninput o_Table_Var,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(1, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "Load",log_Reports);
            //

            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole("「変数登録ファイル」を Load します。");
            }

            //
            //
            //
            //

            if (null == o_Table_Var)
            {
                goto gt_Error_NullTable;
            }

            if (null != this.parent_Variablesconfig_Configurationtree)
            {
                goto gt_Error_DoubleLoad;
            }

            string err_SFolder;
            string err_SName;
            if (log_Reports.Successful)
            {
                this.parent_Variablesconfig_Configurationtree = new Configurationtree_NodeImpl(NamesNode.S_VARIABLE_CONFIG, o_Table_Var.Expression_Filepath_ConfigStack.Cur_Configuration);
                if (!log_Reports.Successful)
                {
                    // 既エラー。
                    goto gt_EndMethod;
                }

                foreach (DataRow dataRow in o_Table_Var.DataTable.Rows)
                {
                    string sStringValue;// = "";

                    // ソース情報として使うだけ。
                    Configurationtree_Node cf_VarRecord1 = new Configurationtree_NodeImpl(NamesNode.S_VARIABLE_RECORD, parent_Variablesconfig_Configurationtree);

                    // 注意: dataRow[]の連想配列は大文字・小文字を区別しないのが欠点。

                    //NAME列
                    {
                        string sFldName = NamesFld.S_NAME;//フィールド名。
                        if (o_Table_Var.ContainsField(sFldName,true,log_Reports))
                        {
                            if (String_HumaninputImpl.TryParse(
                                dataRow[sFldName],
                                out sStringValue,
                                o_Table_Var.Name,
                                sFldName,
                                log_Method,
                                log_Reports))
                            {
                            }
                            else
                            {
                                sStringValue = "";
                            }

                            if (!log_Reports.Successful)
                            {
                                // エラー
                                goto gt_EndMethod;
                            }

                            cf_VarRecord1.Dictionary_Attribute.Set(PmNames.S_NAME.Name_Pm, sStringValue, log_Reports);
                        }
                    }

                    // FOLDER列 (オプション)
                    {
                        string sFldName = NamesFld.S_FOLDER;
                        if (o_Table_Var.ContainsField(sFldName, false, log_Reports))
                        {
                            if (String_HumaninputImpl.TryParse(
                                dataRow[sFldName],
                                out sStringValue,
                                o_Table_Var.Name,
                                sFldName,
                                log_Method,
                                log_Reports))
                            {
                            }
                            else
                            {
                                sStringValue = "";
                            }

                            if (!log_Reports.Successful)
                            {
                                // エラー
                                goto gt_EndMethod;
                            }

                            //if (log_Method.CanDebug(1))
                            //{
                            //    log_Method.WriteDebug_ToConsole("「変数登録ファイル」FOLDER列=[" + sStringValue + "]");
                            //}
                            cf_VarRecord1.Dictionary_Attribute.Set(PmNames.S_FOLDER.Name_Pm, sStringValue, log_Reports);
                        }
                        else
                        {
                            //なければ無視。
                        }
                    }

                    // VALUE列
                    {
                        string sFldName = NamesFld.S_VALUE;//フィールド名。
                        if (o_Table_Var.ContainsField(sFldName, true, log_Reports))
                        {
                            if (String_HumaninputImpl.TryParse(
                                dataRow[sFldName],
                                out sStringValue,
                                o_Table_Var.Name,
                                sFldName,
                                log_Method,
                                log_Reports))
                            {
                            }
                            else
                            {
                                sStringValue = "";
                            }

                            if (!log_Reports.Successful)
                            {
                                // エラー
                                goto gt_EndMethod;
                            }

                            cf_VarRecord1.Dictionary_Attribute.Set(PmNames.S_VALUE.Name_Pm, sStringValue, log_Reports);
                        }
                    }

                    //
                    // 変数を登録。
                    //
                    if (log_Reports.Successful)
                    {
                        //NAME列
                        string sName;
                        cf_VarRecord1.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName, true, log_Reports);

                        //FOLDER列 (オプション)
                        string sFolder;
                        bool bExistsFolder = cf_VarRecord1.Dictionary_Attribute.TryGetValue(PmNames.S_FOLDER, out sFolder, false, log_Reports);

                        string sValue;
                        cf_VarRecord1.Dictionary_Attribute.TryGetValue(PmNames.S_VALUE, out sValue,
                            false, //空文字列でも可。
                            log_Reports);

                        if (NamesVar.Test_Filepath(sName))
                        {
                            //ファイルパス変数の場合。
                            Configurationtree_NodeFilepath cf_Fpath = new Configurationtree_NodeFilepathImpl("変数[" + sName + "]", this.parent_Variablesconfig_Configurationtree);
                            cf_Fpath.InitPath(
                                sValue,
                                log_Reports
                                );
                            if ("" != sFolder)
                            {
                                //if (log_Method.CanDebug(1))
                                //{
                                //    log_Method.WriteDebug_ToConsole("「変数登録ファイル」FOLDER列指定あり=[" + sFolder + "]");
                                //}

                                Expression_Node_String ec_Namevar_Folder = new Expression_Leaf_StringImpl(sFolder, null, this.parent_Variablesconfig_Configurationtree);
                                Expression_Node_Filepath ec_Fopath_Folder = this.GetExpressionfilepathByVariablename(
                                    ec_Namevar_Folder,
                                    true,
                                    log_Reports
                                    );
                                cf_Fpath.SetDirectory_Base(ec_Fopath_Folder.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                            }
                            //else
                            //{
                            //    if (log_Method.CanDebug(1))
                            //    {
                            //        log_Method.WriteDebug_ToConsole("「変数登録ファイル」FOLDER列指定なし");
                            //    }
                            //}

                            Expression_Node_Filepath ec_Fpath = new Expression_Node_FilepathImpl(cf_Fpath);

                            this.PutFilepath(
                                sName,
                                ec_Fpath,
                                true,
                                log_Reports
                                );

                            //if (log_Method.CanDebug(1))
                            //{
                            //    log_Method.WriteDebug_ToConsole("「変数登録ファイル」ファイルパス変数=[" + sName + "] 値=[" + ec_Fpath.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]");
                            //}
                        }
                        else
                        {
                            //ファイルパス以外の変数の場合。
                            //if (log_Method.CanDebug(1))
                            //{
                            //    log_Method.WriteDebug_ToConsole("「変数登録ファイル」ファイルパス以外の変数=[" + sName + "]");
                            //}

                            if (bExistsFolder && "" != sFolder)
                            {
                                //ファイルパス変数以外の変数で、FOLDER列値を指定しているのはエラーです。
                                //※FOLDER列が存在する場合だけエラーチェックします。FOLDER列値がない場合は、sFolderには"null"が入っているので無視します。

                                err_SName = sName;
                                err_SFolder = sFolder;
                                goto gt_Error_InputFolder;
                            }

                            this.PutString(
                                sName,
                                sValue,
                                log_Reports
                                );
                        }

                    }

                }
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
            gt_Error_InputFolder:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("Er:402;", log_Method);

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append("[");
                s.Append(err_SName);
                s.Append("]変数に、");
                s.Append(PmNames.S_FOLDER.Name_Attribute);
                s.Append( "列値を指定しているのはエラーです。");
                s.Newline();
                s.Append( PmNames.S_FOLDER.Name_Attribute );
                s.Append("列値は、ファイルパス変数にしか書いてはいけません。");
                s.Newline();
                s.Append("ファイルパス変数は、「");
                s.Append(NamesVar.S_SP_);
                s.Append("」、「");
                s.Append(NamesVar.S_UP_);
                s.Append("」で始まる名前の変数です。");
                s.Newline();
                s.Newline();

                s.AppendI(1, PmNames.S_FOLDER.Name_Attribute);
                if (null == err_SFolder)
                {
                    s.Append("=ヌル。");
                }
                else
                {
                    s.Append("=[");
                    s.Append(err_SFolder);
                    s.Append("]");
                }
                s.Newline();
                s.Newline();

                // ヒント

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

                StringBuilder t = new StringBuilder();
                t.Append("指定されたテーブルは、ヌルでした。");
                t.Append(Environment.NewLine);
                t.Append(Environment.NewLine);

                // ヒント

                r.Message = t.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_Error_DoubleLoad:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー919!", log_Method);

                StringBuilder t = new StringBuilder();
                t.Append("既に「変数設定ファイル」はロードされているのに、");
                t.Append(Environment.NewLine);
                t.Append("また 「変数設定ファイル」をロードしようとしました。");
                t.Append(Environment.NewLine);
                t.Append(Environment.NewLine);

                // ヒント

                r.Message = t.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        protected void Execute6_Sub(
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(1, 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();
            }

            //
            // 変数は、登録されている名前の変数は存在し、登録されていない名前の変数は(自動作成されたもの以外は)存在しない。
            //
            // 元となるテーブルを見ながら、変数オブジェクトの内容を調べていく。
            //
            //

            Configurationtree_Node cur_Cf = new Configurationtree_NodeImpl(log_Method.Fullname, null);

            // 変数ログを吐く。
            {
                StringBuilder sb = new StringBuilder();

                //1行目
                sb.Append(NamesFld.S_NO);//NO
                sb.Append(",");
                sb.Append(NamesFld.S_ID);//ID
                sb.Append(",");
                sb.Append(NamesFld.S_TREE);//TREE
                sb.Append(",");
                sb.Append(NamesFld.S_EXPL);//Expl
                sb.Append(",");
                sb.Append(NamesFld.S_FILE);//FILE
                sb.Append(",");
                sb.Append(NamesFld.S_NAME);//NAME
                sb.Append(",");
                sb.Append(NamesFld.S_TYPE);//TYPE
                sb.Append(",");
                sb.Append(NamesFld.S_TEXT);//TEXT
                sb.Append(",");
                sb.Append(NamesFld.S_FONT_SIZE_PT);//FONT_SIZE_PT
                sb.Append(",");
                sb.Append(NamesFld.S_X_LT);//X_LT
                sb.Append(",");
                sb.Append(NamesFld.S_Y_LT);//Y_LT
                sb.Append(",");
                sb.Append(NamesFld.S_WIDTH);//WIDTH
                sb.Append(",");
                sb.Append(NamesFld.S_HEIGHT);//HEIGHT
                sb.Append(",");
                sb.Append(NamesFld.S_ENABLED);//ENABLED
                sb.Append(",");
                sb.Append(NamesFld.S_VISIBLE);//VISIBLE
                sb.Append(",");
                sb.Append(NamesFld.S_READ_ONLY);//READ_ONLY
                sb.Append(",");
                sb.Append(NamesFld.S_WORD_WRAP);//WORD_WRAP
                sb.Append(",");
                sb.Append(NamesFld.S_NEW_LINE);//NEW_LINE
                sb.Append(",");
                sb.Append(NamesFld.S_SCROLL_BARS);//SCROLL_BARS
                sb.Append(",");
                sb.Append(NamesFld.S_CHK_VALUE_TYPE);//CHK_VALUE_TYPE
                sb.Append(",");
                sb.Append(NamesFld.S_PIC_ZOOM);//PIC_ZOOM
                sb.Append(",");
                sb.Append(NamesFld.S_TAB_INDEX);//TAB_INDEX
                sb.Append(",");
                sb.Append(NamesFld.S_BACK_COLOR);//BACK_COLOR
                sb.Append(",");
                //ここまで基本テーブル。
                sb.Append(NamesFld.S_ITEM_HEIGHT_PX);//ITEM_HEIGHT_PX
                sb.Append(",");
                sb.Append(NamesFld.S_ITEM_DISPLAY_FORMAT);//ITEM_DISPLAY_FORMAT
                sb.Append(",");
                sb.Append(NamesFld.S_LIST_VALUE_FIELD);//LIST_VALUE_FIELD
                sb.Append(",");
                sb.Append(NamesFld.S_END);
                sb.Append(Environment.NewLine);

                //2行目
                sb.Append(NamesTypedb.S_INT);//NO
                sb.Append(",");
                sb.Append(NamesTypedb.S_INT);//ID
                sb.Append(",");
                sb.Append(NamesTypedb.S_INT);//TREE
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//Expl
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//FILE
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//NAME
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//TYPE
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//TEXT
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//FONT_SIZE_PT
                sb.Append(",");
                sb.Append(NamesTypedb.S_INT);//X_LT
                sb.Append(",");
                sb.Append(NamesTypedb.S_INT);//Y_LT
                sb.Append(",");
                sb.Append(NamesTypedb.S_INT);//WIDTH
                sb.Append(",");
                sb.Append(NamesTypedb.S_INT);//HEIGHT
                sb.Append(",");
                sb.Append(NamesTypedb.S_BOOL);//ENABLED
                sb.Append(",");
                sb.Append(NamesTypedb.S_BOOL);//VISIBLE
                sb.Append(",");
                sb.Append(NamesTypedb.S_BOOL);//READ_ONLY
                sb.Append(",");
                sb.Append(NamesTypedb.S_BOOL);//WORD_WRAP
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//NEW_LINE
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//SCROLL_BARS
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//CHK_VALUE_TYPE
                sb.Append(",");
                sb.Append(NamesTypedb.S_INT);//PIC_ZOOM
                sb.Append(",");
                sb.Append(NamesTypedb.S_INT);//TAB_INDEX
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//BACK_COLOR
                sb.Append(",");
                //ここまで基本テーブル。
                sb.Append(NamesTypedb.S_INT);//ITEM_HEIGHT_PX
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//ITEM_DISPLAY_FORMAT
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//LIST_VALUE_FIELD
                sb.Append(",");
                sb.Append(NamesFld.S_END);
                sb.Append(Environment.NewLine);

                //3行目
                sb.Append("-1,");//NO
                sb.Append("使わない,");//ID
                sb.Append("ネスト関係,");//TREE
                sb.Append("解説,");//Expl
                sb.Append("コントロール設定ファイルパス,");//FILE
                sb.Append("コントロール固有名,");//NAME
                sb.Append("コントロールの型,");//TYPE
                sb.Append("初期値,");//TEXT
                sb.Append("フォントサイズ(pt),");//FONT_SIZE_PT
                sb.Append("左上角の座標X,");//X_LT
                sb.Append("左上角の座標Y,");//Y_LT
                sb.Append("横幅ピクセル,");//WIDTH
                sb.Append("縦幅ピクセル,");//HEIGHT
                sb.Append("活性化,");//ENABLED
                sb.Append("可視,");//VISIBLE
                sb.Append("テキストボックス等を読み取り専用にするなら真。,");//READ_ONLY
                sb.Append("テキストエリアで行を自動的に折り返すなら真。,");//WORD_WRAP
                sb.Append("(テキストエリア)改行記号。,");//NEW_LINE
                sb.Append("テキストエリア等で利用。None,Horizontal,Vertical,Bothの4つ。使わないなら空欄。,");//SCROLL_BARS
                sb.Append("チェックボックスの値の型。(空欄:false,true。ZERO_ONE:0,1),");//CHK_VALUE_TYPE
                sb.Append("(未実装)画像の倍角サイズ。2000で2倍。,");//PIC_ZOOM
                sb.Append("タブ・インデックス,");//TAB_INDEX
                sb.Append("背景色,");//BACK_COLOR
                //ここまで基本テーブル。
                sb.Append("リストボックスの項目の高さ(ピクセル),");//ITEM_HEIGHT_PX
                sb.Append("リストボックスの各項目の表示書式,");//ITEM_DISPLAY_FORMAT
                sb.Append("(開発中)リストボックスの値が入っている、レコードのフィールド名。,");//LIST_VALUE_FIELD
                sb.Append(NamesFld.S_END);
                sb.Append(Environment.NewLine);

                int nAuto = 0;
                this.Owner_MemoryApplication.MemoryForms.ForEach_Children(delegate(string sKey, Usercontrol uct_Child, ref bool bRemove, ref bool bBreak)
                {
                    //uct_Child.ControlCommon.Configurationtree_Control.Dictionary_Attribute.

                    sb.Append(nAuto);//NO
                    sb.Append(",");
                    //ID は使わない。
                    sb.Append(",");
                    sb.Append(NamesFld.S_TREE);//TREE
                    sb.Append(",");
                    sb.Append(NamesFld.S_EXPL);//Expl
                    sb.Append(",");
                    sb.Append(NamesFld.S_FILE);//FILE
                    sb.Append(",");
                    sb.Append(uct_Child.ControlCommon.Configurationtree_Control.Name);//NAME
                    sb.Append(",");
                    sb.Append(NamesFld.S_TYPE);//TYPE
                    sb.Append(",");
                    sb.Append(uct_Child.UsercontrolText);//TEXT
                    sb.Append(",");
                    sb.Append(uct_Child.UsercontrolFontsizept);//FONT_SIZE_PT
                    sb.Append(",");
                    sb.Append(uct_Child.UsercontrolXlt);//X_LT
                    sb.Append(",");
                    sb.Append(uct_Child.UsercontrolYlt);//Y_LT
                    sb.Append(",");
                    sb.Append(uct_Child.UsercontrolWidth);//WIDTH
                    sb.Append(",");
                    sb.Append(uct_Child.UsercontrolHeight);//HEIGHT
                    sb.Append(",");
                    if (uct_Child.UsercontrolEnabled)
                    {
                        sb.Append(uct_Child.UsercontrolEnabled);//ENABLED
                    }
                    sb.Append(",");
                    if (uct_Child.UsercontrolVisible)
                    {
                        sb.Append(uct_Child.UsercontrolVisible);//VISIBLE
                    }
                    sb.Append(",");
                    if (uct_Child.UsercontrolReadonly)
                    {
                        sb.Append(uct_Child.UsercontrolReadonly);//READ_ONLY
                    }
                    sb.Append(",");
                    if (uct_Child.UsercontrolWordwrap)
                    {
                        sb.Append(uct_Child.UsercontrolWordwrap);//WORD_WRAP
                    }
                    sb.Append(",");
                    sb.Append(uct_Child.UsercontrolNewline);//NEW_LINE
                    sb.Append(",");
                    switch (uct_Child.UsercontrolScrollbars)
                    {
                        case ScrollBars.Both:
                            sb.Append(ValuesAttr.S_BOTH);
                            break;
                        case ScrollBars.Horizontal:
                            sb.Append(ValuesAttr.S_HORIZONTAL);
                            break;
                        case ScrollBars.Vertical:
                            sb.Append(ValuesAttr.S_VERTICAL);
                            break;
                        default:
                            //TODO:「無視」と、「無し」は、分けたい。
                            //sb.Append(ValuesAttr.S_NONE);
                            break;
                    }
                    sb.Append(",");
                    sb.Append(uct_Child.UsercontrolChkvaluetype);//CHK_VALUE_TYPE
                    sb.Append(",");
                    sb.Append(uct_Child.UsercontrolPiczoom);//PIC_ZOOM
                    sb.Append(",");
                    sb.Append(uct_Child.UsercontrolTabindex);//TAB_INDEX
                    sb.Append(",");
                    sb.Append(uct_Child.UsercontrolBackcolor);//BACK_COLOR
                    sb.Append(",");
                    //ここまで基本テーブル。
                    sb.Append(uct_Child.UsercontrolItemheightpx);//ITEM_HEIGHT_PX
                    sb.Append(",");
                    sb.Append(uct_Child.UsercontrolItemdisplayformat);//ITEM_DISPLAY_FORMAT
                    sb.Append(",");
                    sb.Append(uct_Child.UsercontrolListvaluefield/*"NO"*/);//TODO:LIST_VALUE_FIELD
                    sb.Append(",");
                    sb.Append(NamesFld.S_END);
                    sb.Append(Environment.NewLine);

                    nAuto++;
                });

                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole(sb.ToString());
                }

                //ログ出力
                {
                    Expression_Node_Filepath ec_Fpath_Logs = this.Owner_MemoryApplication.MemoryVariables.GetExpressionfilepathByVariablename(new Expression_Leaf_StringImpl(NamesVar.S_SP_LOGS, null, cur_Cf), true, log_Reports);

                    string sFpatha_LogVariables = ec_Fpath_Logs.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + System.IO.Path.DirectorySeparatorChar + NamesFile.S_LOG_FORM;

                    if (log_Reports.Successful)
                    {
                        CsvWriterImpl writer = new CsvWriterImpl();
                        writer.Write(
                            sb.ToString(),
                            sFpatha_LogVariables,
                            true
                            );
                    }
                }
            }

            //変数CSVを吐き出したい。(登録されている順序を保って)
            {
                // 変数ファイルの読取り
                Table_Humaninput o_Table_Variables;
                this.Owner_MemoryApplication.MemoryVariables.TryGetTable_Variables(
                    out o_Table_Variables,
                    Application.StartupPath,
                    log_Reports
                    );

                if (null != o_Table_Variables)
                {
                    StringBuilder sb = new StringBuilder();

                    //1行目
                    sb.Append(NamesFld.S_NO);//NO
                    sb.Append(",");
                    sb.Append(NamesFld.S_ID);//ID
                    sb.Append(",");
                    sb.Append(NamesFld.S_TREE);//TREE
                    sb.Append(",");
                    sb.Append(NamesFld.S_EXPL);//Expl
                    sb.Append(",");
                    sb.Append(NamesFld.S_NAME);
                    sb.Append(",");
                    sb.Append(NamesFld.S_FOLDER);
                    sb.Append(",");
                    sb.Append(NamesFld.S_VALUE);
                    sb.Append(",");
                    sb.Append(NamesFld.S_END);
                    sb.Append(Environment.NewLine);

                    //2行目
                    sb.Append(NamesTypedb.S_INT);//NO
                    sb.Append(",");
                    sb.Append(NamesTypedb.S_INT);//ID
                    sb.Append(",");
                    sb.Append(NamesTypedb.S_STRING);//Expl
                    sb.Append(",");
                    sb.Append(NamesTypedb.S_STRING);//NAME
                    sb.Append(",");
                    sb.Append(NamesTypedb.S_STRING);//FOLDER
                    sb.Append(",");
                    sb.Append(NamesTypedb.S_STRING);//VALUE
                    sb.Append(",");
                    sb.Append(NamesFld.S_END);//END
                    sb.Append(Environment.NewLine);

                    //3行目
                    sb.Append("-1,");//NO
                    sb.Append("使わない,");//ID
                    sb.Append("解説,");//Expl
                    sb.Append("変数名,");//NAME
                    sb.Append("(ファイルパス変数のみ指定有効)フォルダーパス,");//FOLDER
                    sb.Append("初期値,");//VALUE
                    sb.Append(NamesFld.S_END);//END
                    sb.Append(Environment.NewLine);

                    int nAuto = 0;
                    foreach (DataRow row in o_Table_Variables.DataTable.Rows)
                    {

                        if (o_Table_Variables.DataTable.Columns.Contains(NamesFld.S_NO))
                        {
                            int nValue;
                            Int_HumaninputImpl.TryParse(row[NamesFld.S_NO], out nValue, EnumOperationIfErrorvalue.Spaces_To_Alt_Value, 0, log_Reports);
                            sb.Append(nValue);
                            sb.Append(",");
                        }

                        // IDは空欄が正しいが、int型なので空欄にできないので 0 を入れる。
                        if (o_Table_Variables.DataTable.Columns.Contains(NamesFld.S_ID))
                        {
                            int nValue;
                            Int_HumaninputImpl.TryParse(row[NamesFld.S_ID], out nValue, EnumOperationIfErrorvalue.Spaces_To_Alt_Value, 0, log_Reports);
                            sb.Append(nValue);
                            sb.Append(",");
                        }

                        if (o_Table_Variables.DataTable.Columns.Contains(NamesFld.S_EXPL))
                        {
                            string sValue;
                            String_HumaninputImpl.TryParse(row[NamesFld.S_EXPL], out sValue, "", "", log_Method, log_Reports);
                            sb.Append(sValue);
                            sb.Append(",");
                        }

                        string sName_Var = "";
                        if (o_Table_Variables.DataTable.Columns.Contains(NamesFld.S_NAME))
                        {
                            string sValue;
                            String_HumaninputImpl.TryParse(row[NamesFld.S_NAME], out sValue, "", "", log_Method, log_Reports);
                            sb.Append(sValue);
                            sb.Append(",");

                            sName_Var = sValue;
                        }

                        // 現在の変数の内容
                        string sValue_Var = this.Owner_MemoryApplication.MemoryVariables.GetStringByVariablename(new Expression_Leaf_StringImpl(sName_Var, null, cur_Cf), true, log_Reports);

                        //現在の変数の内容を検索
                        if (NamesVar.Test_Filepath(sName_Var))
                        {
                            Expression_Node_Filepath ec_Fpath = this.Owner_MemoryApplication.MemoryVariables.GetExpressionfilepathByVariablename(new Expression_Leaf_StringImpl(sName_Var, null, cur_Cf), true, log_Reports);
                            // 絶対パスとは限らない。フォルダーを指していることもある。
                            string sFpath = ec_Fpath.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);

                            //フォルダー列値を取得。
                            string sNamevar_Folder_Src;
                            if (o_Table_Variables.DataTable.Columns.Contains(NamesFld.S_FOLDER))
                            {
                                String_HumaninputImpl.TryParse(row[NamesFld.S_FOLDER], out sNamevar_Folder_Src, "", "", log_Method, log_Reports);

                                //フォルダーパス
                                Expression_Node_Filepath ec_Folder = this.Owner_MemoryApplication.MemoryVariables.GetExpressionfilepathByVariablename(new Expression_Leaf_StringImpl(sNamevar_Folder_Src,null,cur_Cf), false, log_Reports);
                                if (null != ec_Folder)
                                {
                                    // FOLDER列に入力があれば。

                                    string sFpath_Folder = ec_Folder.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                                    if (sValue_Var.StartsWith(sFpath_Folder))
                                    {
                                        // FOLDER列値をそのままキープ。
                                        sb.Append(sNamevar_Folder_Src);

                                        // 値のフォルダー部分を削る。
                                        sValue_Var = sValue_Var.Substring(sFpath_Folder.Length);

                                        // 先頭が ディレクトリー区切り文字なら削る。
                                        if (sValue_Var.StartsWith(System.IO.Path.DirectorySeparatorChar.ToString()))
                                        {
                                            sValue_Var = sValue_Var.Substring(System.IO.Path.DirectorySeparatorChar.ToString().Length);
                                        }
                                    }
                                    else
                                    {
                                        // FOLDER列値はそのまま使えない。
                                    }
                                }

                                sb.Append(",");
                            }

                            if (o_Table_Variables.DataTable.Columns.Contains(NamesFld.S_VALUE))
                            {
                                //string sValue;
                                //String_HumaninputImpl.TryParse(row[NamesFld.S_VALUE], out sValue, "", "", log_Method, log_Reports);
                                //sb.Append(sValue);
                                //sb.Append(",");

                                // 現在の変数の値(の削った残り)を入れる。
                                sb.Append(sValue_Var);
                                sb.Append(",");
                            }
                        }
                        else// if (NamesVar.Test_String(sName_Var))
                        {

                            // FOLDER列値は無し。
                            sb.Append(",");

                            if (o_Table_Variables.DataTable.Columns.Contains(NamesFld.S_VALUE))
                            {
                                // 現在の変数の値を入れる。
                                sb.Append(sValue_Var);
                                sb.Append(",");
                            }
                        }

                        sb.Append(NamesFld.S_END);
                        sb.Append(Environment.NewLine);

                        nAuto++;
                    }

                    //ファイル書出し
                    {
                        Expression_Node_Filepath ec_Fpath_Logs = this.Owner_MemoryApplication.MemoryVariables.GetExpressionfilepathByVariablename(new Expression_Leaf_StringImpl(NamesVar.S_SP_LOGS, null, cur_Cf), true, log_Reports);

                        string sFpatha_LogVariables = ec_Fpath_Logs.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + System.IO.Path.DirectorySeparatorChar + NamesFile.S_SAVE_FORM;

                        if (log_Reports.Successful)
                        {
                            CsvWriterImpl writer = new CsvWriterImpl();
                            writer.Write(
                                sb.ToString(),
                                sFpatha_LogVariables,
                                true
                                );
                        }
                    }
                }
            }

            //
            // メッセージボックスの表示。
            {
                StringBuilder sb = new StringBuilder();
                sb.Append(this.GetType().Name);
                sb.Append("#Execute6_Sub:");
                sb.Append(Environment.NewLine);
                string sArgMessage;
                this.TrySelectAttribute(out sArgMessage, Expression_Node_Function46Impl.PM_MESSAGE, EnumHitcount.One_Or_Zero, log_Reports);

                sb.Append(sArgMessage);

                MessageBox.Show(sb.ToString(), "変数をCSVファイルに書き出したい。");
            }

            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public override void XmlToConfigurationtree(
            XmlElement cur_X,//<arg1>
            Configurationtree_Node parent_Cf,//<fnc>
            MemoryApplication memoryApplication,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "XmlToConfigurationtree", log_Reports);
            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Configurationtree_Node cur_Cf = this.CreateMyself(cur_X, parent_Cf, memoryApplication, log_Reports);

            //
            //
            //
            // 属性
            //
            //
            //
            //string sFncName;
            //s_Parent.Dictionary_Attribute.TryGetValue(PmNames.NAME.Name_Attr, out sFncName, false, log_Reports);
            if (NamesNode.S_VALIDATOR == parent_Cf.Name)
            {
                //
                // <validator>の子<arg>
                //

                //
                // name=””
                {
                    XmlNode xNode = cur_X.Attributes.GetNamedItem(PmNames.S_NAME.Name_Attribute);
                    if (null != xNode)
                    {
                        string sName = xNode.Value;

                        cur_Cf.Dictionary_Attribute.Set(PmNames.S_NAME.Name_Pm, sName, log_Reports);
                    }
                }

                //
                // value=””
                string sValue;
                {
                    XmlNode xNode = cur_X.Attributes.GetNamedItem(PmNames.S_VALUE.Name_Attribute);
                    if (null != xNode)
                    {
                        sValue = xNode.Value;
                        cur_Cf.Dictionary_Attribute.Add(PmNames.S_VALUE.Name_Pm, sValue, cur_Cf, true, log_Reports);
                    }
                    else
                    {
                        sValue = "";
                    }
                }

                {
                    string sName;
                    cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName, false, log_Reports);

                    //O_Name o_Name = new O_NameImpl(sName, s_Cur);

                    parent_Cf.Dictionary_Attribute.Add( sName, sValue, parent_Cf, false, log_Reports);
                }

            }
            else
            {
                this.Parse_SAttribute(cur_X, cur_Cf, memoryApplication, log_Reports);
            }

            //
            //
            //
            // 子
            //
            //
            //
            this.Parse_ChildNodes(cur_X, cur_Cf, memoryApplication, log_Reports);

            //
            //
            //
            // 親へ連結
            //
            //
            //
            string err_Parent_SName;
            string parent_SName_Fnc;
            string parent_SAmemory;

            if(!log_Reports.Successful)
            {
                // エラー
                goto gt_EndMethod;
            }
            else if (
                // 親<data >
                NamesNode.S_DATA == parent_Cf.Name
                )
            {
                bool bHit = parent_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out parent_SName_Fnc, false, log_Reports);

                bool bHit3 = parent_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_MEMORY, out parent_SAmemory, true, log_Reports);

                if (
                    ValuesAttr.S_RECORDS == parent_SAmemory ||
                    ValuesAttr.S_VARIABLE == parent_SAmemory
                    )
                {
                    //
                    // 親 <data memory=”records”>
                    // 親 <data memory=”variable”>
                    //

                    //
                    // 属性としては追加する。
                    //
                    string sName_Fnc;
                    bool bHit2 = cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Fnc, false, log_Reports);
                    if (bHit2)
                    {
                        string sValue_Arg;
                        cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_VALUE, out sValue_Arg, false, log_Reports);

                        // 「S■data-source」の(<arg5 name属性>としてtarget値を追加。

                        // 属性とする。
                        if (log_Method.CanDebug(1))
                        {
                            log_Method.WriteDebug_ToConsole( "<データ target=[" + parent_SAmemory + "]>に属性追加 [" + sName_Fnc + "]←[" + sValue_Arg + "]");
                        }
                        parent_Cf.Dictionary_Attribute.Add(sName_Fnc, sValue_Arg, parent_Cf, true, log_Reports);
                    }
                }
                else
                {
                    // エラー
                    err_Parent_SName = parent_Cf.Name;
                    goto gt_Error_Target;
                }
            }
            else
            {
                // 親が<data>以外。
                bool bHit = parent_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out parent_SName_Fnc, true, log_Reports);//name属性が無い親もある??

                if (!log_Reports.Successful)
                {
                    log_Method.WriteWarning_ToConsole("s_Parent.Name_Node=[" + parent_Cf.Name + "]");
                }
                else
                {
                }

                if (
                    NamesNode.S_FNC != parent_Cf.Name &&
                    NamesNode.S_VALIDATOR != parent_Cf.Name &&
                    NamesNode.S_COMMON_FUNCTION != parent_Cf.Name &&
                    NamesFnc.S_SWITCH != parent_SName_Fnc //旧仕様に対応
                    )
                {
                    // 親要素が<fnc>でも<validator><common-function><f-switch>でもない。

                    // エラー
                    err_Parent_SName = parent_Cf.Name;
                    goto gt_Error_Parent;
                }
                else if (
                    // 親が<fnc name=”Sf:where;”>
                    NamesNode.S_FNC == parent_Cf.Name &&
                    NamesFnc.S_WHERE == parent_SName_Fnc)
                {
                    // この子arg1要素は、
                    // 親要素「S■f-cell」には追加しません。

                    // 【追加 2012-06-02】
                    // 現状では、「S■a-where」に子「S■arg1」要素が含まれていると、
                    // 「E■f-cell」にarg1要素を追加してしまうので都合が悪い。

                    //
                    // 属性としては追加する。
                    //
                    string sArgAname;
                    bool bHit2 = cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sArgAname, true, log_Reports);
                    if (!log_Reports.Successful)
                    {
                        goto gt_EndMethod;
                    }

                    string sValue;
                    cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_VALUE, out sValue, false, log_Reports);

                    // 「S■fnc」のlogic属性として追加。

                    // 属性連結
                    parent_Cf.Dictionary_Attribute.Add(sArgAname, sValue, parent_Cf, true, log_Reports);
                }
                else
                {
                    // 属性にせず、子まま連結。

                    // 子連結
                    parent_Cf.List_Child.Add(cur_Cf, log_Reports);
                }
            }

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

                Log_TextIndented t = new Log_TextIndentedImpl();
                t.Append("<");
                t.Append(cur_X.Name);
                t.Append(">要素の親は、<fnc>でなければなりませんでしたが、別の要素<");
                t.Append(err_Parent_SName);
                t.Append(">でした。");
                t.Newline();
                t.Newline();

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

                r.Message = t.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_Error_Target:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー562!", log_Method);

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append("<");
                s.Append(cur_X.Name);
                s.Append(">要素のtarget属性が予想外でした。<[");
                s.Append(err_Parent_SName);
                s.Append("] target=”[");
                s.Append(parent_SAmemory);
                s.Append("]”>");
                s.Newline();
                s.Newline();

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

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
        /// <summary>
        /// (8)「エディター設定ファイル」に記述されている<f-set-var>要素を、「エディター設定ファイル・モデル」に格納。Cf→M
        /// </summary>
        /// <param name="st_PrevProject_OrNull"></param>
        /// <param name="log_Reports"></param>
        private void On_P08_SpToVar_(
            out MemoryAaeditorxml_Editor out_moAaeditorxml_Editor,
            Expression_Node_Filepath ec_Fpath_AaEditorXml,
            Expression_Node_Filepath ec_Fopath_Editor,
            MemoryAatoolxml_Editor moAatoolxml_SelectedEditor,
            Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            log_Method.BeginMethod(Info_Functions.Name_Library, this, "On_P08_SpToVar_",log_Reports);

            //
            //
            //
            //(13c)『Aa_Editor.xml』ロード
            //
            //
            //
            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole("(13c)『Aa_Editor.xml』ロード");
            }

            MemoryAaeditorxml moAaeditorxml = new MemoryAaeditorxmlImpl(this.Owner_MemoryApplication);
            //moAaeditorxml.Clear1(log_Reports);

            if (log_Reports.Successful)
            {
                moAaeditorxml.Load_AutoSystemVariable(
                    ec_Fopath_Editor,
                    log_Reports
                    );
            }

            //
            out_moAaeditorxml_Editor = new MemoryAaeditorxml_EditorImpl(ec_Fpath_AaEditorXml.Cur_Configuration);
            if (log_Reports.Successful)
            {
                out_moAaeditorxml_Editor.LoadFile_Aaxml(
                    ec_Fpath_AaEditorXml,
                    this.Owner_MemoryApplication.MemoryVariables,
                    log_Reports
                    );
            }

            if (log_Reports.Successful)
            {
                moAaeditorxml.LoadFile(
                    ec_Fopath_Editor,
                    log_Reports
                    );
            }

            goto gt_EndMethod;
            //
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public void ParseChild_InConfigurationtreeToExpression(
            Configurationtree_Node cur_Conf,//S_NodeList s_curNodeList,
            Expression_Node_String parent_Expr,//nAcase,nFelemの両方の場合がある。
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "ParseChild_InSToE",log_Reports);
            //
            //

            if (null == parent_Expr)
            {
                goto gt_Error_NullNFAelem;
            }

            //
            // 親ノード名、親ファンク名
            //
            string parent_SName_Node = parent_Expr.Cur_Configuration.Name;
            string parent_SName_Fnc = "";
            {
                EnumHitcount enumHitcount;
                if (NamesNode.S_FNC == parent_SName_Node)
                {
                    //todo: enumHitcount = EnumHitcount.One;
                    enumHitcount = EnumHitcount.One_Or_Zero;
                }
                else
                {
                    enumHitcount = EnumHitcount.One_Or_Zero;
                }

                log_Reports.Log_Callstack.Push(log_Method, "①");
                bool bHit = parent_Expr.TrySelectAttribute(out parent_SName_Fnc, PmNames.S_NAME.Name_Pm, enumHitcount, log_Reports);
                log_Reports.Log_Callstack.Pop(log_Method, "①");
            }

            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole( "開始┌──┐ s_Curノード名=[" + cur_Conf.Name + "] 子要素数=[" + cur_Conf.List_Child.Count + "]");
            }

            //
            //
            //
            // 子
            //
            //
            //
            Configurationtree_Node err_Configurationtree_Node2 = null;
            cur_Conf.List_Child.ForEach(delegate(Configurationtree_Node s_Child, ref bool bBreak)
            {

                if (!log_Reports.Successful)
                {
                    // 強制終了。
                    bBreak = true;
                    return;
                }

                string sName_MyNode = s_Child.Name;
                string sName_MyFnc = "";
                {
                    bool bRequired;

                    if (NamesNode.S_ARG == sName_MyNode)
                    {
                        bRequired = true;
                    }
                    else
                    {
                        bRequired = false;
                    }

                    log_Reports.Log_Callstack.Push(log_Method, "②");
                    s_Child.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_MyFnc, bRequired, log_Reports);
                    log_Reports.Log_Callstack.Pop(log_Method, "②");
                }

                if (this.Dictionary_ConfigurationtreeToExpression.ContainsKey(sName_MyNode))
                {
                    if (log_Method.CanDebug(1))
                    {
                        log_Method.WriteDebug_ToConsole( "親「S■[" + parent_SName_Fnc + "] name=”[" + parent_SName_Fnc + "]”」 自「S■[" + sName_MyNode + "] name=”[" + sName_MyFnc + "]”」");
                    }

                    this.Dictionary_ConfigurationtreeToExpression[sName_MyNode].Translate(
                        s_Child,
                        parent_Expr,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );

                }
                else
                {
                    //
                    // それ以外、エラー。
                    //
                    err_Configurationtree_Node2 = s_Child;
                    bBreak = true;
                }
            });
            //
            if (null != err_Configurationtree_Node2)
            {
                goto gt_Error_UndefinedElement;
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
            gt_Error_NullNFAelem:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Configuration(parent_Expr.Cur_Configuration), log_Reports);//設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:7010;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_Error_UndefinedElement:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_Configurationtree_Node2.Name, log_Reports);//設定ノード名
                tmpl.SetParameter(2, err_Configurationtree_Node2.GetType().Name, log_Reports);//設定ノードのクラス名
                tmpl.SetParameter(3, this.Dictionary_ConfigurationtreeToExpression.Count.ToString(), log_Reports);//キーの個数

                StringBuilder s1 = new StringBuilder();
                foreach (string sKey in this.Dictionary_ConfigurationtreeToExpression.Keys)
                {
                    s1.Append(sKey);
                    s1.Append(System.Environment.NewLine);
                }
                tmpl.SetParameter(4, s1.ToString(), log_Reports);//キーのリスト

                //設定親ノード名
                if (null != parent_Expr)
                {
                    tmpl.SetParameter(5, parent_Expr.Cur_Configuration.Name, log_Reports);
                }
                else
                {
                    tmpl.SetParameter(5, "ヌル", log_Reports);
                }

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

                memoryApplication.CreateErrorReport("Er:7011;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                //d_ParsingLog.Decrement(s_Cur.Name_Node);
            }
            log_Method.EndMethod(log_Reports);

            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole( "終了└──┘");
            }
        }
        //────────────────────────────────────────
        public void Translate(
            Configurationtree_Node cur_Cf,
            Expressionv_3FListboxValidationImpl parent_Exprv,
            UsercontrolListbox uctLst,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(35)" + cur_Cf.Name);
            }

            //
            //

            string err_Child_SName_Node = "";
            string err_Parent_SName_Node = "";
            Configurationtree_Node err_Child_CfNode = null;

            //
            //
            //
            // 自
            //
            //
            //
            Expressionv_4ADisplayImpl cur_Exprv = new Expressionv_4ADisplayImpl(parent_Exprv, cur_Cf, memoryApplication);

            //
            //
            //
            // 属性
            //
            //
            //
            {
                {
                    PmName pmName = PmNames.S_TYPE;
                    string sValue;
                    bool bHit = cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, false, log_Reports);
                    if (bHit)
                    {
                        cur_Exprv.Dictionary_SAttribute.Add(pmName.Name_Pm, sValue);
                    }
                }

                {
                    PmName pmName = PmNames.S_DESCRIPTION;
                    string sValue;
                    bool bHit = cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, false, log_Reports);
                    if (bHit)
                    {
                        cur_Exprv.Dictionary_SAttribute.Add(pmName.Name_Pm, sValue);
                    }
                }
            }

            parent_Exprv.List_Expressionv_ADisplay.Add(cur_Exprv);
            uctLst.AddValidator_FListboxForItems(parent_Exprv, log_Reports);

            // #デバッグ中
            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole(" 子<f-●●>数=[" + cur_Cf.List_Child.Count + "]");
            }

            //
            //
            //
            // 子
            //
            //
            //
            cur_Cf.List_Child.ForEach(delegate(Configurationtree_Node child_Cf, ref bool bBreak)
            {
                if (child_Cf is Configurationtree_Node)
                {
                    Configurationtree_Node child_Configurationtree_Node = (Configurationtree_Node)child_Cf;

                    string sName_Fnc;
                    child_Configurationtree_Node.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Fnc, false, log_Reports);

                    if (NamesFnc.S_VLD_ALL_FIELDS_IS_EMPTY == sName_Fnc)
                    {
                        //
                        // <f-all-fields-is-empty>要素
                        ConfigurationtreeToExpression_V54_FAllFieldsIsEmptyImpl_ to = new ConfigurationtreeToExpression_V54_FAllFieldsIsEmptyImpl_();
                        to.Translate(
                            child_Configurationtree_Node,
                            cur_Exprv,
                            memoryApplication,
                            pg_ParsingLog,
                            log_Reports
                            );
                    }
                    else if (NamesFnc.S_ALL_TRUE == sName_Fnc)
                    {
                        //
                        // <f-all-true>要素
                        ConfigurationtreeToExpression_V54_FAllTrueImpl_ to = new ConfigurationtreeToExpression_V54_FAllTrueImpl_();
                        to.Translate(
                            child_Configurationtree_Node,
                            cur_Exprv,
                            memoryApplication,
                            pg_ParsingLog,
                            log_Reports
                            );

                    }
                    else
                    {
                        //
                        // エラー。
                        err_Child_SName_Node = child_Configurationtree_Node.Name;
                        err_Parent_SName_Node = cur_Cf.Name;
                        err_Child_CfNode = child_Configurationtree_Node;
                        bBreak = true;
                    }
                }
            });
            if (null != err_Child_SName_Node)
            {
                goto undefined_element;
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
            undefined_element:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_Child_SName_Node, log_Reports);//子設定ノード名
                tmpl.SetParameter(2, err_Parent_SName_Node, log_Reports);//親設定ノード名
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(err_Child_CfNode), log_Reports);//設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:7020;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
Ejemplo n.º 9
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);
        }
        //────────────────────────────────────────
        /// <summary>
        /// 内容をデバッグ出力します。
        /// </summary>
        public void CreateMessage_Debug(Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            Log_Reports d_Logging_Dammy = new Log_ReportsImpl(log_Method);
            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "CreateMessage_Debug",d_Logging_Dammy);
            //
            //

            //ystem.Console.WriteLine(this.GetType().Name + "#DebugWrite: 【デバッグ出力】 project要素の個数=[" + this.Items.Count + "]");

            foreach (MemoryAatoolxml_Editor aatool_Editor in this.Dictionary_Item.Values)
            {
                //ystem.Console.WriteLine(this.GetType().Name + "#DebugWrite: 【デバッグ出力】 project名=[" + st_Project.Name + "]");

                aatool_Editor.WriteDebug_ToConsole(aatool_Editor.Dictionary_Fsetvar_Configurationtree, log_Reports);
            }

            //
            //
            d_Logging_Dammy.EndCreateReport();
            log_Method.EndMethod(d_Logging_Dammy);
            if (!d_Logging_Dammy.Successful)
            {
                log_Method.WriteDebug_ToConsole(d_Logging_Dammy.ToText());
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// フォーム上の、コントロールを除外していきます。
        /// メインウィンドウ自身は除外せず残します。
        /// 
        /// todo:イベントハンドラーを外してから、フォームを外すこと。リストボックスが誤挙動を起こしている。
        /// </summary>
        /// <param name="formControls"></param>
        /// <param name="log_Reports"></param>
        public void ClearForms(
            Control.ControlCollection formControls,
            Log_Reports log_Reports
            )
        {
            //
            //
            //
            //()メソッド開始
            //
            //
            //
            Log_Method log_Method = new Log_MethodImpl(1, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "ClearForms",log_Reports);

            if (log_Reports.Successful)
            {
                Control mainwnd = this.Mainwnd_FormWrapping.Form;

                //
                //
                //
                //(1)フォームに登録されているコントロール全ての、イベントハンドラーを外す。
                //
                //
                //
                this.Owner_MemoryApplication.MemoryForms.ForEach_Children(delegate(string sKey, Usercontrol uct, ref bool bRemove, ref bool bBreak)
                {
                    if (log_Reports.Successful)
                    {
                        if (mainwnd != uct)
                        {
                            uct.ClearAllEventhandlers(log_Reports);
                        }
                        else
                        {
                            log_Method.WriteDebug_ToConsole("(1)メインウィンドウを除く。");
                        }
                    }
                });

                //
                //
                //
                //(2)フォームに登録されているコントロール全てを、クリアーする。
                //
                //
                //
                this.Owner_MemoryApplication.MemoryForms.ForEach_Children(delegate(string sKey, Usercontrol uct, ref bool bRemove, ref bool bBreak)
                {
                    if (log_Reports.Successful)
                    {
                        if (mainwnd != uct)
                        {
                            uct.Clear();
                        }
                        else
                        {
                            log_Method.WriteDebug_ToConsole("(2)メインウィンドウを除く。");
                        }
                    }
                });

                //
                //
                //
                //(3)フォームを構成しているカスタム・コントロール全てを、破棄する。
                //
                //
                //
                this.Owner_MemoryApplication.MemoryForms.ForEach_Children(delegate(string sKey, Usercontrol uct, ref bool bRemove, ref bool bBreak)
                {
                    if (log_Reports.Successful)
                    {
                        if (mainwnd != uct)
                        {
                            uct.DestractAllCustomcontrols(log_Reports);
                        }
                        else
                        {
                            log_Method.WriteDebug_ToConsole("(3)メインウィンドウを除く。");
                        }
                    }
                });

                //
                //
                //
                //(4)フォームに登録されているコントロール全てを、除外する。
                //
                //
                //
                this.Owner_MemoryApplication.MemoryForms.ForEach_Children(delegate(string sKey, Usercontrol uct, ref bool bRemove, ref bool bBreak)
                {
                    if (log_Reports.Successful)
                    {
                        if (mainwnd != uct)
                        {
                            formControls.Remove((Control)uct);
                        }
                        else
                        {
                            log_Method.WriteDebug_ToConsole("(4)メインウィンドウを除く。");
                        }
                    }
                });

                //
                // CSVExEに登録されているコントロールの一覧を空にします。
                //
                this.Clear(this.Owner_MemoryApplication);
                //this.dic_Item.Add(NamesSc.S_MAINWND, (Usercontrol)mainwnd);
            }

            //
            //
            //
            //
            log_Method.EndMethod(log_Reports);
        }
Ejemplo n.º 12
0
        //────────────────────────────────────────
        /// <summary>
        /// デバッグ出力。
        /// </summary>
        public void WriteDebug_ToConsole()
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            Log_Reports log_Reports_Dammy = new Log_ReportsImpl(log_Method);
            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "DebugWrite",log_Reports_Dammy);
            //
            //

            log_Reports_Dammy.BeginCreateReport(EnumReport.Dammy);

            log_Method.WriteInfo_ToConsole("コントロールの一覧を出力。総数=[" + this.dictionary_Item.Values.Count + "]");

            int nCount = 1;
            this.ForEach_Children(delegate(string sKey, Usercontrol fcUc, ref bool bRemove, ref bool bBreak)
            {

                if (null == fcUc)
                {
                    log_Method.WriteInfo_ToConsole("(" + nCount + ")ヌル");
                    goto end_fc;
                }

                log_Method.WriteInfo_ToConsole("(" + nCount + ")" + fcUc.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports_Dammy));
            // fcUc.ControlCommon.Configurationtree_Control は、ヌルのことがある。

                //foreach (S_Event s_event in fcUc.ControlCommon.Configurationtree_Control.S_EventDictionary.Values)
            //{

                //    // デバッグ出力
            //    //ystem.Console.WriteLine(this.GetType().Name + "#DebugWrite:  アクション数=[" + s_event.S_ActionList.Items.Count + "]");
            //    foreach (S_Action s_action in s_event.S_ActionList.Items)
            //    {
            //        //
            //        // アクション
            //        //

                //        // デバッグ出力
            //        //ystem.Console.WriteLine(this.GetType().Name + "#DebugWrite:   アクション=[" + s_action.SType + "] 引数数=[" + s_event.S_ActionList.Items.Count + "]");
            //        foreach (S_Arg s_param in s_action.S_Args.Items.Values)
            //        {
            //            //
            //            // 引数
            //            //

                //            if (s_param.S_ArgEnum == S_ArgEnum.PARAM_ACTION)
            //            {
            //                S_Action s_parentAction = (S_Action)s_param.Parent;

                //                // デバッグ出力
            //                //ystem.Console.WriteLine(this.GetType().Name + "#DebugWrite:    param-action要素=[" + s_param.SNodeName + "] 子引数数=[" + s_parentAction.S_Args.Items.Count + "]");

                //                foreach (S_Arg s_param2 in s_parentAction.S_Args.Items.Values)
            //                {
            //                    // デバッグ出力
            //                    //ystem.Console.WriteLine(this.GetType().Name + "#DebugWrite:     param-actionの子引数=[" + s_param2.SNodeName + "]");
            //                    // 値=[" + oAction2.OValue + "]
            //                }

                //            }
            //            else
            //            {
            //                // デバッグ出力
            //                //ystem.Console.WriteLine(this.GetType().Name + "#DebugWrite:    引数=[" + s_param.SNodeName + "] ");
            //                //値=[" + oArg.OValue + "]
            //            }

                //        }
            //    }
            //}

            end_fc:
                nCount++;
            });

            //
            //
            log_Reports_Dammy.EndCreateReport();
            log_Method.EndMethod(log_Reports_Dammy);
            if (!log_Reports_Dammy.Successful)
            {
                log_Method.WriteDebug_ToConsole(log_Reports_Dammy.ToText());
            }
        }
Ejemplo n.º 13
0
        //────────────────────────────────────────
        /// <summary>
        /// システム変数を、自動類推して、自動登録します。
        /// </summary>
        /// <param name="ec_Fopath_Editor"></param>
        /// <param name="log_Reports"></param>
        public void Load_AutoSystemVariable(
            Expression_Node_Filepath ec_Fopath_Editor,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(1, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "Load_AutoSystemVariable",log_Reports);
            //
            //

            // 「エディター・フォルダー」パス
            string sFopath_Editor = ec_Fopath_Editor.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);

            //
            // Engine フォルダー
            //
            if (log_Reports.Successful)
            {

                string sNamevar = NamesVar.S_SP_ENGINE;
                string sValue = sFopath_Editor + System.IO.Path.DirectorySeparatorChar + NamesFile.S_ENGINE;
                Configurationtree_NodeFilepath cf_Fpath = new Configurationtree_NodeFilepathImpl("L09自動類推", ec_Fopath_Editor.Cur_Configuration);
                cf_Fpath.InitPath(sValue, log_Reports);
                this.Owner_MemoryApplication.MemoryVariables.PutFilepath(
                    sNamevar,
                    new Expression_Node_FilepathImpl(cf_Fpath),
                    false,//重複登録可。
                    log_Reports
                    );
            }

            //
            // Forms フォルダー
            //
            if (log_Reports.Successful)
            {
                string sNamevar = NamesVar.S_SP_FORMS;
                string sValue = sFopath_Editor + System.IO.Path.DirectorySeparatorChar + NamesFile.S_FORMS;
                Configurationtree_NodeFilepath cf_Fpath = new Configurationtree_NodeFilepathImpl("L09自動類推", ec_Fopath_Editor.Cur_Configuration);
                cf_Fpath.InitPath(sValue, log_Reports);
                this.Owner_MemoryApplication.MemoryVariables.PutFilepath(
                    sNamevar,
                    new Expression_Node_FilepathImpl(cf_Fpath),
                    false,//重複登録可。
                    log_Reports
                    );
            }

            //
            // Logs フォルダー
            //
            if (log_Reports.Successful)
            {
                string sNamevar = NamesVar.S_SP_LOGS;
                string sValue = sFopath_Editor + System.IO.Path.DirectorySeparatorChar + NamesFile.S_LOGS;
                Configurationtree_NodeFilepath cf_Fpath = new Configurationtree_NodeFilepathImpl("L09自動類推", ec_Fopath_Editor.Cur_Configuration);
                cf_Fpath.InitPath(sValue, log_Reports);
                this.Owner_MemoryApplication.MemoryVariables.PutFilepath(
                    sNamevar,
                    new Expression_Node_FilepathImpl(cf_Fpath),
                    false,//重複登録可。
                    log_Reports
                    );
            }

            //
            // Aa_Files.csv ファイル
            //
            if (log_Reports.Successful)
            {
                string sNamevar = NamesVar.S_SP_FILES;
                string sValue = sFopath_Editor + System.IO.Path.DirectorySeparatorChar + NamesFile.S_ENGINE + System.IO.Path.DirectorySeparatorChar + NamesFile.S_AA_FILES_CSV;
                Configurationtree_NodeFilepath cf_Fpath = new Configurationtree_NodeFilepathImpl("L09自動類推", ec_Fopath_Editor.Cur_Configuration);
                cf_Fpath.InitPath(sValue, log_Reports);
                this.Owner_MemoryApplication.MemoryVariables.PutFilepath(
                    sNamevar,
                    new Expression_Node_FilepathImpl(cf_Fpath),
                    false,//重複登録可。
                    log_Reports
                    );

                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("「エディター設定ファイル」の Dic に S_SP_FILES を登録します。 sValue=[" + sValue + "]");
                }
            }

            goto gt_EndMethod;
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// <f-set-var>読み込み。
        /// </summary>
        /// <param name="oProjectConfigFilePath"></param>
        public void LoadFile(
            Expression_Node_Filepath ec_Fopath_Editor,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(1, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "LoadFile1",log_Reports);
            //
            //

            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole("「エディター設定ファイル」を読み込みます。システム変数の自動類推も行います。");
            }

            // 「エディター・フォルダー」パス
            string sFopath_Editor = ec_Fopath_Editor.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);

            Configurationtree_Node cf_Auto = null;
            if (log_Reports.Successful)
            {
                //
                // 「エディター・フォルダー」から、「Engine」「Forms」「Logs」のフォルダーパスを類推します。
                // これは「エディター設定ファイル」で上書き可能です。日本語フォルダー名に置き換えることもできます。
                //

                cf_Auto = new Configurationtree_NodeImpl("!ハードコーディング自動補完", null);//todo:親ノード
            }

            string sFpatha_AaEditorXml = "";
            if (log_Reports.Successful)
            {
                //
                // @Editor.xml へのファイルパス。
                //
                // 「エディター・フォルダー」パス → 「@Editor.xml ファイルパス」へ変換。
                sFpatha_AaEditorXml = sFopath_Editor + System.IO.Path.DirectorySeparatorChar + NamesFile.S_AA_EDITOR_XML;
            }

            //
            // 変数の読取りを開始します。
            //
            Exception err_Exception;
            if (log_Reports.Successful)
            {
                XmlDocument xDoc = new XmlDocument();

                try
                {

                    // 正常時

                    xDoc.Load(sFpatha_AaEditorXml);

                    // ルート要素を取得
                    XmlElement xRoot = xDoc.DocumentElement;

                    // スクリプトファイルのバージョンチェック。(エディター設定ファイル)
                    ValuesAttr.Test_Codefileversion(
                        xRoot.GetAttribute(PmNames.S_CODEFILE_VERSION.Name_Attribute),
                        log_Reports,
                        new Configurationtree_NodeImpl(sFpatha_AaEditorXml, null),
                        NamesNode.S_CODEFILE_EDITOR
                        );

                    //<f-set-var>要素を列挙
                    System.Xml.XmlNodeList xNl_Fsetvar = xRoot.GetElementsByTagName(NamesNode.S_F_SET_VAR);

                    for (int nIndex_Fsetvar = 0; nIndex_Fsetvar < xNl_Fsetvar.Count; nIndex_Fsetvar++)
                    {
                        XmlNode xNode_Fsetvar = xNl_Fsetvar.Item(nIndex_Fsetvar);

                        if (XmlNodeType.Element == xNode_Fsetvar.NodeType)
                        {
                            // <f-set-var>要素
                            XmlElement x_Fsetvar = (XmlElement)xNode_Fsetvar;
                            Configurationtree_NodeImpl s_Fsetvar = new Configurationtree_NodeImpl(NamesNode.S_F_SET_VAR, null);//todo:親ノード

                            string sNamevar = x_Fsetvar.GetAttribute(PmNames.S_NAME_VAR.Name_Attribute);
                            string sFolder = x_Fsetvar.GetAttribute(PmNames.S_FOLDER.Name_Attribute);
                            string sValue = x_Fsetvar.GetAttribute(PmNames.S_VALUE.Name_Attribute);
                            string sDescription = x_Fsetvar.GetAttribute(PmNames.S_DESCRIPTION.Name_Attribute);

                            s_Fsetvar.Dictionary_Attribute.Set(PmNames.S_NAME_VAR.Name_Pm, sNamevar, log_Reports);
                            s_Fsetvar.Dictionary_Attribute.Set(PmNames.S_FOLDER.Name_Pm, sFolder, log_Reports);
                            s_Fsetvar.Dictionary_Attribute.Set(PmNames.S_VALUE.Name_Pm, sValue, log_Reports);
                            s_Fsetvar.Dictionary_Attribute.Set(PmNames.S_DESCRIPTION.Name_Pm, sDescription, log_Reports);

                            this.MemoryAaeditorxml_Editor.Dictionary_Fsetvar_Configurationtree.List_Child.Add(s_Fsetvar, log_Reports);
                        }
                    }

                }
                catch (System.IO.DirectoryNotFoundException ex)
                {
                    // エラー
                    err_Exception = ex;
                    goto gt_Error_DirectoryNotFound;
                }
                catch (System.Exception ex)
                {
                    // エラー
                    err_Exception = ex;
                    goto gt_Error_Exception;
                }

                //
                // 変数の読取りは終わった。
                //
            }

            //
            // @Editor.xml へのファイルパス。
            //
            if (log_Reports.Successful)
            {
                // 「エディター・フォルダー」パス → 「@Editor.xml ファイルパス」へ変換。
                string sFpath_EditorXml = sFopath_Editor + System.IO.Path.DirectorySeparatorChar + NamesFile.S_AA_EDITOR_XML;

                this.cur_Configurationtree = new Configurationtree_NodeImpl("(L09Mid読取)", ec_Fopath_Editor.Cur_Configuration);
            }

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

                StringBuilder s = new StringBuilder();
                s.Append("指定されたファイルパスを読み取れませんでした。");
                s.Append(Environment.NewLine);
                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(err_Exception.Message);

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

                StringBuilder s = new StringBuilder();
                s.Append("『エディター設定ファイル』読み取り中に、何らかのエラーが発生しました。");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                s.Append("もしかして?: XMLのencoding指定が間違っている?この読取プログラムの期待するエンコードでないかも?");
                s.Append(Environment.NewLine);
                s.Append("もしかして?: それ以外の理由?");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                //
                // ヒント
                s.Append(err_Exception.Message);

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return;
        }
Ejemplo n.º 15
0
        //────────────────────────────────────────
        /// <summary>
        /// クリアー
        /// </summary>
        public void Clear(MemoryApplication owner_MemoryApplication)
        {
            Log_Method log_Method = new Log_MethodImpl(1, Log_ReportsImpl.BDebugmode_Static);
            Log_Reports log_Reports_ThisMethod = new Log_ReportsImpl(log_Method);
            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "Clear", log_Reports_ThisMethod);
            //

            this.owner_MemoryApplication = owner_MemoryApplication;

            this.cur_Configurationtree = new Configurationtree_NodeImpl("<clear>", null);
            if (null == this.memoryAaeditorxml_Editor)
            {
                this.memoryAaeditorxml_Editor = new MemoryAaeditorxml_EditorImpl(null);
            }
            else
            {
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("「エディター設定ファイル・モデル」をクリアーします。");
                }

                this.memoryAaeditorxml_Editor.Clear();
            }

            goto gt_EndMethod;
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports_ThisMethod);
            log_Reports_ThisMethod.EndLogging(log_Method);
        }
Ejemplo n.º 16
0
        //────────────────────────────────────────
        /// <summary>
        /// 静的関数。
        /// 
        /// 関数を登録します。
        /// </summary>
        public static void RegisterFunctions(Log_Reports pg_Logging)
        {
            Log_Method pg_Method = new Log_MethodImpl(0);
            pg_Method.BeginMethod(Info_CSVEditorImpl.Name_Library, "Form1", "static RegisterFunctions",pg_Logging);
            //

            ConfigurationtreeToFunction_Item transUnknown = new ConfigurationtreeToFunction00_ItemImpl();//暫定

            // 親クラスを上書きしないよう、関数名は変えておくこと。
            {
                List<string> sList = new List<string>();
                // arg 不明
                Collection_Function.SetFunction(Expression_Node_Function_BootCsvEditorExImpl.NAME_FUNCTION, new Expression_Node_Function_BootCsvEditorExImpl(EnumEventhandler.O_Ea, sList, transUnknown), pg_Logging);
            }
            pg_Method.WriteDebug_ToConsole("CSVエディター用のブート関数を登録。");

            //
            pg_Method.EndMethod(pg_Logging);
        }
Ejemplo n.º 17
0
        //────────────────────────────────────────
        /// <summary>
        /// 値を算出します。
        /// </summary>
        /// <returns></returns>
        public override string Execute5_Main(
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_Expr.Name_Library, this, "Execute5_Main", log_Reports);
            //
            //
            StringBuilder sb_Result = new StringBuilder();

            //
            //
            //
            // 子
            //
            //
            //
            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole(" ┌────┐ 子要素数=[" + this.List_Expression_Child.Count + "]");
            }

            List<Expression_Node_String> ecList_Child = this.List_Expression_Child.SelectList(EnumHitcount.Unconstraint, log_Reports);
            foreach (Expression_Node_String ec_Child in ecList_Child)
            {

                //
                // 子ノード名、子ファンク名
                //
                string sChildNodeName = ec_Child.Cur_Configuration.Name;

                string sChildFncName = "";
                {
                    EnumHitcount hits;
                    if (
                        NamesNode.S_ARG == sChildNodeName ||
                        NamesNode.S_FNC == sChildNodeName
                        )
                    {
                        // <arg >の場合。
                        // <fnc >の場合。
                        hits = EnumHitcount.One;
                    }
                    else
                    {
                        hits = EnumHitcount.One_Or_Zero;
                    }
                    bool bHit = ec_Child.TrySelectAttribute(out sChildFncName, PmNames.S_NAME.Name_Pm, hits, log_Reports);
                }

                //
                //

                if (
                    // 子「S■arg name=”case”」
                    NamesNode.S_ARG == sChildNodeName &&
                    PmNames.S_VALUE_CASE.Name_Pm == sChildFncName)
                {
                    // Sf:case;要素の子<arg>は無視します。

                }
                else
                {
                    string sValue = ec_Child.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                    if (log_Method.CanDebug(1))
                    {
                        log_Method.WriteDebug_ToConsole(" ・子[" + sChildNodeName + "] name=”[" + sChildFncName + "]” 属性数=[" + ec_Child.Dictionary_Expression_Attribute.Count + "] 値=”[" + sValue + "]”");
                    }
                    sb_Result.Append(sValue);
                }

            }

            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole( " └────┘");
            }

            //
            //
            //
            //

            log_Method.EndMethod(log_Reports);
            return sb_Result.ToString();
        }
        //────────────────────────────────────────
        protected void Execute6_Sub(
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(1, 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();
            }

            //
            // 変数は、登録されている名前の変数は存在し、登録されていない名前の変数は(自動作成されたもの以外は)存在しない。
            //
            // 元となるテーブルを見ながら、変数オブジェクトの内容を調べていく。
            //
            //

            Configurationtree_Node cur_Cf = new Configurationtree_NodeImpl(log_Method.Fullname, null);

            // 変数ログを吐く。
            {
                StringBuilder sb = new StringBuilder();

                //1行目
                sb.Append(NamesFld.S_NO);
                sb.Append(",");
                sb.Append(NamesFld.S_ID);
                sb.Append(",");
                sb.Append(NamesFld.S_EXPL);
                sb.Append(",");
                sb.Append(NamesFld.S_NAME);
                sb.Append(",");
                sb.Append(NamesFld.S_FOLDER);
                sb.Append(",");
                sb.Append(NamesFld.S_VALUE);
                sb.Append(",");
                sb.Append(NamesFld.S_END);
                sb.Append(Environment.NewLine);

                //2行目
                sb.Append(NamesTypedb.S_INT);//NO
                sb.Append(",");
                sb.Append(NamesTypedb.S_INT);//ID
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//Expl
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//NAME
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//FOLDER
                sb.Append(",");
                sb.Append(NamesTypedb.S_STRING);//VALUE
                sb.Append(",");
                sb.Append(NamesFld.S_END);//END
                sb.Append(Environment.NewLine);

                //3行目
                sb.Append("-1,");//NO
                sb.Append("使わない,");//ID
                sb.Append("解説,");//Expl
                sb.Append("変数名,");//NAME
                sb.Append("(ファイルパス変数のみ指定有効)フォルダーパス,");//FOLDER
                sb.Append("初期値,");//VALUE
                sb.Append(NamesFld.S_END);//END
                sb.Append(Environment.NewLine);

                int nAuto = 0;
                this.Owner_MemoryApplication.MemoryVariables.EachVariable(delegate(string sKey, Expression_Node_String ec_String, ref bool bBreak)
                {
                    if (log_Method.CanDebug(1))
                    {
                        log_Method.WriteDebug_ToConsole("[" + sKey + "]=[" + ec_String.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]");
                    }

                    sb.Append(nAuto);//NO
                    sb.Append(",");
                    //ID 使わない
                    sb.Append(",");
                    //Expl 消えてしまう
                    sb.Append(",");
                    sb.Append(sKey);//NAME
                    sb.Append(",");
                    //FOLDER TODO:逆算が必要
                    sb.Append(",");
                    sb.Append(ec_String.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));//VALUE
                    sb.Append(",");
                    sb.Append(NamesFld.S_END);//END
                    sb.Append(Environment.NewLine);

                    nAuto++;
                });

                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole(sb.ToString());
                }

                //ログ出力
                {
                    Expression_Node_Filepath ec_Fpath_Logs = this.Owner_MemoryApplication.MemoryVariables.GetExpressionfilepathByVariablename(new Expression_Leaf_StringImpl(NamesVar.S_SP_LOGS, null, cur_Cf), true, log_Reports);

                    string sFpatha_LogVariables = ec_Fpath_Logs.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + System.IO.Path.DirectorySeparatorChar + NamesFile.S_LOG_VARIABLES;

                    if (log_Reports.Successful)
                    {
                        CsvWriterImpl writer = new CsvWriterImpl();
                        writer.Write(
                            sb.ToString(),
                            sFpatha_LogVariables,
                            true
                            );
                    }
                }
            }

            //変数CSVを吐き出したい。(登録されている順序を保って)
            {
                // 変数ファイルの読取り
                Table_Humaninput o_Table_Variables;
                this.Owner_MemoryApplication.MemoryVariables.TryGetTable_Variables(
                    out o_Table_Variables,
                    Application.StartupPath,
                    log_Reports
                    );

                if (null != o_Table_Variables)
                {
                    StringBuilder sb = new StringBuilder();

                    //1行目
                    sb.Append(NamesFld.S_NO);
                    sb.Append(",");
                    sb.Append(NamesFld.S_ID);
                    sb.Append(",");
                    sb.Append(NamesFld.S_EXPL);
                    sb.Append(",");
                    sb.Append(NamesFld.S_NAME);
                    sb.Append(",");
                    sb.Append(NamesFld.S_FOLDER);
                    sb.Append(",");
                    sb.Append(NamesFld.S_VALUE);
                    sb.Append(",");
                    sb.Append(NamesFld.S_END);
                    sb.Append(Environment.NewLine);

                    //2行目
                    sb.Append(NamesTypedb.S_INT);//NO
                    sb.Append(",");
                    sb.Append(NamesTypedb.S_INT);//ID
                    sb.Append(",");
                    sb.Append(NamesTypedb.S_STRING);//Expl
                    sb.Append(",");
                    sb.Append(NamesTypedb.S_STRING);//NAME
                    sb.Append(",");
                    sb.Append(NamesTypedb.S_STRING);//FOLDER
                    sb.Append(",");
                    sb.Append(NamesTypedb.S_STRING);//VALUE
                    sb.Append(",");
                    sb.Append(NamesFld.S_END);//END
                    sb.Append(Environment.NewLine);

                    //3行目
                    sb.Append("-1,");//NO
                    sb.Append("使わない,");//ID
                    sb.Append("解説,");//Expl
                    sb.Append("変数名,");//NAME
                    sb.Append("(ファイルパス変数のみ指定有効)フォルダーパス,");//FOLDER
                    sb.Append("初期値,");//VALUE
                    sb.Append(NamesFld.S_END);//END
                    sb.Append(Environment.NewLine);

                    int nAuto = 0;
                    foreach (DataRow row in o_Table_Variables.DataTable.Rows)
                    {

                        if (o_Table_Variables.DataTable.Columns.Contains(NamesFld.S_NO))
                        {
                            int nValue;
                            Int_HumaninputImpl.TryParse(row[NamesFld.S_NO], out nValue, EnumOperationIfErrorvalue.Spaces_To_Alt_Value, 0, log_Reports);
                            sb.Append(nValue);
                            sb.Append(",");
                        }

                        // IDは空欄が正しいが、int型なので空欄にできないので 0 を入れる。
                        if (o_Table_Variables.DataTable.Columns.Contains(NamesFld.S_ID))
                        {
                            int nValue;
                            Int_HumaninputImpl.TryParse(row[NamesFld.S_ID], out nValue, EnumOperationIfErrorvalue.Spaces_To_Alt_Value, 0, log_Reports);
                            sb.Append(nValue);
                            sb.Append(",");
                        }

                        if (o_Table_Variables.DataTable.Columns.Contains(NamesFld.S_EXPL))
                        {
                            string sValue;
                            String_HumaninputImpl.TryParse(row[NamesFld.S_EXPL], out sValue, "", "", log_Method, log_Reports);
                            sb.Append(sValue);
                            sb.Append(",");
                        }

                        string sName_Var = "";
                        if (o_Table_Variables.DataTable.Columns.Contains(NamesFld.S_NAME))
                        {
                            string sValue;
                            String_HumaninputImpl.TryParse(row[NamesFld.S_NAME], out sValue, "", "", log_Method, log_Reports);
                            sb.Append(sValue);
                            sb.Append(",");

                            sName_Var = sValue;
                        }

                        // 現在の変数の内容
                        string sValue_Var = this.Owner_MemoryApplication.MemoryVariables.GetStringByVariablename(new Expression_Leaf_StringImpl(sName_Var, null, cur_Cf), true, log_Reports);

                        //現在の変数の内容を検索
                        if (NamesVar.Test_Filepath(sName_Var))
                        {
                            Expression_Node_Filepath ec_Fpath = this.Owner_MemoryApplication.MemoryVariables.GetExpressionfilepathByVariablename(new Expression_Leaf_StringImpl(sName_Var, null, cur_Cf), true, log_Reports);
                            // 絶対パスとは限らない。フォルダーを指していることもある。
                            string sFpath = ec_Fpath.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);

                            //フォルダー列値を取得。
                            string sNamevar_Folder_Src;
                            if (o_Table_Variables.DataTable.Columns.Contains(NamesFld.S_FOLDER))
                            {
                                String_HumaninputImpl.TryParse(row[NamesFld.S_FOLDER], out sNamevar_Folder_Src, "", "", log_Method, log_Reports);

                                //フォルダーパス
                                Expression_Node_Filepath ec_Folder = this.Owner_MemoryApplication.MemoryVariables.GetExpressionfilepathByVariablename(new Expression_Leaf_StringImpl(sNamevar_Folder_Src,null,cur_Cf), false, log_Reports);
                                if (null != ec_Folder)
                                {
                                    // FOLDER列に入力があれば。

                                    string sFpath_Folder = ec_Folder.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                                    if (sValue_Var.StartsWith(sFpath_Folder))
                                    {
                                        // FOLDER列値をそのままキープ。
                                        sb.Append(sNamevar_Folder_Src);

                                        // 値のフォルダー部分を削る。
                                        sValue_Var = sValue_Var.Substring(sFpath_Folder.Length);

                                        // 先頭が ディレクトリー区切り文字なら削る。
                                        if (sValue_Var.StartsWith(System.IO.Path.DirectorySeparatorChar.ToString()))
                                        {
                                            sValue_Var = sValue_Var.Substring(System.IO.Path.DirectorySeparatorChar.ToString().Length);
                                        }
                                    }
                                    else
                                    {
                                        // FOLDER列値はそのまま使えない。
                                    }
                                }

                                sb.Append(",");
                            }

                            if (o_Table_Variables.DataTable.Columns.Contains(NamesFld.S_VALUE))
                            {
                                //string sValue;
                                //String_HumaninputImpl.TryParse(row[NamesFld.S_VALUE], out sValue, "", "", log_Method, log_Reports);
                                //sb.Append(sValue);
                                //sb.Append(",");

                                // 現在の変数の値(の削った残り)を入れる。
                                sb.Append(sValue_Var);
                                sb.Append(",");
                            }
                        }
                        else// if (NamesVar.Test_String(sName_Var))
                        {

                            // FOLDER列値は無し。
                            sb.Append(",");

                            if (o_Table_Variables.DataTable.Columns.Contains(NamesFld.S_VALUE))
                            {
                                // 現在の変数の値を入れる。
                                sb.Append(sValue_Var);
                                sb.Append(",");
                            }
                        }

                        sb.Append(NamesFld.S_END);
                        sb.Append(Environment.NewLine);

                        nAuto++;
                    }

                    //ファイル書出し
                    {
                        Expression_Node_Filepath ec_Fpath_Logs = this.Owner_MemoryApplication.MemoryVariables.GetExpressionfilepathByVariablename(new Expression_Leaf_StringImpl(NamesVar.S_SP_LOGS, null, cur_Cf), true, log_Reports);

                        string sFpatha_LogVariables = ec_Fpath_Logs.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + System.IO.Path.DirectorySeparatorChar + NamesFile.S_SAVE_VARIABLES;

                        if (log_Reports.Successful)
                        {
                            CsvWriterImpl writer = new CsvWriterImpl();
                            writer.Write(
                                sb.ToString(),
                                sFpatha_LogVariables,
                                true
                                );
                        }
                    }
                }
            }

            //
            // メッセージボックスの表示。
            {
                StringBuilder sb = new StringBuilder();
                sb.Append(this.GetType().Name);
                sb.Append("#Execute6_Sub:");
                sb.Append(Environment.NewLine);
                string sArgMessage;
                this.TrySelectAttribute(out sArgMessage, Expression_Node_Function45Impl.PM_MESSAGE, EnumHitcount.One_Or_Zero, log_Reports);

                sb.Append(sArgMessage);

                MessageBox.Show(sb.ToString(), "変数をCSVファイルに書き出したい。");
            }

            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <summary>
        /// <arg1>
        /// </summary>
        /// <param name="oFStrNode"></param>
        /// <param name="nFAelem"></param>
        /// <param name="moOpyopyo"></param>
        /// <param name="log_Reports"></param>
        public override void Translate(
            Configurationtree_Node cur_Cf,//「S■arg1」
            Expression_Node_String parent_Ec,//親「E■fnc」
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            //
            // デバッグオープンの前に。
            //
            // 「S■arg1 name=”★”」属性
            //
            string sName_MyFnc;
            cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_MyFnc, false, log_Reports);

            if (log_Method.CanDebug(1))
            {
                Dictionary<string, string> s_Dic = new Dictionary<string, string>();
                s_Dic.Add(PmNames.S_NAME.Name_Pm, sName_MyFnc);
                pg_ParsingLog.Increment("(6.arg1・3要素)" + cur_Cf.Name, s_Dic);
            }

            //
            //

            if (log_Method.CanDebug(2))
            {
                log_Method.WriteDebug_ToConsole("「S■arg1・3」要素 解析開始┌────────────────┐ 自arg1・3は、e_Parent=[" + parent_Ec.Cur_Configuration.Name + "]の”" + sName_MyFnc + "”属性になる。");
            }

            string parent_SName_Fnc;
            {
                // ヒット必須にするとエラーになる?
                parent_Ec.TrySelectAttribute(out parent_SName_Fnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);
                if (!log_Reports.Successful)
                {
                    goto gt_EndMethod;
                }

                //if (0 < d_InMethod.NDebugLevel)
                //{
                //    if (NamesNode.S_FNC != e_Parent.Cur_Configurationtree.Name)
                //    {
                //        d_InMethod.WriteDebug_ToConsole(1, "fnc以外の親要素「E■[" + e_Parent.Cur_Configurationtree.Name + "]」");
                //    }
                //}
            }

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_String cur_Ec = new Expression_Node_StringImpl(parent_Ec, cur_Cf);

            //
            //
            //
            // 属性
            //
            //
            //
            if (log_Reports.Successful)
            {
                // 元からあった。
                this.ParseAttr_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    true,//name属性は必須。
                    true,//value属性は、子<f-str>にする。
                    log_Reports
                    );
            }

            //
            //
            //
            // 子
            //
            //
            //
            if (log_Reports.Successful)
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            //
            //
            //
            // 親へ連結 ※属性連結。
            //
            //
            //
            if (log_Reports.Successful)
            {
                parent_Ec.SetAttribute(sName_MyFnc, cur_Ec, log_Reports);
            }

            goto gt_EndMethod;
            //
            //
            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }

            if (log_Method.CanDebug(2))
            {
                log_Method.WriteDebug_ToConsole( "「S■arg1・3」要素 解析終了└────────────────┘");
            }

            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public override void Translate(
            Configurationtree_Node cur_Cf,//<lookup-id>
            Expression_Node_String parent_Ec,//< Sf:text-template;>
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(9)" + cur_Cf.Name);
            }

            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_String cur_Ec = new Expression_Node_StringImpl(parent_Ec, cur_Cf);

            //
            //
            //
            // 親へ連結 (value属性)
            //
            //
            //
            {
                //
                // 自要素の value="" 属性を、親へ連結
                //
                PmName pmName = PmNames.S_VALUE;

                string sValue;
                bool bHit = cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, false, log_Reports);
                if (bHit)
                {

                    cur_Ec.AppendTextNode(
                        sValue,
                        cur_Cf,
                        log_Reports
                        );

                    //
                    //
                    //
                    // 子
                    //
                    //
                    //
                    this.ParseChild_InConfigurationtreeToExpression(
                        cur_Cf,
                        cur_Ec,//自
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );

                    //
                    //
                    //
                    // 親へ連結 ※属性連結
                    //
                    //
                    //
                    parent_Ec.SetAttribute(PmNames.S_LOOKUP_ID.Name_Pm, cur_Ec, log_Reports);

                    goto gt_EndMethod;
                }
                else
                {
                }

            }

            //
            //
            //
            // 子
            //
            //
            //
            {
                //<a-default>の子要素を確認し、親<f-switch>のdefault属性に追加します。

                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            //
            //
            //
            // 親へ連結
            //
            //
            //
            parent_Ec.SetAttribute(PmNames.S_LOOKUP_ID.Name_Pm, cur_Ec, log_Reports);

            //
            //
            //
            // 親へ連結 debug
            //
            //
            //
            if (log_Method.CanDebug(1))
            {
                string parent_SName_Fnc;
                parent_Ec.TrySelectAttribute(out parent_SName_Fnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);
                log_Method.WriteDebug_ToConsole(" ☆☆☆☆☆☆☆☆ 親<[" + parent_Ec.Cur_Configuration.Name + "] name=”[" + parent_SName_Fnc + "]” >");

                string sName_MyFnc;
                cur_Ec.TrySelectAttribute(out sName_MyFnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);
                log_Method.WriteDebug_ToConsole(" ☆☆☆☆☆☆☆☆ 自<[" + cur_Ec.Cur_Configuration.Name + "] name=”[" + sName_MyFnc + "]” >");
            }

            goto gt_EndMethod;
            //
            //
            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <summary>
        /// 親要素に、この要素を追加。
        /// </summary>
        protected override void LinkToParent(
            Configurationtree_Node cur_Cf, Configurationtree_Node parent_Cf, MemoryApplication memoryApplication, Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "LinkToParent",log_Reports);

            //
            // name属性は必須。
            //
            string sName_Fnc;
            cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Fnc, true, log_Reports);
            if (!log_Reports.Successful)
            {
                goto gt_EndMethod;
                //goto gt_Error_UndefinedFncNameAttr;
            }

            string parent_SName_Fnc;
            {
                //
                // ※注意 <data >も、<fnc >扱い。name属性を持っていない。
                //
                bool bRequired = false;
                parent_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out parent_SName_Fnc, bRequired, log_Reports);

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

            if (NamesFnc.S_WHERE == sName_Fnc)
            {
                //
                //
                //
                // 親へ連結。
                //
                //
                //
                parent_Cf.List_Child.Add(
                    cur_Cf,
                    log_Reports
                    );

                // デバッグ出力
                if (log_Method.CanDebug(1))
                {
                    Log_TextIndented s = new Log_TextIndentedImpl();
                    parent_Cf.ToText_Locationbreadcrumbs(s);
                    //log_Method.WriteDebug_ToConsole( "<fnc name=”[" + sFncName + "]”>要素 親要素「S■[" + s_Parent.Name_Node + "]」の子リストに、自分を追加。 子要素の数は[" + s_Cur.CountChildNodes + "]でした。");
                    log_Method.WriteDebug_ToConsole("<fnc name=”[" + sName_Fnc + "]”>要素 親要素「S■[" + parent_Cf.Name + "]」の『属性[" + cur_Cf.Name + "]』に、自分「S■[" + cur_Cf.Name + "]」を追加。 子要素の数は[" + cur_Cf.List_Child.Count + "]でした。 Place=[" + s.ToString() + "]");
                }

            }
            else if (NamesFnc.S_CASE == sName_Fnc)
            {
                //
                // 親要素は Sf:switch; である必要があります。
                //
                if (NamesFnc.S_SWITCH != parent_SName_Fnc)
                {
                    if (log_Reports.CanCreateReport)
                    {
                        Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                        r.SetTitle("▲エラー308!", log_Method);

                        Log_TextIndented s = new Log_TextIndentedImpl();

                        s.Append("Sf:case;系要素の親は f-switch を期待します。");
                        s.Newline();
                        s.Newline();

                        s.Append("親ノード名=[");
                        s.Append(parent_Cf.Name);
                        s.Append("]");
                        s.Newline();
                        s.Newline();

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

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

                    goto gt_EndMethod;
                }

                // 要素の(OAelemListではなく)OAcaseListに、この Sf:case; 要素を追加。

                //
                //
                //
                // 親へ連結。
                //
                //
                //
                parent_Cf.List_Child.Add(
                    cur_Cf,
                    log_Reports
                    );

            }
            else if (
                NamesFnc.S_ITEM_LABEL2 == sName_Fnc
                )
            {
                //
                //
                //
                // 親へ連結。
                //
                //
                //
                parent_Cf.List_Child.Add(
                    cur_Cf,
                    log_Reports
                    );
            }
            else if (
                NamesFnc.S_ITEM_VALUE == sName_Fnc
                )
            {
                //
                //
                //
                // 親へ連結。
                //
                //
                //
                parent_Cf.List_Child.Add(
                    cur_Cf,
                    log_Reports
                    );
            }
            else if (
                NamesFnc.S_ITEM_GRAY_OUT == sName_Fnc
                )
            {
                //
                //
                //
                // 親へ連結。
                //
                //
                //
                parent_Cf.List_Child.Add(
                    cur_Cf,
                    log_Reports
                    );
            }
            else if (
                NamesFnc.S_RECORD_SET_SAVE_TO2 == sName_Fnc
                )
            {
                //
                // 暫定で、親要素は<f-all-true>である必要があります。
                //
                if (NamesFnc.S_ALL_TRUE != parent_SName_Fnc)
                {
                    if (log_Reports.CanCreateReport)
                    {
                        Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                        r.SetTitle("▲エラー404!", log_Method);

                        Log_TextIndented s = new Log_TextIndentedImpl();

                        s.Append("<a-empty-field>系要素の親は <f-all-true> であることを期待します。");
                        s.Newline();
                        s.Newline();

                        s.Append("oFnode.NodeName=[");
                        s.Append(parent_Cf.Name);
                        s.Append("]");
                        s.Newline();
                        s.Newline();

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

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

                    goto gt_EndMethod;
                }

                if (!(NamesFnc.S_ALL_TRUE == parent_SName_Fnc))
                {
                    if (log_Reports.CanCreateReport)
                    {
                        Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                        r.SetTitle("▲エラー403!", log_Method);

                        Log_TextIndented s = new Log_TextIndentedImpl();

                        s.Append("内部プログラムのミス。");
                        s.Newline();
                        s.Append("<a-empty-field>系要素の親が、OFAllTrueImplクラスでありませんでした。");
                        s.Newline();
                        s.Newline();

                        s.Append("oFnode.NodeName=[");
                        s.Append(parent_Cf.Name);
                        s.Append("]");
                        s.Newline();
                        s.Newline();

                        s.Append("oFnode.GetType().Name=[");
                        s.Append(parent_Cf.GetType().Name);
                        s.Append("]");
                        s.Newline();
                        s.Newline();

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

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

                    goto gt_EndMethod;
                }

                // 親要素の(OAelemListではなく)OArecordSetSaveToListに、この<fnc name=”Sf:a-record-set-save-to;”>要素を追加。

                //
                //
                //
                // 親へ連結。
                //
                //
                //
                parent_Cf.List_Child.Add(
                    cur_Cf,
                    log_Reports
                    );

            }
            else if (
                NamesFnc.S_EMPTY_FIELD == sName_Fnc
                )
            {
                //
                // 親要素は<f-all-true>である必要があります。
                //
                if (NamesFnc.S_ALL_TRUE != parent_SName_Fnc)
                {
                    if (log_Reports.CanCreateReport)
                    {
                        Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                        r.SetTitle("▲エラー405!", log_Method);

                        Log_TextIndented s = new Log_TextIndentedImpl();

                        s.Append("<a-empty-field>系要素の親は <f-all-true> であることを期待します。");
                        s.Newline();
                        s.Newline();

                        s.Append("oFnode.NodeName=[");
                        s.Append(parent_Cf.Name);
                        s.Append("]");
                        s.Newline();
                        s.Newline();

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

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

                    goto gt_EndMethod;
                }

                if (!(NamesFnc.S_ALL_TRUE == parent_SName_Fnc))
                {
                    if (log_Reports.CanCreateReport)
                    {
                        Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                        r.SetTitle("▲エラー406!", log_Method);

                        Log_TextIndented s = new Log_TextIndentedImpl();

                        s.Append("内部プログラムのミス。");
                        s.Newline();
                        s.Append("<a-empty-field>系要素の親が、OFAllTrueImplクラスでありませんでした。");
                        s.Newline();
                        s.Newline();

                        s.Append("oFnode.NodeName=[");
                        s.Append(parent_Cf.Name);
                        s.Append("]");
                        s.Newline();
                        s.Newline();

                        s.Append("oFnode.GetType().Name=[");
                        s.Append(parent_Cf.GetType().Name);
                        s.Append("]");
                        s.Newline();
                        s.Newline();

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

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

                    goto gt_EndMethod;
                }

                //
                // <f-all-true>

                //
                // 親要素の(OAelemListではなく)OAemptyFldListに、この<a-empty-field>要素を追加。

                //
                //
                //
                // 親へ連結。
                //
                //
                //
                parent_Cf.List_Child.Add(
                    cur_Cf,
                    log_Reports
                    );

            }
            else
            {
                // 親要素「S■??」に、この「S■fnc」要素を追加。
                // 同名要素が複数個並ぶので、属性ではなく子要素として追加する。

                //
                //
                //
                // 親へ連結。
                //
                //
                //
                parent_Cf.List_Child.Add(
                    cur_Cf,
                    log_Reports
                    );

                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("<fnc name=”[" + sName_Fnc + "]”>要素 親要素「S■[" + parent_Cf.Name + "]」の子リストに、自分を追加。 子要素の数は[" + cur_Cf.List_Child.Count + "]でした。");
                }
            }

            goto gt_EndMethod;
            //
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <summary>
        /// プロジェクト読取り時の定形アクション実行。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="st_PrevProjectElm_OrNull"></param>
        /// <param name="bProjectValid"></param>
        /// <param name="log_Reports"></param>
        public override string Execute5_Main(Log_Reports log_Reports)
        {
            //()メソッド開始
            Log_Method log_Method = new Log_MethodImpl(1);
            log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute5_Main",log_Reports);

            //
            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole("「プロジェクト選択時」用のイベントハンドラーを実行します。");
            }

            //()タスク_デスクリプション
            {
                string sFncName0;
                this.TrySelectAttribute(out sFncName0, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);
                if (this.Functionparameterset.Sender is Customcontrol)
                {
                    Customcontrol ccFc = (Customcontrol)this.Functionparameterset.Sender;
                    string sName_Usercontrol = ccFc.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                    log_Reports.Comment_EventCreationMe += "/追加:[" + sName_Usercontrol + "]コントロールが、[" + sFncName0 + "]アクションを実行。";
                }
                else
                {
                    log_Reports.Comment_EventCreationMe += "/追加:[" + sFncName0 + "]アクションを実行。";
                }
            }

            Configurationtree_Node conf_ThisMethod = new Configurationtree_NodeImpl(log_Method.Fullname, null);

            if (this.EnumEventhandler == EnumEventhandler.Editor_B_Lr)
            {
                //(4)独自モデルの取得
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(4)独自モデルの取得");
                }
                //
                this.On_P04_ReadNewModel(log_Reports);

                //(5)エディター名。ツール設定ファイルに記載されている方。
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(5)エディター名。ツール設定ファイルに記載されている方。");
                }

                // 表示用の名称。
                string sName_SelectingEditor;
                if (this.Functionparameterset.SelectedProjectElement_Configurationtree == null)
                {
                    //
                    // 切り替えるプロジェクトが判明していない場合は、空文字列。
                    //
                    sName_SelectingEditor = "";
                }
                else
                {
                    //
                    // todo: エディター設定ファイルの方のエディター名を入れても意味ないのでは?
                    //
                    sName_SelectingEditor = ((MemoryAatoolxml_Editor)this.Functionparameterset.SelectedProjectElement_Configurationtree).Name;
                }

                //(6)まず、きれいさっぱり プロジェクトをクリアーします。(切替用)
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(6)まず、きれいさっぱり プロジェクトをクリアーします。(切替用)");
                }
                // todo:イベントハンドラーを外してから、フォームを外すこと。リストボックスが誤挙動を起こしている。
                this.On_P06_ClearProject(this.Functionparameterset.Sender, log_Reports);

                //(7)「Aa_Editor.xml」読取。
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(7)「Aa_Editor.xml」読取。");
                }
                //
                if (!this.Functionparameterset.IsProjectValid || this.Functionparameterset.SelectedProjectElement_Configurationtree == null)
                {
                    MemoryAatoolxml_Editor moAatoolxml_PrevEditorElm_OrNull = null;

                    //
                    //
                    //
                    // デフォルト・プロジェクト名が指定されていない場合、
                    // ツール設定ファイルの最初に記述されているプロジェクトを選択します。
                    //
                    //
                    //
                    if (log_Reports.Successful)
                    {
                        if ("" == sName_SelectingEditor)
                        {
                            //
                            // デフォルト・エディター名が未指定の場合。
                            //
                            MemoryAatoolxml_Editor moAatoolxml_DefaultEditor = this.Owner_MemoryApplication.MemoryAatoolxml.GetDefaultEditor(true, log_Reports);
                            if (!log_Reports.Successful)
                            {
                                // 既エラー。
                                goto gt_EndMethod;
                            }

                            // ↓これ要る?
                            sName_SelectingEditor = moAatoolxml_DefaultEditor.Name;
                        }
                    }

                    this.On_P07_SelectDefaultProject(ref sName_SelectingEditor, ref moAatoolxml_PrevEditorElm_OrNull, this.Functionparameterset.IsProjectValid, log_Reports);

                    this.Functionparameterset.SelectedProjectElement_Configurationtree = moAatoolxml_PrevEditorElm_OrNull;

                    //
                    //
                    //
                    //「プロジェクトを開いた時の初期化」イベントハンドラーで使うために、ここで設定します。
                    //
                    //
                    //
                    this.Functionparameterset.SelectedProjectElement_Configurationtree = this.Owner_MemoryApplication.MemoryAatoolxml.GetEditorByName(sName_SelectingEditor, true, log_Reports);
                    if (!log_Reports.Successful)
                    {
                        // 既エラー。
                        goto gt_EndMethod;
                    }
                }

                // ↓追加
                if (null == this.Functionparameterset.SelectedProjectElement_Configurationtree)
                {
                    {
                        Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                        tmpl.SetParameter(1, sName_SelectingEditor, log_Reports);//エディター名

                        this.Owner_MemoryApplication.CreateErrorReport("Er:110003;", tmpl, log_Reports);
                    }
                }
                // ↑追加

                //(13a)エディター・フォルダー。
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(13a)エディター・フォルダーパス類推。");
                }
                //
                //
                //
                Expression_Node_Filepath ec_Fopath_Editor;
                if (log_Reports.Successful)
                {
                    MemoryAatoolxml_Editor moAatoolxml_SelectedEditor = (MemoryAatoolxml_Editor)this.Functionparameterset.SelectedProjectElement_Configurationtree;
                    ec_Fopath_Editor = moAatoolxml_SelectedEditor.GetFilepathByFsetvarname(
                        NamesVar.S_SP_EDITOR,
                        this.Owner_MemoryApplication.MemoryVariables,
                        true,
                        log_Reports
                        );
                }
                else
                {
                    ec_Fopath_Editor = null;
                }

                //(13b)「Aa_Editor.xml」読取。
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(13b)「Aa_Editor.xml」ファイルパス類推。");
                }
                //
                Expression_Node_Filepath ec_Fpath_AaEditorXml;
                if (log_Reports.Successful)
                {

                    //
                    // ツール設定ファイルで指定された値から、自動類推で設定されているはず。
                    //
                    Configurationtree_NodeFilepath cf_Fpath_EditorXml = new Configurationtree_NodeFilepathImpl(
                        "ツール設定ファイル[" + Application.StartupPath + System.IO.Path.DirectorySeparatorChar + ValuesAttr.S_FPATHR_AATOOLXML + "]の中の[" + sName_SelectingEditor + "]エディターへの指定から自動類推",
                        null);

                    // フォルダーパス + \Aa_Editor.xml
                    string sFpatha_Aaeditorxml = ec_Fopath_Editor.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + System.IO.Path.DirectorySeparatorChar + NamesFile.S_AA_EDITOR_XML;

                    // プロジェクト起動時に。
                    cf_Fpath_EditorXml.InitPath(
                        sFpatha_Aaeditorxml,
                        log_Reports
                        );
                    ec_Fpath_AaEditorXml = new Expression_Node_FilepathImpl(cf_Fpath_EditorXml);
                }
                else
                {
                    ec_Fpath_AaEditorXml = null;
                }

                //(8)「エディター設定ファイル」に記述されている<f-set-var>要素を、「エディター設定ファイル・モデル」に格納。Cf→M
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(8)「エディター設定ファイル」に記述されている<f-set-var>要素を、「エディター設定ファイル・モデル」に格納。Cf→M。この時点で「Sp:Engine;」といったシステム変数は自動類推が終わっている必要があります。");
                }
                //
                MemoryAaeditorxml_Editor moAaeditorxml_Editor = null;
                if (log_Reports.Successful)
                {
                    this.On_P08_SpToVar_(
                        out moAaeditorxml_Editor,
                        ec_Fpath_AaEditorXml,
                        ec_Fopath_Editor,
                        (MemoryAatoolxml_Editor)this.Functionparameterset.SelectedProjectElement_Configurationtree,
                        log_Reports
                        );
                }

                //
                //
                //
                // ここで「Aa_Files.csv」を読み込みたい。
                //
                //
                //

                if (log_Reports.Successful)
                {
                    //(9)変数ファイル読取
                    if (log_Method.CanDebug(1))
                    {
                        log_Method.WriteDebug_ToConsole("(9)変数ファイル読取");
                    }
                    //
                    this.Owner_MemoryApplication.MemoryVariables.LoadVariables(
                        Application.StartupPath,
                        log_Reports
                        );
                }

                if (log_Reports.Successful)
                {
                    //(10)プログラマー用・デバッグモードのON/OFF。
                    if (log_Method.CanDebug(1))
                    {
                        log_Method.WriteDebug_ToConsole("(10)プログラマー用・デバッグモードのON/OFF。");
                    }
                    //
                    //mainWndの作成より先に設定する必要がある。ステータスバーを出す、出さないについて。
                    {
                        Expression_Leaf_StringImpl ec_Varname = new Expression_Leaf_StringImpl(this, this.Cur_Configuration.Parent);
                        ec_Varname.SetString(NamesVar.S_SS_DEBUGMODE_PROGRAMMER, log_Reports);
                        string sValue = this.Owner_MemoryApplication.MemoryVariables.GetStringByVariablename(ec_Varname, false, log_Reports);
                        if (ValuesAttr.S_ON == sValue)
                        {
                            Log_ReportsImpl.BDebugmode_Static = true;
                        }
                        else if (ValuesAttr.S_OFF == sValue)
                        {
                            Log_ReportsImpl.BDebugmode_Static = false;
                        }
                        else if (ValuesAttr.S_EMPTY == sValue)
                        {
                            // 無視
                        }
                        else
                        {
                            // TODO:エラー
                        }
                    }
                }

                if (log_Reports.Successful)
                {
                    //(11)画面レイアウト・デバッグモードのON/OFF。
                    if (log_Method.CanDebug(1))
                    {
                        log_Method.WriteDebug_ToConsole("(11)フォーム・デバッグモードのON/OFF。");
                    }
                    //
                    Expression_Leaf_StringImpl ec_Varname = new Expression_Leaf_StringImpl(this, this.Cur_Configuration.Parent);
                    ec_Varname.SetString(NamesVar.S_SS_DEBUGMODE_FORM, log_Reports);
                    string sValue = this.Owner_MemoryApplication.MemoryVariables.GetStringByVariablename(ec_Varname, false, log_Reports);
                    if (ValuesAttr.S_ON == sValue)
                    {
                        Log_ReportsImpl.BDebugmode_Form = true;
                    }
                    else if (ValuesAttr.S_OFF == sValue)
                    {
                        Log_ReportsImpl.BDebugmode_Form = false;
                    }
                    else if (ValuesAttr.S_EMPTY == sValue)
                    {
                        // 無視
                    }
                    else
                    {
                        // TODO:エラー
                    }
                }

                //(14)「Aa_Files.csv」読取。
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(14)「Aa_Files.csv」読取。");
                }
                //
                List<Expression_Node_Filepath> ecList_Fpath_BackupRequest;
                {
                    if (log_Reports.Successful)
                    {
                        // 正常時

                        Expression_Node_Function function_Expr = Collection_Function.NewFunction2(
                                Expression_Node_Function22Impl.NAME_FUNCTION, this, this.Cur_Configuration,
                                this.Owner_MemoryApplication, log_Reports);

                        // 実行
                        function_Expr.Execute4_OnLr(this.Functionparameterset.Sender, log_Reports);

                        // 実行後
                        ecList_Fpath_BackupRequest = ((Expression_Node_Function22Impl)function_Expr).List_Expression_Filepath_BackupRequest_Out;
                    }
                    else
                    {
                        //
                        // エラー
                        //

                        ecList_Fpath_BackupRequest = null;
                    }
                }

                //(14b)ユーザー定義関数設定ファイル読取【2012-03-30追加】
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(14b)ユーザー定義関数設定ファイル読取【2012-03-30追加】");
                }
                //
                if (log_Reports.Successful)
                {
                    // タイプデータ値。
                    Expression_Leaf_StringImpl ec_NameVariable = new Expression_Leaf_StringImpl(this, new Configurationtree_NodeImpl("!ハードコーディング",null));
                    ec_NameVariable.SetString(ValuesTypeData.S_CODE_FUNCTIONS, log_Reports);

                    List<MemoryCodefileinfo> listInfo = null;
                    if (log_Reports.Successful)
                    {
                        listInfo = this.Owner_MemoryApplication.MemoryCodefiles.GetCodefileinfoByTypedata(ec_NameVariable, true, log_Reports);
                    }

                    if (log_Reports.Successful)
                    {
                        foreach (MemoryCodefileinfo scriptfile in listInfo)
                        {
                            if (log_Reports.Successful)
                            {
                                this.Owner_MemoryApplication.MemoryFunctions.LoadFile(
                                    scriptfile.Expression_Filepath,
                                    log_Reports);

                            }
                            else
                            {
                                break;
                            }
                        }
                    }

                }

                //(16)『スタイルシート設定ファイル』読取
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(16)『スタイルシート設定ファイル』読取");
                }
                //
                if (log_Reports.Successful)
                {
                    Expression_Node_Function expr_Func = Collection_Function.NewFunction2(
                        Expression_Node_Function19Impl.NAME_FUNCTION, this, this.Cur_Configuration,
                        this.Owner_MemoryApplication, log_Reports);

                    Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(this, conf_ThisMethod);
                    ec_Str.AppendTextNode(NamesVar.S_ST_STYLESHEET, this.Cur_Configuration, log_Reports);

                    expr_Func.SetAttribute(Expression_Node_Function19Impl.PM_NAME_TABLE_STYLESHEET, ec_Str, log_Reports);

                    expr_Func.Execute4_OnLr(
                        this.Functionparameterset.Sender,
                        log_Reports
                        );
                }

                //(17a)「バックアップを取る」前にしておく独自実装をするタイミング。
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(17a)「バックアップを取る」前にしておく独自実装をするタイミング。");
                }
                //
                this.On_P17a_PreviousBackup(
                    this.Functionparameterset.Sender,
                    moAaeditorxml_Editor,
                    ec_Fpath_AaEditorXml,
                    ec_Fopath_Editor,
                    (MemoryAatoolxml_Editor)this.Functionparameterset.SelectedProjectElement_Configurationtree,
                    log_Reports);

                //(17b)今日の分のバックアップを取ります。
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(17b)今日の分のバックアップを取ります。");
                }
                //
                this.On_P17b_DateBackup(ecList_Fpath_BackupRequest, this.Functionparameterset.Sender, log_Reports);

                //(17c)「新規ウィンドウを開く」前にしておく独自実装をするタイミング。
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(17c)「新規ウィンドウを開く」前にしておく独自実装をするタイミング。");
                }
                //
                this.On_P17c_PreviousOpenWindow(
                    this.Functionparameterset.Sender,
                    moAaeditorxml_Editor,
                    ec_Fpath_AaEditorXml,
                    ec_Fopath_Editor,
                    (MemoryAatoolxml_Editor)this.Functionparameterset.SelectedProjectElement_Configurationtree,
                    log_Reports);

                //(18)関数30「新規ウィンドウを開く」実行。引数には関数を2つ指定できる。
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(18)関数30「新規ウィンドウを開く」実行。引数には関数を2つ指定できる。");
                }
                //
                {

                    Expression_Node_Function expr_Func = Collection_Function.NewFunction2(
                            Expression_Node_Function30Impl.NAME_FUNCTION, this, this.Cur_Configuration,
                            this.Owner_MemoryApplication, log_Reports);

                    {
                        //Expression_Node_Function30Impl f1 =

                        {
                            Expression_Node_StringImpl ec_FormStart;
                            {
                                Expression_FvarImpl ec_Fvar = new Expression_FvarImpl(this, this.Cur_Configuration, this.Owner_MemoryApplication);
                                ec_Fvar.AppendTextNode(NamesVar.S_SS_FORM_START, this.Cur_Configuration, log_Reports);

                                ec_FormStart = new Expression_Node_StringImpl(this, this.Cur_Configuration);
                                ec_FormStart.List_Expression_Child.Add(ec_Fvar, log_Reports);
                            }
                            ((Expression_Node_Function30Impl)expr_Func).SetAttribute(Expression_Node_Function30Impl.PM_NAME_FORM, ec_FormStart, log_Reports);
                        }

                        ((Expression_Node_Function30Impl)expr_Func).In_Subroutine_Function30_1 = this.In_Subroutine_Function30_1_OrNull;
                        ((Expression_Node_Function30Impl)expr_Func).In_Subroutine_Function30_2 = this.In_Subroutine_Function30_2_OrNull;
                        ((Expression_Node_Function30Impl)expr_Func).SetAttribute(
                            Expression_Node_Function30Impl.PM_NAME_TOGETHER,
                            new Expression_Leaf_StringImpl(NamesStg.S_STG_BEGIN_APPLICATION, null, conf_ThisMethod), log_Reports);
                    }

                    expr_Func.Execute4_OnLr(
                        this.Functionparameterset.Sender,
                        log_Reports
                        );
                }

                //(19)最後に
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(19)最後に");
                }
                //
                this.On_P19_AtLast(
                    this.Functionparameterset.Sender,
                    (MemoryAatoolxml_Editor)this.Functionparameterset.SelectedProjectElement_Configurationtree,
                    this.Functionparameterset.IsProjectValid,
                    log_Reports);

                //
                // 「S」と「E」を出力したい。
                if (false)
                {
                    // 「S」全てのコントロールと、ユーザー定義関数について。

                    log_Method.WriteInfo_ToConsole("┌──────────┐「S」全てのコントロールについて。");
                    this.Owner_MemoryApplication.MemoryForms.ForEach_Children(delegate(string sKey, Usercontrol fcUc, ref bool bRemove, ref bool bBreak)
                    {
                        Log_TextIndented s = new Log_TextIndentedImpl();
                        s.Append("[" + sKey + "]");
                        s.Newline();
                        fcUc.ControlCommon.Expression_Control.Cur_Configuration.ToText_Content(s);
                        log_Method.WriteInfo_ToConsole(s.ToString());
                    });
                    log_Method.WriteInfo_ToConsole("└──────────┘");

                    log_Method.WriteInfo_ToConsole("┌──────────┐「S」全てのユーザー定義関数について。");
                    this.Owner_MemoryApplication.MemoryFunctions.ForEach_Children(delegate(string sKey, Expression_Node_Function ec_CommonFunction, ref bool bRemove, ref bool bBreak)
                    {
                        Log_TextIndented s = new Log_TextIndentedImpl();
                        s.Append("[" + sKey + "]");
                        s.Newline();
                        ec_CommonFunction.Cur_Configuration.ToText_Content(s);
                        log_Method.WriteInfo_ToConsole(s.ToString());
                    });
                    log_Method.WriteInfo_ToConsole("└──────────┘");

                    // 「E」全てのコントロールと、ユーザー定義関数について。

                    log_Method.WriteInfo_ToConsole("┌──────────┐「E」全てのコントロールについて。");
                    this.Owner_MemoryApplication.MemoryForms.ForEach_Children(delegate(string sKey, Usercontrol fcUc, ref bool bRemove, ref bool bBreak)
                    {
                        Log_TextIndented s = new Log_TextIndentedImpl();
                        s.Append("[" + sKey + "]");
                        s.Newline();
                        fcUc.ControlCommon.Expression_Control.ToText_Snapshot(s);
                        log_Method.WriteInfo_ToConsole(s.ToString());
                    });
                    log_Method.WriteInfo_ToConsole("└──────────┘");

                    log_Method.WriteInfo_ToConsole("┌──────────┐「E」全てのユーザー定義関数について。");
                    this.Owner_MemoryApplication.MemoryFunctions.ForEach_Children(delegate(string sKey, Expression_Node_Function ec_CommonFunction, ref bool bRemove, ref bool bBreak)
                    {
                        Log_TextIndented s = new Log_TextIndentedImpl();
                        s.Append("[" + sKey + "]");
                        s.Newline();
                        ec_CommonFunction.ToText_Snapshot(s);
                        log_Method.WriteInfo_ToConsole(s.ToString());
                    });
                    log_Method.WriteInfo_ToConsole("└──────────┘");

                }
                log_Method.WriteInfo_ToConsole("◆起動終了");

                goto gt_EndMethod;
            //
            gt_EndMethod:
                log_Method.EndMethod(log_Reports);
            }

            return "";
        }
        //────────────────────────────────────────
        protected override void Parse_SAttribute(
            XmlElement cur_X,
            Configurationtree_Node cur_Cf,
            MemoryApplication memoryApplication,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "Parse_SAttr",log_Reports);
            //
            //

            //
            // name属性は必須。
            //
            string sName_Fnc = cur_X.GetAttribute(PmNames.S_NAME.Name_Attribute);
            if ("" == sName_Fnc)
            {
                goto gt_Error_UndefinedFncNameAttr;
            }

            XmlAttribute err_XAttr = null;
            if (NamesFnc.S_CELL == sName_Fnc)
            {
                foreach (XmlAttribute xAttr in cur_X.Attributes)
                {
                    // ②
                    // name,description
                    PmName pmName = PmNames.FromSAttribute(xAttr.Name);
                    if (null != pmName)
                    {
                        cur_Cf.Dictionary_Attribute.Add(pmName.Name_Pm, xAttr.Value, cur_Cf, true, log_Reports);
                    }
                    else
                    {
                        err_XAttr = xAttr;
                        goto gt_Error_UndefinedAttr;
                    }
                }
            }
            else if (NamesFnc.S_SWITCH == sName_Fnc)
            {
                foreach (XmlAttribute xAttr in cur_X.Attributes)
                {
                    // ③
                    // name,description
                    PmName pmName = PmNames.FromSAttribute(xAttr.Name);
                    if (null != pmName)
                    {
                        cur_Cf.Dictionary_Attribute.Add(pmName.Name_Pm, xAttr.Value, cur_Cf, true, log_Reports);
                    }
                    else
                    {
                        err_XAttr = xAttr;
                        goto gt_Error_UndefinedAttr;
                    }
                }
            }
            else if (NamesFnc.S_CASE == sName_Fnc)
            {
                foreach (XmlAttribute xAttr in cur_X.Attributes)
                {
                    // ④
                    // name,description
                    PmName pmName = PmNames.FromSAttribute(xAttr.Name);
                    if (null != pmName)
                    {
                        cur_Cf.Dictionary_Attribute.Add(pmName.Name_Pm, xAttr.Value, cur_Cf, true, log_Reports);
                    }
                    else
                    {
                        err_XAttr = xAttr;
                        goto gt_Error_UndefinedAttr;
                    }
                }
            }
            else if (NamesFnc.S_VALUE_CONTROL == sName_Fnc)
            {
                foreach (XmlAttribute xAttr in cur_X.Attributes)
                {
                    // ⑤
                    // name,description
                    PmName pmName = PmNames.FromSAttribute(xAttr.Name);
                    if (null != pmName)
                    {
                        cur_Cf.Dictionary_Attribute.Add(pmName.Name_Pm, xAttr.Value, cur_Cf, true, log_Reports);
                    }
                    else
                    {
                        err_XAttr = xAttr;
                        goto gt_Error_UndefinedAttr;
                    }
                }

                // value属性の指定がなければ、このコントロールの名前を入れておく。
                if (!cur_Cf.Dictionary_Attribute.ContainsKey(PmNames.S_VALUE.Name_Pm))
                {
                    Configurationtree_Node owner_Configurationtree_Control;
                    if (!(cur_Cf.Parent is Configurationtree_Node))
                    {
                        //todo:エラーか?
                        owner_Configurationtree_Control = null;
                        goto gt_Error_UndefinedClass;
                    }
                    else
                    {
                        Configurationtree_Node parent_Cf = (Configurationtree_Node)cur_Cf.Parent;

                        if (NamesNode.S_CONTROL1 == parent_Cf.Name)
                        {
                            owner_Configurationtree_Control = parent_Cf;
                        }
                        else
                        {
                            Configuration_Node parent2 = parent_Cf.GetParentByNodename(
                                NamesNode.S_CONTROL1, EnumConfiguration.Tree, true, log_Reports);
                            if (log_Reports.Successful)
                            {
                                owner_Configurationtree_Control = (Configurationtree_Node)parent2;
                            }
                            else
                            {
                                owner_Configurationtree_Control = null;
                            }
                        }
                    }

                    if (null != owner_Configurationtree_Control)
                    {
                        if (owner_Configurationtree_Control.Dictionary_Attribute.ContainsKey(PmNames.S_NAME.Name_Pm))
                        {
                            string sFcName;
                            owner_Configurationtree_Control.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sFcName, true, log_Reports);
                            cur_Cf.Dictionary_Attribute.Add(PmNames.S_VALUE.Name_Pm, sFcName, cur_Cf, true, log_Reports);
                        }
                    }
                }
            }
            else if (NamesFnc.S_RECORD_SET_SAVE_TO2 == sName_Fnc)
            {
                foreach (XmlAttribute xAttr in cur_X.Attributes)
                {
                    string xName_AttrTrim = xAttr.Name.Trim();

                    if (
                        PmNames.S_REQUIRED.Name_Attribute == xAttr.Name // 特にS→Eにパースは無い
                        || PmNames.S_FROM.Name_Attribute == xAttr.Name // Xn_L07_SToE:SToE_F_5FElem/Xn_L07_SToE:SToE_F_A6FromImpl
                        || PmNames.S_STORAGE.Name_Attribute == xAttr.Name // 特にS→Eにパースは無い
                        || PmNames.S_FIELD.Name_Attribute == xAttr.Name // 特にS→Eにパースは無い
                        )
                    {
                        //
                        // 属性=””
                        cur_Cf.Dictionary_Attribute.Add(xAttr.Name, xAttr.Value, cur_Cf, true, log_Reports);
                    }
                    else
                    {
                        //
                        // エラー。
                        err_XAttr = xAttr;
                        goto gt_Error_UndefinedAttr;
                    }
                }//foreach
            }
            else
            {
                foreach (XmlNode xAttr in cur_X.Attributes)
                {
                    // とりあえず、どんな属性名でも受け入れる。

                    if(log_Method.CanDebug(1))
                    {
                        log_Method.WriteDebug_ToConsole( "<fnc name=”[" + sName_Fnc + "]”>の属性 " + xAttr.Name + "=”" + xAttr.Value + "”");
                    }

                    //
                    // value=""
                    //

                    // ⑥
                    PmName pmName = PmNames.FromSAttribute(xAttr.Name);
                    if (null != pmName)
                    {
                        cur_Cf.Dictionary_Attribute.Add(pmName.Name_Pm, xAttr.Value, cur_Cf, true, log_Reports);
                    }
                    else
                    {
                        cur_Cf.Dictionary_Attribute.Add(xAttr.Name, xAttr.Value, cur_Cf, true, log_Reports);
                    }

                    //
                    // 子<arg1>は、ここでは処理しない。
                    //
                }
            }

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

                Log_TextIndented s = new Log_TextIndentedImpl();

                s.Append("[");
                s.Append(cur_X.Name);
                s.Append("]要素を探索中に、未対応の属性が記述されていました。");
                s.Newline();

                s.Append("xAttr.Name=[");
                s.Append(err_XAttr.Name);
                s.Append("]");
                s.Newline();
                s.Newline();

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

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

                Log_TextIndented s = new Log_TextIndentedImpl();

                s.Append("<fnc>要素に、name属性が指定されていませんでした。");
                s.Newline();
                s.Newline();

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

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

                Log_TextIndented s = new Log_TextIndentedImpl();

                s.Append("何らかのエラー。");
                s.Newline();

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

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public void Translate(
            Configurationtree_Node cur_Conf,
            Expressionv_4ADisplayImpl parent_Exprv,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(37)" + cur_Conf.Name);
            }

            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Expressionv_5FAllFieldsIsEmptyImpl cur_Exprv = new Expressionv_5FAllFieldsIsEmptyImpl(parent_Exprv, cur_Conf, memoryApplication);

            //
            //
            //
            // 子
            //
            //
            //
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Conf,
                    cur_Exprv,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            //
            //
            //
            // 親へ連結
            //
            //
            //
            parent_Exprv.List_Expression_Child.Add(
                cur_Exprv,
                log_Reports
                );

            // #デバッグ中
            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole(" ★★ <f-all-fields-is-empty> 子要素数=[" + cur_Exprv.List_Expression_Child.Count + "] 属性数=[" + cur_Exprv.Dictionary_Expression_Attribute.Count + "]");
            }

            goto gt_EndMethod;
            //
            //
            //
            //
            gt_EndMethod:

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Conf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
Ejemplo n.º 25
0
        //────────────────────────────────────────
        /// <summary>
        /// UsercontrolPerformerImpl#Perform_FcImpl で使用。
        /// UsercontrolPerformerImpl#Perform で使用。
        /// 
        /// cf_Eventは、ucFc.ControlCommon.Configurationtree_Control.SDic_Event から取っている。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="event_Conf"></param>
        /// <param name="moWorkbench"></param>
        /// <param name="log_Reports"></param>
        public void Execute2_Event(
            object sender,
            Configurationtree_Node event_Conf,
            MemoryApplication owner_MemoryApplication,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(1, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute2_Event", log_Reports);

            Configurationtree_Node cf_ThisMethod = new Configurationtree_NodeImpl("<" + log_Method.Fullname + ":>", null);

            if (log_Reports.CanStopwatch)
            {

                // コメント作成
                {
                    StringBuilder sb = new StringBuilder();

                    string sName_Control;
                    {
                        Configuration_Node owner_Configurationtree_Control = event_Conf.GetParentByNodename(
                            NamesNode.S_CONTROL1, EnumConfiguration.Tree, true, log_Reports);
                        ((Configurationtree_Node)owner_Configurationtree_Control).Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Control, false, log_Reports);
                    }

                    string sEventName;
                    {
                        event_Conf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sEventName, false, log_Reports);
                    }

                    int nActionCount;
                    {
                        nActionCount = event_Conf.List_Child.Count;
                    }

                    sb.Append(Info_Functions.Name_Library);
                    sb.Append(":");
                    sb.Append(this.GetType().Name);
                    sb.Append("#ToString: イベント計測 ");
                    sb.Append(" FC[");
                    sb.Append(sName_Control);
                    sb.Append("].EV[");
                    sb.Append(sEventName);
                    sb.Append("]");

                    if (0 < nActionCount)
                    {
                        sb.Append("アクション数=[");
                        sb.Append(nActionCount);
                        sb.Append("]");
                    }

                    log_Method.Log_Stopwatch.Message = sb.ToString();
                    log_Method.Log_Stopwatch.Begin();

                }

            }

            // ステータスバーに表示する文字列。
            {
                if (sender is Customcontrol)
                {
                    Customcontrol ccFc = (Customcontrol)sender;

                    if (null == ccFc.ControlCommon.Owner_MemoryApplication)
                    {
                        log_Method.WriteDebug_ToConsole("null==ccFc.ControlCommon.Owner_MemoryApplication がヌルでした。");
                    }
                    else
                    {
                        ccFc.ControlCommon.Owner_MemoryApplication.MemoryForms.AddStatus_ActionUsercontrolNameBegin(log_Reports);

                        string sName_Usercontrol = sName_Usercontrol = ccFc.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                        ccFc.ControlCommon.Owner_MemoryApplication.MemoryForms.AddStatus_ActionUsercontrolName(sName_Usercontrol, log_Reports);
                    }

                }
            }

            event_Conf.List_Child.ForEach(delegate(Configurationtree_Node s_Action, ref bool bBreak)
            {
                Executer3_FunctionImpl exe2 = new Executer3_FunctionImpl();

                // イベントハンドラーの作成
                Expression_Node_Function expr_Func = exe2.ConfigurationtreeToFunction(
                    s_Action,
                    owner_MemoryApplication,
                    log_Reports
                    );

                // システム定義関数の実行
                exe2.Execute3_Function(
                    expr_Func,
                    sender,
                    owner_MemoryApplication,
                    log_Reports
                    );

                // 他の待機スレッドに、実行順番を譲る。
                //TODO: System.Threading.Thread.Sleep(0);

                //if (Log_ReportsImpl.BDebugmode_Static)
                //{
                //    //.WriteLine(this.GetType().Name + "#:\n│\n│\n│\n│");
                //}
            });

            log_Method.EndMethod(log_Reports);
        }
Ejemplo n.º 26
0
        //────────────────────────────────────────
        /// <summary>
        /// デバッグ出力。
        /// </summary>
        public void WriteDebug_ToConsole()
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            Log_Reports d_Logging_Dammy = new Log_ReportsImpl(log_Method);
            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "WriteDebug_ToConsole",d_Logging_Dammy);
            //
            //

            if (log_Method.CanInfo())
            {
                log_Method.WriteInfo_ToConsole("要素数=[" + this.dictionaryExpression_Item.Count + "]");

                // 項目(キーと値)の列挙
                foreach (KeyValuePair<string, Expression_Node_String> kvp in this.dictionaryExpression_Item)
                {
                    if (null == kvp.Value)
                    {
                        log_Method.WriteInfo_ToConsole(" [" + kvp.Key + "]=空っぽ");
                    }
                    else
                    {
                        if (kvp.Value is Expression_Node_Filepath)
                        {
                            // ファイルパス型。
                            // bug: 絶対パスでない場合、空白になるので、SHumanInput で取得することになるはず。
                            log_Method.WriteInfo_ToConsole(" [" + kvp.Key + "]=P型[" + kvp.Value.Execute4_OnExpressionString(EnumHitcount.Unconstraint, d_Logging_Dammy) + "] / SHumanInput=[" + ((Expression_Node_Filepath)kvp.Value).Humaninput + "]");
                        }
                        else
                        {
                            log_Method.WriteInfo_ToConsole(" [" + kvp.Key + "]=[" + kvp.Value.Execute4_OnExpressionString(EnumHitcount.Unconstraint, d_Logging_Dammy) + "]");
                        }
                    }

                }
            }

            //
            //
            log_Method.EndMethod(d_Logging_Dammy);
            d_Logging_Dammy.EndLogging(log_Method);
            if (!d_Logging_Dammy.Successful)
            {
                log_Method.WriteDebug_ToConsole(d_Logging_Dammy.ToText());
            }
        }
        //────────────────────────────────────────
        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 error_Filepath_Source;
            int error_RowNumber;
            Table_Humaninput error_Table_Humaninput;

            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();
            }

            Expression_Node_Filepath pm_FileImportListfile_Expr;
            this.TrySelectAttribute_ExpressionFilepath(out pm_FileImportListfile_Expr, Expression_Node_Function48Impl.PM_FILE_IMPORT_LISTFILE, EnumHitcount.One, log_Reports);

            Expression_Node_String pm_FieldsourceImportlistfile_Expr;
            this.TrySelectAttribute(out pm_FieldsourceImportlistfile_Expr, Expression_Node_Function48Impl.PM_FIELDSOURCE_IMPORTLISTFILE, EnumHitcount.One, log_Reports);

            Expression_Node_String pm_FielddestinationImportlistfile_Expr;
            this.TrySelectAttribute(out pm_FielddestinationImportlistfile_Expr, Expression_Node_Function48Impl.PM_FIELDDESTINATION_IMPORTLISTFILE, EnumHitcount.One, log_Reports);

            Expression_Node_String pm_EncodingFileimport_Expr;
            this.TrySelectAttribute(out pm_EncodingFileimport_Expr, Expression_Node_Function48Impl.PM_ENCODING_FILEIMPORT, EnumHitcount.One, log_Reports);

            Expression_Node_String pm_EncodingFileexport_Expr;
            this.TrySelectAttribute(out pm_EncodingFileexport_Expr, Expression_Node_Function48Impl.PM_ENCODING_FILEEXPORT, EnumHitcount.One, log_Reports);

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

                sb.Append(
                    "\n" +
                    "file-listfile = " + pm_FileImportListfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "\n\n" +
                    "fieldsource-importlistfile = " + pm_FieldsourceImportlistfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "\n\n" +
                    "fielddestination-importlistfile = " + pm_FielddestinationImportlistfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "\n\n" +
                    "encoding-fileimport=[" + pm_EncodingFileimport_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]\n\n" +
                    "encoding-fileexport=[" + pm_EncodingFileexport_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]\n\n" +
                    ""
                    );

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

            // CSVファイル読取り
            Table_Humaninput tableH;
            if (log_Reports.Successful)
            {
                //
                // CSVソースファイル読取
                //
                CsvTo_Table_HumaninputImpl reader = new CsvTo_Table_HumaninputImpl();

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

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

            if (log_Reports.Successful)
            {

                int rowNumber = 1;
                foreach (DataRow row in tableH.DataTable.Rows)
                {

                    //記述されているファイルパス
                    string filepath_Source_Cur;
                    string filepath_Destination_Cur;
                    if (log_Reports.Successful)
                    {
                        //"FILE"
                        string field1 = pm_FieldsourceImportlistfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint,log_Reports);
                        //"FILE2"
                        string field2 = pm_FielddestinationImportlistfile_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);

                        String_HumaninputImpl.TryParse(row[field1], out filepath_Source_Cur, "", "", log_Method, log_Reports);
                        String_HumaninputImpl.TryParse(row[field2], out filepath_Destination_Cur, "", "", log_Method, log_Reports);
                        //if (log_Method.CanDebug(9))
                        //{
                        //log_Method.WriteDebug_ToConsole("コピーしたいfilepath:①[" + filepath_Source_Cur + "]→②[" + filepath_Destination_Cur + "]");
                        //}
                    }
                    else
                    {
                        filepath_Source_Cur = "";
                        filepath_Destination_Cur = "";
                    }

                    //
                    // ファイルのコピー(上書き)
                    //
                    if ("" != filepath_Source_Cur && "" != filepath_Destination_Cur)
                    {
                        //フォルダーのコピー方法は別。
                        if (System.IO.Directory.Exists(filepath_Source_Cur))
                        {
                            //フォルダー

                            //コピー先のディレクトリがないときは作る
                            if (!System.IO.Directory.Exists(filepath_Destination_Cur))
                            {
                                System.IO.Directory.CreateDirectory(filepath_Destination_Cur);
                                //属性もコピー
                                System.IO.File.SetAttributes(filepath_Destination_Cur,
                                    System.IO.File.GetAttributes(filepath_Source_Cur));
                            }

                        }
                        else if (System.IO.File.Exists(filepath_Source_Cur))
                        {
                            //ファイル

                            //コピー先フォルダが存在しない場合、フォルダを作成
                            string nameFolderDestination = System.IO.Path.GetDirectoryName(filepath_Destination_Cur);
                            if (!System.IO.Directory.Exists(nameFolderDestination))
                            {
                                // フォルダ作成
                                System.IO.Directory.CreateDirectory(nameFolderDestination);

                                //TODO:作成したフォルダに、フォルダの属性を複写
                                //System.IO.File.SetAttributes(nameFolderDestination, System.IO.File.GetAttributes(Source_Folder_Name));
                            }

                            //第一引数で示されたファイルを、第二引数で示されたファイル位置にコピー。
                            //第3項にtrueを指定することにより、上書きを許可
                            System.IO.File.Copy(filepath_Source_Cur, filepath_Destination_Cur, true);

                            //エンコーディングを変換する
                            {
                                Encoding encodingSrc;
                                {
                                    string nameEncodingSrc = pm_EncodingFileimport_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                                    if ("" != nameEncodingSrc)
                                    {
                                        encodingSrc = Encoding.GetEncoding(nameEncodingSrc);
                                    }
                                    else
                                    {
                                        encodingSrc = null;
                                    }
                                }

                                Encoding encodingDst;
                                {
                                    string nameEncodingDst = pm_EncodingFileexport_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                                    if ("" != nameEncodingDst)
                                    {
                                        encodingDst = Encoding.GetEncoding(nameEncodingDst);
                                    }
                                    else
                                    {
                                        encodingDst = Global.ENCODING_CSV;
                                    }
                                }

                                if (null != encodingSrc && (encodingSrc != encodingDst))
                                {
                                    //エンコーディング変換を行う。
                                    log_Method.WriteDebug_ToConsole("エンコーディング変換[" + encodingSrc.EncodingName + "]→[" + encodingDst.EncodingName + "]");

                                    string textAll = System.IO.File.ReadAllText(filepath_Source_Cur);

                                    byte[] temp1 = encodingSrc.GetBytes(textAll);
                                    byte[] temp2 = System.Text.Encoding.Convert(encodingSrc, encodingDst, temp1);
                                    textAll = encodingDst.GetString(temp2);

                                    System.IO.File.WriteAllText(filepath_Destination_Cur, textAll);
                                }
                            }

                        }
                        else
                        {
                            //エラー
                            //
                            error_Filepath_Source = filepath_Source_Cur;
                            error_RowNumber = rowNumber;
                            error_Table_Humaninput = tableH;
                            goto gt_Error_NoFilesystementry;
                        }
                    }

                    if (!log_Reports.Successful)
                    {
                        //エラー
                        break;
                    }

                    rowNumber++;
                }
            }

            goto gt_EndMethod;
            //
            #region 異常系
            //────────────────────────────────────────
            gt_Error_NoFilesystementry:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, error_Filepath_Source, log_Reports);//ファイルパス
                tmpl.SetParameter(2, error_RowNumber.ToString(), log_Reports);//エラーのあった行
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(error_Table_Humaninput), log_Reports);//設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:110030;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 変数設定ファイルを読込みます。
        /// </summary>
        public void LoadVariables(
            String sFpath_Startup,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "LoadVariables",log_Reports);
            //

            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole("「変数登録ファイル」を読込みます。");
            }

            Table_Humaninput xenonTable_Variables;
            this.TryGetTable_Variables(
                out xenonTable_Variables,
                sFpath_Startup,
                log_Reports
                );

            if (null==xenonTable_Variables)
            {
                //変数登録ファイルが無ければ無視。
                goto gt_EndMethod;
            }

            if (log_Reports.Successful)
            {

                //this.Owner_MemoryApplication.MemoryVariables.Load(
                this.Load(
                    xenonTable_Variables,
                    log_Reports
                    );
            }

            goto gt_EndMethod;
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public override void Translate(
            Configurationtree_Node cur_Cf,//「S■fnc name=”Sf:f-list-box-labels;”」
            Expression_Node_String parent_Expr,//「E■view」
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
            }

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_String cur_Expr = new Expression_Node_StringImpl(parent_Expr, cur_Cf);

            //
            //
            //
            // 属性
            //
            //
            //
            this.ParseAttr_InConfigurationtreeToExpression(
                cur_Cf,
                cur_Expr,
                true,
                true,
                log_Reports
                );

            //
            //
            //
            // 子
            //
            //
            //
            cur_Cf.List_Child.ForEach(delegate( Configurationtree_Node child_Cf, ref bool bBreak2)
            {
                string sName_Fnc;
                child_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Fnc, false, log_Reports);

                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole( " 子解析。 <~ name=”[" + sName_Fnc + "]”>");
                }

                // todo: Sf:item-value;
                if(NamesFnc.S_ITEM_VALUE == sName_Fnc)
                {
                    //
                    // 自
                    //
                    Expression_Node_String child_Expr = new Expression_Node_StringImpl(cur_Expr, child_Cf);

                    //
                    // 属性
                    //
                    this.ParseAttr_InConfigurationtreeToExpression(
                        child_Cf,
                        child_Expr,
                        true,
                        true,
                        log_Reports
                        );

                    //
                    // 子
                    //
                    this.ParseChild_InConfigurationtreeToExpression(
                        child_Cf,
                        child_Expr,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );

                    //
                    // 親
                    //
                    cur_Expr.List_Expression_Child.Add(child_Expr, log_Reports);
                }
                else if (NamesFnc.S_ITEM_LABEL2 == sName_Fnc)
                {
                    //
                    // 自
                    //
                    Expression_Node_String child_Expr = new Expression_Node_StringImpl(cur_Expr, child_Cf);

                    //
                    // 属性
                    //
                    this.ParseAttr_InConfigurationtreeToExpression(
                        child_Cf,
                        child_Expr,
                        true,
                        true,
                        log_Reports
                        );

                    //
                    // 子
                    //
                    this.ParseChild_InConfigurationtreeToExpression(
                        child_Cf,
                        child_Expr,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );

                    //
                    // 親
                    //
                    cur_Expr.List_Expression_Child.Add(child_Expr, log_Reports);
                }
                else if (NamesFnc.S_ITEM_GRAY_OUT == sName_Fnc)
                {
                    //
                    // 自
                    //
                    Expression_Node_String child_Expr = new Expression_Node_StringImpl(cur_Expr, child_Cf);

                    //
                    // 属性
                    //
                    this.ParseAttr_InConfigurationtreeToExpression(
                        child_Cf,
                        child_Expr,
                        true,
                        true,
                        log_Reports
                        );

                    //
                    // 子
                    //
                    this.ParseChild_InConfigurationtreeToExpression(
                        child_Cf,
                        child_Expr,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );

                    //
                    // 親
                    //
                    cur_Expr.List_Expression_Child.Add(child_Expr, log_Reports);
                }
                else
                {
                    {
                        Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                        tmpl.SetParameter(1, child_Cf.Name, log_Reports);//子設定ノード名

                        memoryApplication.CreateErrorReport("Er:7019;", tmpl, log_Reports);
                    }

                    bBreak2 = true;
                    goto gt_gt_EndMethod2;
                }
                goto gt_gt_EndMethod2;

                //
            //
            //
            //
            gt_gt_EndMethod2:
                ;
            });

            //
            //
            //
            // 親へ連結
            //
            //
            //
            parent_Expr.List_Expression_Child.Add(cur_Expr, log_Reports);
            //
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <summary>
        /// 
        /// </summary>
        public override string Execute5_Main(Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute5_Main",log_Reports);

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

            // デバッグ
            if (log_Reports.CanStopwatch)
            {
                log_Method.Log_Stopwatch.Message = "Nアクション[" + sFncName + "]実行";
                log_Method.Log_Stopwatch.Begin();
            }

            // タスク・デスクリプション
            if (this.Functionparameterset.Sender is Customcontrol)
            {
                Customcontrol fcCc = (Customcontrol)this.Functionparameterset.Sender;

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

                log_Reports.Comment_EventCreationMe += "/追記:[" + sName_Usercontrol + "]コントロールが、[" + sFncName + "]アクションを実行。";
            }
            else
            {
                log_Reports.Comment_EventCreationMe += "/追記:[" + sFncName + "]アクションを実行。";
            }

            if (this.EnumEventhandler == EnumEventhandler.O_Lr)
            {

                //
                //
                //
                //
                Expression_Node_String e_ArgFilePath;
                this.TrySelectAttribute(out e_ArgFilePath, Expression_Node_Function17Impl_OLD.PM_FILEPATH, EnumHitcount.One_Or_Zero, log_Reports);

                // ファイルパス
                if (null == e_ArgFilePath)
                {
                    if (log_Reports.Successful)
                    {
                        // 正常時
                        if (log_Method.CanDebug(1))
                        {
                            log_Method.WriteDebug_ToConsole("①[" + Expression_Node_Function17Impl_OLD.PM_FILEPATH + "]はヌルだった。");
                        }

                        throw new Exception("バリデーション設定ファイルのファイルパスを1つ1つ当たるプログラムが未実装です。");

                        //// 変数名。
                        //Expression_Node_String e_Atom;
                        //this.TrySelectAttribute(out e_Atom, Ec_Sf17Impl_OLD.S_PM_NAME_VAR_FILEPATH, false, EnumHitcount.Unconstraint, log_Reports);

                        //// ファイルパス。
                        //log_Reports.Log_Callstack.Push(log_Method, "④");
                        //Expression_Node_Filepath efp = this.Owner_MemoryApplication.MemoryVariables.GetExpressionfilepathByVariablename(e_Atom, true, log_Reports);
                        //log_Reports.Log_Callstack.Pop(log_Method, "④");

                        //e_ArgFilePath = efp;
                        //this.SetAttribute(Ec_Sf17Impl_OLD.S_PM_FILEPATH, efp, log_Reports);
                    }
                    else
                    {
                    }
                }
                else
                {
                    if (log_Method.CanDebug(1))
                    {
                        log_Method.WriteDebug_ToConsole( "②");
                    }
                }

                //絶対ファイルパス
                string sFpatha_vcnf;
                if (log_Reports.Successful)
                {
                    // 正常時
                    if (log_Method.CanDebug(1))
                    {
                        log_Method.WriteDebug_ToConsole( "③");
                    }

                    sFpatha_vcnf = e_ArgFilePath.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                    if (!log_Reports.Successful)
                    {
                        // 既エラー。
                        goto gt_EndMethod;
                    }
                }
                else
                {
                    if (log_Method.CanDebug(1))
                    {
                        log_Method.WriteDebug_ToConsole( "④");
                    }

                    sFpatha_vcnf = "";
                }

                // 『バリデーション設定ファイル』を読み込みます。
                if (log_Reports.Successful)
                {
                    // 正常時

                    if (log_Method.CanDebug(1))
                    {
                        log_Method.WriteDebug_ToConsole( "⑤sFpatha_vcnf=[" + sFpatha_vcnf + "]");
                    }

                    this.Owner_MemoryApplication.MemoryValidators.LoadFile(sFpatha_vcnf, log_Reports);//ここでバグる。
                }
            }

            goto gt_EndMethod;
            //
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return "";
        }
Ejemplo n.º 31
0
        //────────────────────────────────────────
        /// <summary>
        /// 関数を登録します。
        /// </summary>
        /// <param name="sName_Fnc"></param>
        /// <param name="expr_Func"></param>
        public static void SetFunction(string sName_Fnc, Expression_Node_Function expr_Func, Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(1);
            log_Method.BeginMethod(Info_Functions.Name_Library, "Collection_Function", "SetFunction",log_Reports);
            //

            dictionary_Interlibrary[sName_Fnc] = expr_Func;
            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole("関数[" + sName_Fnc + "]を登録しました。dictionary.count=[" + dictionary_Interlibrary.Count + "]");
            }

            //
            log_Method.EndMethod(log_Reports);
        }