Esempio n. 1
0
        //────────────────────────────────────────

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

            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);
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
        //────────────────────────────────────────
        #endregion



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

        /// <summary>
        /// 関数を登録します。
        /// </summary>
        /// <param name="sName_Fnc"></param>
        /// <param name="expr_Func"></param>
        public static void SetFunction(string sName_Fnc, Expression_Node_Function expr_Func, Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(1);

            log_Method.BeginMethod(Info_Functions.Name_Library, "Collection_Function", "SetFunction", log_Reports);
            //

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

            //
            log_Method.EndMethod(log_Reports);
        }
Esempio n. 5
0
        //────────────────────────────────────────

        /// <summary>
        /// ユーザー定義関数を登録します。
        /// </summary>
        /// <param name="sName"></param>
        /// <param name="e_Func"></param>
        /// <param name="log_Reports"></param>
        public void AddFunction(string sName, Expression_Node_Function ec_CommonFunction, Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0);

            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "AddFunc", log_Reports);

            if (log_Method.CanDebug(1))
            {
            }

            //
            //

            if (this.dictionary_Item.ContainsKey(sName))
            {
                goto gt_Error_Exists;
            }

            this.dictionary_Item.Add(sName, ec_CommonFunction);

            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole(" ユーザー定義関数の追加登録 [" + sName + "]");
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_Exists:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲設定エラー101!", log_Method);
                r.Message = "ユーザー定義関数[" + sName + "]は既に定義されていますが、さらに定義されました。同じ名前のユーザー定義関数は1つしか定義してはいけません。";
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Esempio n. 6
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());
            }
        }
Esempio n. 7
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);
        }
Esempio n. 8
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);
        }
Esempio n. 9
0
        //────────────────────────────────────────

        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);
        }
Esempio n. 10
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);
        }
Esempio n. 11
0
        //────────────────────────────────────────
        #endregion



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

        public void Perform()
        {
            Log_Method  log_Method             = new Log_MethodImpl(0);
            Log_Reports log_Reports_ThisMethod = new Log_ReportsImpl(log_Method);

            log_Method.BeginMethod(Info_PartsnumPut.Name_Library, this, "Perform", log_Reports_ThisMethod);

            this.In_UsercontrolCanvas.ClearNumSps(true);
            log_Method.WriteDebug_ToConsole("Performを実行しました。");


            //
            // テーブル読取
            //
            //Dictionary<string, int> dictionary_NameField = new Dictionary<string, int>();

            //欲しい列が何番目にあるかを調べます。
            int row = 0;
            // 「NO」、「DISPLAY」、「LAYER」「X」「Y」「FONT_SIZE」「COLOR_BG」(「END」)の8フィールドがある。
            int indexColumn_Display    = -1;
            int indexColumn_Text       = -1;
            int indexColumn_Layer      = -1;
            int indexColumn_X          = -1;
            int indexColumn_XLt        = -1;
            int indexColumn_Y          = -1;
            int indexColumn_YLt        = -1;
            int indexColumn_FontSize   = -1;
            int indexColumn_FontSizePt = -1;
            int indexColumn_ColorBg    = -1;
            int indexColumn_BackColor  = -1;

            //this.in_Table_Humaninput.RecordFielddefinition.ForEach(delegate(Fielddefinition fielddefinition, ref bool isBreak2, Log_Reports log_Reports2)
            //{
            //},log_Reports_ThisMethod);

            // 列のindex。該当がなければ-1。
            indexColumn_Display    = this.in_Table_Humaninput.RecordFielddefinition.ColumnIndexOf_Trimupper("DISPLAY");
            indexColumn_Text       = this.in_Table_Humaninput.RecordFielddefinition.ColumnIndexOf_Trimupper("TEXT");
            indexColumn_Layer      = this.in_Table_Humaninput.RecordFielddefinition.ColumnIndexOf_Trimupper("LAYER");
            indexColumn_X          = this.in_Table_Humaninput.RecordFielddefinition.ColumnIndexOf_Trimupper("X");
            indexColumn_XLt        = this.in_Table_Humaninput.RecordFielddefinition.ColumnIndexOf_Trimupper("X_LT");
            indexColumn_Y          = this.in_Table_Humaninput.RecordFielddefinition.ColumnIndexOf_Trimupper("Y");
            indexColumn_YLt        = this.in_Table_Humaninput.RecordFielddefinition.ColumnIndexOf_Trimupper("Y_LT");
            indexColumn_FontSize   = this.in_Table_Humaninput.RecordFielddefinition.ColumnIndexOf_Trimupper("FONT_SIZE");
            indexColumn_FontSizePt = this.in_Table_Humaninput.RecordFielddefinition.ColumnIndexOf_Trimupper("FONT_SIZE_PT");
            indexColumn_ColorBg    = this.in_Table_Humaninput.RecordFielddefinition.ColumnIndexOf_Trimupper("COLOR_BG");
            indexColumn_BackColor  = this.in_Table_Humaninput.RecordFielddefinition.ColumnIndexOf_Trimupper("BACK_COLOR");

            this.in_Table_Humaninput.ForEach_Datapart(delegate(Record_Humaninput recordH, ref bool isBreak1, Log_Reports log_Reports1)
            {
                //log_Method.WriteDebug_ToConsole("row=[" + row + "] recordH.ToString_DebugDump()=[" + recordH.ToString_DebugDump() + "]");

                //if (row == 0)
                //{
                //    // 上1行は「列名」。

                //    //log_Method.WriteDebug_ToConsole("indexColumn_BackColor=[" + indexColumn_BackColor + "] recordH.ToString_DebugDump()=[" + recordH.ToString_DebugDump()+ "]");

                //    goto gt_LastLoop;
                //}
                //else if (row < 3)
                //{
                //    // 上3行(row=0,1,2)は「列名」「型」「解説」として無視。
                //    goto gt_LastLoop;
                //}

                // 左端に EOF が入っていれば終了。
                if ("EOF" == recordH.ValueAt(0).Text.Trim())
                {
                    isBreak1 = true;
                    goto gt_LastLoop;
                }

                Memory4bSpritePartsnumberImpl memSpriteNum       = new Memory4bSpritePartsnumberImpl();
                memSpriteNum.Delegate_OnChangeSprite_Partsnumber = this.In_UsercontrolCanvas.UsercontrolCanvas_OnChangeSpritePartsnumber;

                //表示テキスト
                {
                    if (0 <= indexColumn_Text)
                    {
                        memSpriteNum.Text = recordH.ValueAt(indexColumn_Text).Text;
                    }
                    else if (0 <= indexColumn_Display)
                    {
                        //旧仕様
                        memSpriteNum.Text = recordH.ValueAt(indexColumn_Display).Text;
                    }
                }

                //レイヤー
                if (0 <= indexColumn_Layer)
                {
                    int nLayer = 0;
                    int.TryParse(recordH.ValueAt(indexColumn_Layer).Text, out nLayer);
                    memSpriteNum.Number_Layer = nLayer;
                }

                //座標
                {
                    //左辺x
                    int x = 0;
                    {
                        if (0 <= indexColumn_XLt)
                        {
                            int.TryParse(recordH.ValueAt(indexColumn_XLt).Text, out x);
                        }
                        else if (0 <= indexColumn_X)
                        {
                            int.TryParse(recordH.ValueAt(indexColumn_X).Text, out x);
                        }
                    }

                    //上辺y
                    int y = 0;
                    {
                        if (0 <= indexColumn_YLt)
                        {
                            int.TryParse(recordH.ValueAt(indexColumn_YLt).Text, out y);
                        }
                        else if (0 <= indexColumn_Y)
                        {
                            int.TryParse(recordH.ValueAt(indexColumn_Y).Text, out y);
                        }
                    }

                    memSpriteNum.LocationOnBackgroundActual = new PointF(x, y);
                }


                //フォントサイズ(1以上の数字なら有効)
                {
                    int fontsize = -1;
                    if (0 <= indexColumn_FontSizePt)
                    {
                        if (int.TryParse(recordH.ValueAt(indexColumn_FontSizePt).Text, out fontsize))
                        {
                            fontsize = -1;
                        }
                    }
                    else if (0 <= indexColumn_FontSize)
                    {
                        //旧仕様
                        if (int.TryParse(recordH.ValueAt(indexColumn_FontSize).Text, out fontsize))
                        {
                            fontsize = -1;
                        }
                    }

                    if (1 <= fontsize)
                    {
                        memSpriteNum.Font = new System.Drawing.Font("MS ゴシック", (float)fontsize);
                    }
                }

                //背景色
                {
                    string name_Color = "";
                    if (0 <= indexColumn_BackColor)
                    {
                        name_Color = recordH.ValueAt(indexColumn_BackColor).Text;
                    }
                    else if (0 <= indexColumn_ColorBg)
                    {
                        //旧仕様
                        name_Color = recordH.ValueAt(indexColumn_ColorBg).Text;
                    }

                    switch (name_Color)
                    {
                    case "Green":
                        memSpriteNum.BrushBackground = Brushes.Green;
                        break;

                    default:
                        memSpriteNum.BrushBackground = Brushes.Blue;
                        break;
                    }
                }

                this.In_UsercontrolCanvas.AddNumSp(memSpriteNum, true);

                //
                gt_LastLoop://continueを使わない。

                row++;
            }, log_Reports_ThisMethod);

            this.In_UsercontrolCanvas.After_AddSpriteList();

            // フォームを再描画。
            this.In_UsercontrolCanvas.Refresh();

            //
            goto gt_EndMethod;
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports_ThisMethod);
            return;
        }
Esempio n. 12
0
        //────────────────────────────────────────

        /// <summary>
        /// <f-set-var>要素の名前を指定して、値を取り出します。(ファイル・パスとします)
        /// 該当がなければヌルを返します。
        /// </summary>
        /// <param name="projectName"></param>
        /// <param name="bRequired">該当がない場合にエラー扱いにするなら真</param>
        /// <returns></returns>
        public Expression_Node_Filepath GetFilepathByFsetvarname(
            string sNamevar_Expected,
            MemoryVariables moVariables,
            bool bRequired,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(1, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "GetFilepathByFsetvarname", log_Reports);
            //
            //

            Expression_Node_Filepath ec_Fpath = null;

            //各<f-set-var>
            this.Dictionary_Fsetvar_Configurationtree.List_Child.ForEach(delegate(Configurationtree_Node s_Fsetvar, ref bool bBreak)
            {
                //name-var属性
                string sNamevar_Cur;
                s_Fsetvar.Dictionary_Attribute.TryGetValue(PmNames.S_NAME_VAR, out sNamevar_Cur, true, log_Reports);

                if (sNamevar_Cur == sNamevar_Expected)
                {
                    string sFolder;
                    s_Fsetvar.Dictionary_Attribute.TryGetValue(PmNames.S_FOLDER, out sFolder, false, log_Reports);

                    string sValue;
                    s_Fsetvar.Dictionary_Attribute.TryGetValue(PmNames.S_VALUE, out sValue, true, log_Reports);

                    {
                        Configurationtree_NodeFilepath cf_Fpath = new Configurationtree_NodeFilepathImpl("『エディター設定ファイル』の[" + sNamevar_Expected + "]要素_L09Mid_2[" + sValue + "]", this.Parent);
                        cf_Fpath.InitPath(
                            sValue,
                            log_Reports
                            );

                        if ("" != sFolder)
                        {
                            //フォルダーパス変数名の指定有り
                            Expression_Node_String ec_Namevar_Folder = new Expression_Leaf_StringImpl(sFolder, null, cf_Fpath);

                            log_Reports.Log_Callstack.Push(log_Method, "②");
                            Expression_Node_Filepath ec_Fpath_Folder = moVariables.GetExpressionfilepathByVariablename(ec_Namevar_Folder, true, log_Reports);
                            log_Reports.Log_Callstack.Pop(log_Method, "②");

                            if (log_Reports.Successful)
                            {
                                string sDirectory = ec_Fpath_Folder.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                                if (log_Method.CanDebug(1))
                                {
                                    log_Method.WriteDebug_ToConsole("folder=[" + sFolder + "] directory=[" + sDirectory + "]");
                                }
                                cf_Fpath.SetDirectory_Base(
                                    sDirectory
                                    );
                            }
                        }

                        if (!log_Reports.Successful)
                        {
                            // 既エラー。
                            bBreak = true;
                            goto gt_EndMethod2;
                        }

                        ec_Fpath = new Expression_Node_FilepathImpl(cf_Fpath);
                    }
                }

                goto gt_EndMethod2;
                //
                //
                gt_EndMethod2:
                ;
            });



            if (null == ec_Fpath)
            {
                if (bRequired)
                {
                    // エラーとして扱います。
                    goto gt_Error_NotFoundFsetvar;
                }
            }

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

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append("次の要素は必要でしたが、記述されていませんでした。<" + NamesNode.S_EDITOR + ">要素の中に。");
                s.Newline();
                s.Newline();

                s.Append("<" + NamesNode.S_F_SET_VAR + " name=\"" + sNamevar_Expected + "\" >");
                s.Newline();
                s.Newline();

                s.Append("もしかして?");
                s.Newline();

                s.Append(" ・『設定ファイル』に、必要な内容が書けていない?");
                s.Newline();

                s.Append(" ・設定ファイル情報:");
                s.Append(r.Message_Configuration(this.Parent));
                s.Newline();
                s.Newline();

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return(ec_Fpath);
        }
Esempio n. 13
0
        //────────────────────────────────────────

        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);
        }
Esempio n. 14
0
        //────────────────────────────────────────

        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);
        }
Esempio n. 15
0
        //────────────────────────────────────────

        /// <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);
        }
Esempio n. 16
0
        //────────────────────────────────────────

        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);
        }
Esempio n. 17
0
        //────────────────────────────────────────

        /// <summary>
        /// 「Aa_Files.csv」に書かれている「テーブル」と「スクリプト」を読取り、登録します。
        /// </summary>
        private void ReadAndRegisterFiles(
            Table_Humaninput xenonTable_Aafilescsv,
            Log_Reports log_Reports
            )
        {
            //
            //
            //
            //()メソッド開始
            //
            //
            //
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_Functions.Name_Library, this, "ReadAndRegisterFiles", log_Reports);


            string err_STypedata;

            //
            //
            //
            // 「Aa_Files.csv」自身の絶対ファイルパス
            //
            //
            //
            string sFpatha_Aafilescsv;

            if (log_Reports.Successful)
            {
                sFpatha_Aafilescsv = xenonTable_Aafilescsv.Expression_Filepath_ConfigStack.Execute4_OnExpressionString(
                    EnumHitcount.Unconstraint, log_Reports);
                if (!log_Reports.Successful)
                {
                    // 既エラー。
                    goto gt_EndMethod;
                }
            }
            else
            {
                sFpatha_Aafilescsv = null;
            }


            //
            //
            //
            //「TYPE_DATA」というフィールドは必須です。
            //
            //
            //
            bool isExists_FieldTypedata;

            if (log_Reports.Successful)
            {
                if (xenonTable_Aafilescsv.DataTable.Columns.Contains(NamesFld.S_TYPE_DATA))
                {
                    isExists_FieldTypedata = true;
                }
                else
                {
                    isExists_FieldTypedata = false;
                }
            }
            else
            {
                isExists_FieldTypedata = false;
            }


            int err_NRow = 1;//行番号

            if (log_Reports.Successful)
            {
                //
                // テーブルを全て(読み込まないもの除く)読み取ります。
                //

                foreach (DataRow datarow in xenonTable_Aafilescsv.DataTable.Rows)
                {
                    Request_ReadsTable requestRead = this.CreateReadRequest(
                        datarow,
                        xenonTable_Aafilescsv,
                        log_Reports);

                    if (!log_Reports.Successful)
                    {
                        //既エラー時、ループ抜け。
                        break;
                    }

                    //
                    // テーブルを読み取るのか、XMLを読み取るのかの区別。
                    //
                    if (
                        ValuesTypeData.TestTable(requestRead.Typedata) ||
                        !isExists_FieldTypedata //TYPE_DATAフィールドそのものが無ければ、エラーとはせず、テーブルとして読み込みます。
                        )
                    {
                        //
                        // テーブルなら。
                        //

                        Format_Table_Humaninput forTable_format = this.Read_RequestPart_Table(
                            datarow, sFpatha_Aafilescsv, log_Reports);

                        Table_Humaninput oTable;
                        // テーブル読取の実行。(書き出し専用の場合は、登録だけする)
                        oTable = this.ReadTable(
                            requestRead,
                            forTable_format,
                            log_Reports
                            );

                        // テーブルは読み込まなくても、登録はする。
                        if (log_Reports.Successful)
                        {
                            // アプリケーション・モデルに、テーブルを登録
                            this.Owner_MemoryApplication.MemoryTables.AddTable_Humaninput(
                                oTable,
                                log_Reports
                                );
                        }
                        //
                    }
                    else if (
                        ValuesTypeData.TestCode(requestRead.Typedata)
                        )
                    {
                        //
                        // XMLなら。
                        //

                        MemoryCodefileinfo moScriptfileInfo = this.Read_RequestPart_Script(
                            datarow,
                            sFpatha_Aafilescsv,
                            xenonTable_Aafilescsv,
                            log_Reports
                            );

                        // 登録
                        if (log_Reports.Successful)
                        {
                            this.Owner_MemoryApplication.MemoryCodefiles.Add(
                                moScriptfileInfo,
                                log_Reports
                                );
                        }

                        //requestRead.
                        log_Method.WriteDebug_ToConsole("sTypeData=[" + requestRead.Typedata + "]");
                    }
                    else
                    {
                        //エラー。
                        err_STypedata = requestRead.Typedata;
                        goto gt_Error_TypeData;
                    }


                    //エラー報告用の行カウンター。
                    err_NRow++;
                }
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_TypeData:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, NamesFld.S_TYPE_DATA, log_Reports);              //フィールド名TYPE_DATA
                tmpl.SetParameter(2, err_STypedata, log_Reports);                     //TYPE_DATAフィールドの値
                tmpl.SetParameter(3, ValuesTypeData.Message_Allitems(), log_Reports); //TYPE_DATAフィールドに設定できる値のリスト

                Configurationtree_Node cf = new Configurationtree_NodeImpl("データ部" + err_NRow + "行", xenonTable_Aafilescsv.Parent);
                tmpl.SetParameter(4, Log_RecordReportsImpl.ToText_Configuration(cf), log_Reports);//設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:110011;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Esempio n. 18
0
        //────────────────────────────────────────

        protected void Execute6_Sub(
            object sender,
            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);

            //
            //
            //
            //
            //
            //
            //
            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole("関数30「新規ウィンドウを開く」を実行します。");
            }


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


            //
            //
            //
            //()タスク・デスクリプション
            //
            //
            //
            {
                if (sender is Customcontrol)
                {
                    Customcontrol cct = (Customcontrol)sender;

                    string sName_Control;
                    if (null == cct.ControlCommon.Expression_Name_Control)
                    {
                        sName_Control = "<エラー:名無し>";
                    }
                    else
                    {
                        sName_Control = cct.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString(
                            EnumHitcount.Unconstraint,
                            log_Reports
                            );
                    }

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


            // ┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━
            // ┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━
            // 開始
            // ┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━
            // ┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━

            Configurationtree_NodeImpl cf_ThisMethod = new Configurationtree_NodeImpl("!ハードコーディング_NAction30#Execute6_Sub", null);

            if (log_Reports.Successful)
            {
                // 正常時

                Expression_Node_String ec_ArgFormgroup;
                this.TrySelectAttribute(out ec_ArgFormgroup, Expression_Node_Function30Impl.PM_NAME_FORM, EnumHitcount.One_Or_Zero, log_Reports);

                if (null == ec_ArgFormgroup)
                {
                    //
                    // エラー
                    goto gt_Error_NoForm;
                }
            }



            //
            //
            //
            //(3)レイアウト_テーブル読取
            //
            //
            //
            List <Table_Humaninput> oList_Table_Form;//(フォームのセットアップに使う)

            //
            // 「フォーム名(レイアウト_ターゲット名)」を指定。
            if (log_Reports.Successful)
            {
                // 正常時

                // テーブル名から、レイアウト・ファイルパスの取得。
                Expression_Node_String ec_ArgFormgroup;
                this.TrySelectAttribute(out ec_ArgFormgroup, Expression_Node_Function30Impl.PM_NAME_FORM, EnumHitcount.One_Or_Zero, log_Reports);

                oList_Table_Form = this.Owner_MemoryApplication.MemoryTables.GetTable_HumaninputByFormgroup(ec_ArgFormgroup, true, log_Reports);
            }
            else
            {
                oList_Table_Form = new List <Table_Humaninput>();
            }


            //
            //
            //
            //(4)formsフォルダーパス取得
            //
            //
            //
            Expression_Node_Filepath ec_Fopath_Forms;

            if (log_Reports.Successful)
            {
                // 正常時

                XenonName o_Name_Variable = new XenonNameImpl(NamesVar.S_SP_FORMS, this.Cur_Configuration);

                // 変数名。
                Expression_Leaf_StringImpl ec_Atom = new Expression_Leaf_StringImpl(this, o_Name_Variable.Cur_Configuration);
                ec_Atom.SetString(o_Name_Variable.SValue, log_Reports);

                // ファイルパス。
                log_Reports.Log_Callstack.Push(log_Method, "⑤");
                ec_Fopath_Forms = this.Owner_MemoryApplication.MemoryVariables.GetExpressionfilepathByVariablename(ec_Atom, true, log_Reports);
                log_Reports.Log_Callstack.Pop(log_Method, "⑤");
            }
            else
            {
                ec_Fopath_Forms = null;
            }


            //
            //
            //
            //(5)フォームをセットアップ。
            //
            //
            //
            if (log_Reports.Successful)
            {
                // 正常時

                this.Owner_MemoryApplication.MemoryForms.SetupFormAndLoadUsercontrolconfigs(
                    oList_Table_Form,
                    ec_Fopath_Forms,
                    this.Owner_MemoryApplication.MemoryForms.Mainwnd_FormWrapping.Form,
                    log_Reports
                    );
            }


            //
            //
            //
            //(6)『トゥゲザー設定ファイル』読取。
            //
            //
            //
            if (log_Reports.Successful)
            {
                // タイプデータ値「ScriptTogethers」。
                Expression_Leaf_StringImpl ec_NameVariable = new Expression_Leaf_StringImpl(this, cf_ThisMethod);
                ec_NameVariable.SetString(ValuesTypeData.S_CODE_TOGETHERS, 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.MemoryTogethers.LoadFile(scriptfile.Expression_Filepath, log_Reports);
                        }
                        else
                        {
                            break;
                        }
                    }
                }
            }


            //
            //
            //
            //(7)「プロジェクトが選択(切替)されたとき」
            //
            //
            //
            if (null != this.In_Subroutine_Function30_2)
            {
                this.In_Subroutine_Function30_2.Perform(
                    oList_Table_Form,
                    ec_Fopath_Forms,
                    this.Cur_Configuration,
                    this.Owner_MemoryApplication.MemoryForms.Mainwnd_FormWrapping.Form,
                    sender,
                    log_Reports
                    );
            }


            //
            //
            //
            //(8)独自実装のコントロールのプロパティー編集。主に、フォームの活性化をしているだけ。
            //
            //
            //
            if (null != this.In_Subroutine_Function30_1)
            {
                this.In_Subroutine_Function30_1.Perform(this.Owner_MemoryApplication, log_Reports);
            }

            // (X5)コントロールに、妥当性判定を設定します。
            if (log_Reports.Successful)
            {
                // タイプデータ値。
                Expression_Leaf_StringImpl ec_Name_Variable = new Expression_Leaf_StringImpl(this, cf_ThisMethod);
                ec_Name_Variable.SetString(ValuesTypeData.S_CODE_VALIDATORS, log_Reports);

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

                if (log_Reports.Successful)
                {
                    foreach (MemoryCodefileinfo moScriptfile in list_Info)
                    {
                        if (log_Reports.Successful)
                        {
                            this.Owner_MemoryApplication.MemoryValidators.LoadFile(
                                moScriptfile.Expression_Filepath.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports),
                                log_Reports);
                        }
                        else
                        {
                            break;
                        }
                    }
                }
            }


            //
            //
            //
            //(9)「レイアウトテーブル」に書かれているコントロール名だけの一覧を作成。
            //
            //
            //
            List <string> sList_Name_Control = new List <string>();

            foreach (Table_Humaninput tableH_Form in oList_Table_Form)
            {
                if (tableH_Form.DataTable.Columns.Contains(NamesFld.S_NAME))
                {
                    // 「NAME」フィールドのあるテーブルが本表。無いのは参照表。

                    foreach (DataRow row in tableH_Form.DataTable.Rows)
                    {
                        string name_Control = ((Value_Humaninput)row[NamesFld.S_NAME]).Text;
                        sList_Name_Control.Add(name_Control.Trim());
                    }
                }
            }


            //
            //
            //
            //(10)指定レイアウト内の全てのコントロールの、"Se:読取時;" イベントを実行します。
            //
            //
            //
            if (log_Reports.Successful)
            {
                Executer1_UsercontrolAndEvent exe1 = new Executer1_UsercontrolAndEventImpl();
                exe1.Execute1_AllUsercontrols(
                    sList_Name_Control,
                    sender,
                    new XenonNameImpl(NamesSe.S_LOAD, cf_ThisMethod),
                    this.Owner_MemoryApplication,
                    log_Reports
                    );
            }

            //
            //
            //
            // ロード完了
            //
            //
            //

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

                this.Owner_MemoryApplication.CreateErrorReport("Er:110015;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Esempio n. 19
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);
        }
Esempio n. 20
0
        //────────────────────────────────────────
        #endregion



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

        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);
        }
Esempio n. 21
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);
        }
Esempio n. 22
0
        //────────────────────────────────────────

        /// <summary>
        /// 『ユーザー定義関数設定ファイル(Fnc)』を読み取ります。
        /// </summary>
        public void LoadFile(
            Expression_Node_Filepath filepath_Userfunctionconfig_Expr,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0);

            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "LoadFile", log_Reports);

            //
            //

            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole(" ユーザー定義関数設定ファイルの読み取り。");
            }

            Configurationtree_Node parent_Conf             = new Configurationtree_NodeImpl(NamesNode.S_CODEFILE_FUNCTIONS, filepath_Userfunctionconfig_Expr.Cur_Configuration);//Info_OpyopyoImpl.LibraryName + ":" + this.GetType().Name + ".LoadFile_Fnc"
            Expression_Node_String userfunctionconfig_Expr = new Expression_Node_StringImpl(null, parent_Conf);

            string filepathabsolute = filepath_Userfunctionconfig_Expr.Execute4_OnExpressionString(
                EnumHitcount.Unconstraint, log_Reports);

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

            if (!System.IO.File.Exists(filepathabsolute))
            {
                goto gt_Error_File;
            }


            XmlDocument xDoc     = new XmlDocument();
            Exception   err_Excp = null;

            try
            {
                xDoc.Load(filepathabsolute);
            }
            catch (System.IO.IOException ex)
            {
                //
                // エラー。
                err_Excp = ex;
                goto gt_Error_Doc;
            }
            catch (ArgumentException ex)
            {
                //
                // エラー。
                err_Excp = ex;
                goto gt_Error_Doc;
            }
            catch (Exception ex)
            {
                //
                // エラー。
                err_Excp = ex;
                goto gt_Error_Doc;
            }

            XmlElement xRoot = null;

            if (log_Reports.Successful)
            {
                // ルート要素を取得
                xRoot = xDoc.DocumentElement;

                // スクリプトファイルのバージョンチェック。(関数登録ファイル)
                ValuesAttr.Test_Codefileversion(
                    xRoot.GetAttribute(PmNames.S_CODEFILE_VERSION.Name_Attribute),
                    log_Reports,
                    new Configurationtree_NodeImpl(filepathabsolute, null),
                    NamesNode.S_CODEFILE_FUNCTIONS
                    );
            }

            string sErrorElementName = "";

            if (log_Reports.Successful)
            {
                XmlNodeList xTopNL = xRoot.ChildNodes;
                foreach (XmlNode xTopNode in xTopNL)
                {
                    if (XmlNodeType.Element == xTopNode.NodeType)
                    {
                        if (NamesNode.S_COMMON_FUNCTION == xTopNode.Name)
                        {
                            XmlElement x_Cur = (XmlElement)xTopNode;

                            string sNameValue = x_Cur.GetAttribute(PmNames.S_NAME.Name_Attribute);
                            if (log_Method.CanDebug(1))
                            {
                                log_Method.WriteDebug_ToConsole(" ユーザー定義関数の追加を開始:" + sNameValue);
                            }

                            // XToCf
                            XmlToConfigurationtree_C15_Elm xToCf = XmlToConfigurationtree_Collection.GetTranslatorByNodeName(NamesNode.S_COMMON_FUNCTION, log_Reports);
                            xToCf.XmlToConfigurationtree(
                                x_Cur,
                                parent_Conf,
                                this.Owner_MemoryApplication,
                                log_Reports
                                );

                            Configurationtree_Node s_Cur = null;
                            parent_Conf.List_Child.ForEach(delegate(Configurationtree_Node s_Child, ref bool bBreak)
                            {
                                s_Cur  = s_Child;
                                bBreak = true;
                            });

                            // SToE
                            Expression_Node_FunctionImpl ec_CommonFunction = new Expression_Node_FunctionImpl(userfunctionconfig_Expr, s_Cur, new List <string>());

                            Log_TextIndented_ConfigurationtreeToExpressionImpl pg_ParsingLog = new Log_TextIndented_ConfigurationtreeToExpressionImpl();
                            pg_ParsingLog.BEnabled = false;
                            ConfigurationtreeToExpression_AbstractImpl.ParseChild_InAnotherLibrary(
                                s_Cur,
                                ec_CommonFunction,
                                this.Owner_MemoryApplication,
                                pg_ParsingLog,
                                log_Reports
                                );
                            if (log_Method.CanInfo() && pg_ParsingLog.BEnabled)
                            {
                                log_Method.WriteInfo_ToConsole(" d_ParsingLog=" + Environment.NewLine + pg_ParsingLog.ToString());
                            }

                            this.Owner_MemoryApplication.MemoryFunctions.AddFunction(sNameValue, ec_CommonFunction, log_Reports);
                        }
                        else
                        {
                            //
                            // エラー。
                            sErrorElementName = xTopNode.Name;
                            goto gt_Error_UndefinedChild;
                        }
                    }
                }
            }

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

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append("ユーザー定義関数設定ファイルへのパスにエラーがありました。");
                s.Newline();
                s.Newline();

                // ヒント

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

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append("ユーザー定義関数設定ファイルがありません。");
                s.Newline();
                s.Append("file=[");
                s.Append(filepathabsolute);
                s.Append("]");
                s.Newline();
                s.Newline();

                // ヒント

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

                StringBuilder s = new StringBuilder();
                s.Append("エラー:" + err_Excp.Message);
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                s.Append(Log_RecordReportsImpl.ToText_Configuration(filepath_Userfunctionconfig_Expr.Cur_Configuration));

                // ヒント

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

                StringBuilder s = new StringBuilder();
                s.Append("未定義の要素:" + sErrorElementName);
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                // ヒント

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Esempio n. 23
0
        //────────────────────────────────────────

        /// <summary>
        ///
        /// </summary>
        /// <param name="pcLst"></param>
        /// <param name="log_Reports"></param>
        protected void Execute6_Sub(
            ListBox pcLst,
            Log_Reports log_Reports
            )
        {
            //
            //
            //
            //()メソッド開始
            //
            //
            //
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute6_Sub", log_Reports);


            //
            //このイベントが起こったリストボックスの名前。
            //
            string sName_Control;

            if (pcLst is CustomcontrolListbox)
            {
                CustomcontrolListbox cclst = (CustomcontrolListbox)pcLst;
                sName_Control = cclst.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                log_Method.WriteDebug_ToConsole(sName_Control);
            }
            else
            {
                sName_Control = "";
            }


            //
            //
            //
            //現在、選択している項目。
            //
            //
            //
            DataRowView selectedDataRow = (DataRowView)pcLst.SelectedItem;

            if (null == selectedDataRow)
            {
                // 選択している行がなければ。

                // エラー。
                goto gt_Error_NoSelectedField;
            }


            //
            //
            //
            // 現在選択しているレコードの 指定フィールドの値を取得します。
            //
            //
            //
            {
                //指定されているフィールド名。
                string sName_Field;
                this.TrySelectAttribute(out sName_Field, Expression_Node_Function25Impl.PM_NAME_FIELD, EnumHitcount.One_Or_Zero, log_Reports);

                //そのフィールドの値。
                Int_HumaninputImpl cellData     = (Int_HumaninputImpl)selectedDataRow[sName_Field];
                string             sValue_Field = cellData.Text.Trim();
                //.WriteLine(this.GetType().Name + "#: ◆ fieldValue=[" + fieldValue + "]");

                //変数名。
                Expression_Node_String ec_Name_ArgDestinationVariable;
                this.TrySelectAttribute(out ec_Name_ArgDestinationVariable, Expression_Node_Function25Impl.PM_NAME_VAR_DESTINATION, EnumHitcount.One_Or_Zero, log_Reports);

                //指定した変数に、フィールド値を格納します。
                this.Owner_MemoryApplication.MemoryVariables.SetStringValue(
                    new XenonNameImpl(
                        ec_Name_ArgDestinationVariable.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports),
                        ec_Name_ArgDestinationVariable.Cur_Configuration
                        ),
                    sValue_Field,
                    true,
                    log_Reports
                    );
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_NoSelectedField:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, sName_Control, log_Reports);                  //コントロール名
                tmpl.SetParameter(2, pcLst.SelectedIndex.ToString(), log_Reports); //リストボックスの選択しているindex

                this.Owner_MemoryApplication.CreateErrorReport("Er:110010;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Esempio n. 24
0
        //────────────────────────────────────────

        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);
        }
Esempio n. 25
0
        //────────────────────────────────────────

        /// <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);
        }
Esempio n. 26
0
        /// <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);
        }
Esempio n. 27
0
        //────────────────────────────────────────

        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("終了└──┘");
            }
        }
Esempio n. 28
0
        //────────────────────────────────────────
        #endregion



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

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

            log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute5_Main", log_Reports);


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


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



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


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


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

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



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



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


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

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


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


                    this.Functionparameterset.SelectedProjectElement_Configurationtree = moAatoolxml_PrevEditorElm_OrNull;

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


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

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



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


                //(13b)「Aa_Editor.xml」読取。
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(13b)「Aa_Editor.xml」ファイルパス類推。");
                }
                //
                Expression_Node_Filepath ec_Fpath_AaEditorXml;
                if (log_Reports.Successful)
                {
                    //
                    // ツール設定ファイルで指定された値から、自動類推で設定されているはず。
                    //
                    Configurationtree_NodeFilepath cf_Fpath_EditorXml = new Configurationtree_NodeFilepathImpl(
                        "ツール設定ファイル[" + Application.StartupPath + System.IO.Path.DirectorySeparatorChar + ValuesAttr.S_FPATHR_AATOOLXML + "]の中の[" + sName_SelectingEditor + "]エディターへの指定から自動類推",
                        null);

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

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


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



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



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



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



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



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

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

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

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

                        ecList_Fpath_BackupRequest = null;
                    }
                }



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

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

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



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

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

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


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



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

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


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


                //(18)関数30「新規ウィンドウを開く」実行。引数には関数を2つ指定できる。
                if (log_Method.CanDebug(1))
                {
                    log_Method.WriteDebug_ToConsole("(18)関数30「新規ウィンドウを開く」実行。引数には関数を2つ指定できる。");
                }
                //
                {
                    Expression_Node_Function expr_Func = Collection_Function.NewFunction2(
                        Expression_Node_Function30Impl.NAME_FUNCTION, this, this.Cur_Configuration,
                        this.Owner_MemoryApplication, log_Reports);

                    {
                        //Expression_Node_Function30Impl f1 =

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

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

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


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


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



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

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

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



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

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

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



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

            return("");
        }
Esempio n. 29
0
        //────────────────────────────────────────

        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);
        }
Esempio n. 30
0
        //────────────────────────────────────────

        /// <summary>
        /// 「Aa_Files.csv」を読み取る要求を作成します。
        /// 旧名:ReadIndexRequest
        /// </summary>
        /// <param name="log_Reports"></param>
        /// <returns></returns>
        private Request_ReadsTable CreateReadRequest_AaFilesCsv(Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(1, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_Functions.Name_Library, this, "CreateReadRequest_AaFilesCsv", log_Reports);

            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole("「ファイルズ登録ファイル」を読取る要求を作成します。");
            }

            //
            // 「インデックス_テーブル」読取引数
            Request_ReadsTable forIndexTable_Request = new Request_ReadsTableImpl();

            string sTableName = this.GetSNameTableAafilescsv();

            //
            // 付けるテーブル名。
            forIndexTable_Request.Name_PutToTable = sTableName;

            //
            // 「レイアウト・テーブル」に設定。
            {
                forIndexTable_Request.Typedata = ValuesTypeData.S_TABLES_FILE;
            }

            // Aa_Files.csvテーブルのファイルパス。
            {
                // 変数名。
                Expression_Node_Filepath ec_Fpath_Aafilescsv;
                log_Reports.Log_Callstack.Push(log_Method, "⑦");
                ec_Fpath_Aafilescsv = this.Owner_MemoryApplication.MemoryVariables.GetExpressionfilepathByVariablename(
                    new Expression_Leaf_StringImpl(NamesVar.S_SP_FILES, null, new Configurationtree_NodeImpl(log_Method.Fullname, null)),
                    true, log_Reports);
                log_Reports.Log_Callstack.Pop(log_Method, "⑦");

                forIndexTable_Request.Expression_Filepath = ec_Fpath_Aafilescsv;

                //this.TrySelectAttribute(out ec_Atom, Ec_Sf22Impl.S_PM_NAME_VAR_FILEPATH, false, EnumHitcount.Unconstraint, log_Reports);
                //if (log_Reports.Successful)
                //{
                //    // ファイルパス。
                //    log_Reports.Log_Callstack.Push(log_Method, "②");
                //    forIndexTable_Request.Expression_Node_Filepath = this.Owner_MemoryApplication.MemoryVariables.GetExpressionfilepathByVariablename(
                //        ec_Fpath_Aafilescsv,
                //        true,
                //        log_Reports
                //        );
                //    log_Reports.Log_Callstack.Pop(log_Method, "②");
                //}
            }

            //
            // 日別バックアップ。
            forIndexTable_Request.IsDatebackupActivated = false;

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