示例#1
0
        //────────────────────────────────────────
        #endregion



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

        /// <summary>
        /// 妥当性判定のグローバル設定ファイルの読取り。
        /// </summary>
        /// <param name="sFpatha">絶対ファイルパス</param>
        /// <param name="log_Reports"></param>
        public void LoadFile(
            string sFpatha,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

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

            this.xToConfigurationtree_V.XmlToConfigurationtree(
                sFpatha,
                owner_MemoryApplication,
                log_Reports
                );

            Log_TextIndented_ConfigurationtreeToExpressionImpl pg_ParsingLog = new Log_TextIndented_ConfigurationtreeToExpressionImpl();

            pg_ParsingLog.BEnabled = false;
            this.givechapterandverseToExpression_V.Translate(
                owner_MemoryApplication,
                pg_ParsingLog,
                log_Reports
                );
            if (log_Method.CanInfo() && pg_ParsingLog.BEnabled)
            {
                log_Method.WriteInfo_ToConsole(" d_ParsingLog=" + Environment.NewLine + pg_ParsingLog.ToString());
            }

            //
            //
            log_Method.EndMethod(log_Reports);
        }
示例#2
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());
            }
        }
示例#3
0
        //────────────────────────────────────────
        #endregion



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

        /// <summary>
        /// Exe_2ActionImpl#SToFc で使用。
        /// </summary>
        /// <param name="s_Action"></param>
        /// <param name="bRequired"></param>
        /// <param name="log_Reports"></param>
        /// <returns></returns>
        public Expression_Node_Function Translate(
            Configurationtree_Node action_Conf,
            bool bRequired,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0);

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

            string sName_Fnc;

            if (action_Conf.Dictionary_Attribute.ContainsKey(PmNames.S_NAME.Name_Pm))
            {
                action_Conf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Fnc, true, log_Reports);
            }
            else
            {
                sName_Fnc = "<エラー:" + log_Method.Fullname + ">";
            }


            Expression_Node_Function expr_Func = Collection_Function.NewFunction2(sName_Fnc,
                                                                                  null, action_Conf, this.Owner_MemoryApplication, log_Reports);



            if (log_Reports.Successful)
            {
                if (null != expr_Func)
                {
                    Log_TextIndented_ConfigurationtreeToExpressionImpl pg_ParsingLog = new Log_TextIndented_ConfigurationtreeToExpressionImpl();
                    pg_ParsingLog.BEnabled = false;
                    expr_Func = ((Expression_Node_FunctionAbstract)expr_Func).Functiontranslatoritem.Translate(
                        sName_Fnc,
                        action_Conf,//これは生成時に指定できない?
                        pg_ParsingLog,
                        this.Owner_MemoryApplication,
                        log_Reports
                        );
                    if (Log_ReportsImpl.BDebugmode_Static && pg_ParsingLog.BEnabled)
                    {
                        log_Method.WriteInfo_ToConsole(" pg_ParsingLog=" + Environment.NewLine + pg_ParsingLog.ToString());
                    }
                }
            }

            goto gt_EndMethod;
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return(expr_Func);
        }
示例#4
0
        //────────────────────────────────────────

        /// <summary>
        /// デバッグ出力。
        /// </summary>
        public void WriteDebug_ToConsole()
        {
            Log_Method  log_Method             = new Log_MethodImpl(0);
            Log_Reports log_Reports_ThisMethod = new Log_ReportsImpl(log_Method);

            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "DebugWrite", log_Reports_ThisMethod);

            //
            //

            if (log_Method.CanInfo())
            {
                log_Method.WriteInfo_ToConsole(" ──────────登録関数名一覧");
                foreach (string sKey in this.dictionary_Item.Keys)
                {
                    log_Method.WriteInfo_ToConsole(" key=[" + sKey + "]");
                }
                log_Method.WriteInfo_ToConsole(" ──────────");
            }

            log_Method.EndMethod(log_Reports_ThisMethod);
        }
示例#5
0
        //────────────────────────────────────────

        private void Execute6_Sub(Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0);

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


            string sFlowSkip;

            this.TrySelectAttribute(out sFlowSkip, Expression_Node_Function04Impl.PM_FLOWSKIP, EnumHitcount.One_Or_Zero, log_Reports);
            if ("" != sFlowSkip.Trim())
            {
                // 処理をスキップします。
                goto gt_EndMethod;
            }


            //
            //
            //
            // テーブル名
            //
            //
            //
            List <string> sList_TableName = new List <string>();

            {
                string sTableNames;
                this.TrySelectAttribute(out sTableNames, Expression_Node_Function04Impl.PM_NAME_TABLE, EnumHitcount.One_Or_Zero, log_Reports);

                CsvTo_DataTableImpl reader        = new CsvTo_DataTableImpl();
                DataTable           tblNamesTable = reader.Read(
                    sTableNames
                    );

                foreach (DataRow row in tblNamesTable.Rows)
                {
                    foreach (string column in row.ItemArray)
                    {
                        sList_TableName.Add(column);
                    }
                }
            }

            foreach (string sTableName in sList_TableName)
            {
                Table_Humaninput o_Table;
                if (log_Reports.Successful)
                {
                    Expression_Node_String ec_ArgTableName;
                    this.TrySelectAttribute(out ec_ArgTableName, Expression_Node_Function04Impl.PM_NAME_TABLE, EnumHitcount.One_Or_Zero, log_Reports);

                    Expression_Node_StringImpl ec_TableName = new Expression_Node_StringImpl(this, ec_ArgTableName.Cur_Configuration);
                    ec_TableName.AppendTextNode(
                        sTableName,
                        this.Cur_Configuration,
                        log_Reports
                        );

                    // テーブル
                    o_Table = this.Owner_MemoryApplication.MemoryTables.GetTable_HumaninputByName(
                        ec_TableName,
                        true,
                        log_Reports
                        );
                }
                else
                {
                    o_Table = null;
                }

                string sCsvText;
                if (log_Reports.Successful)
                {
                    ToCsv_Table_Humaninput_Impl textizer = new ToCsv_Table_Humaninput_Impl();
                    sCsvText = textizer.ToCsvText(o_Table, log_Reports);
                    if (!log_Reports.Successful)
                    {
                        // 既エラー。
                        goto gt_EndMethod;
                    }
                }
                else
                {
                    sCsvText = null;
                }

                string sFpatha;//絶対ファイルパス
                if (log_Reports.Successful)
                {
                    // 正常時

                    //essageBox.Show("テーブルのtext=[" + csvText + "]", "デバッグ");

                    // TODO ファイルパスの妥当性判定も欲しい
                    sFpatha = o_Table.Expression_Filepath_ConfigStack.Execute4_OnExpressionString(
                        EnumHitcount.Unconstraint, log_Reports);
                    if (!log_Reports.Successful)
                    {
                        // 既エラー。
                        goto gt_EndMethod;
                    }
                }
                else
                {
                    sFpatha = "";
                }

                if (log_Reports.Successful)
                {
                    bool   bPopup;
                    string sPopup;
                    this.TrySelectAttribute(out sPopup, Expression_Node_Function04Impl.PM_POPUP, EnumHitcount.One_Or_Zero, log_Reports);

                    if ("block" == sPopup.Trim())
                    {
                        log_Method.WriteInfo_ToConsole("sPopup=[" + sPopup + "] ポップアップしません。");
                        bPopup = false;
                    }
                    else
                    {
                        bPopup = true;
                    }

                    CsvWriterImpl writer = new CsvWriterImpl();
                    writer.Write(
                        sCsvText, sFpatha, bPopup);
                }
            }

gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
示例#6
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("");
        }
示例#7
0
        //────────────────────────────────────────

        /// <summary>
        /// ファイルパス型変数を登録します。
        ///
        /// todo:文字列、ファイルパスの区別なく登録したい。
        /// </summary>
        /// <param name="sVariableName"></param>
        /// <param name="e_InitialValue"></param>
        /// <param name="bDuplicatedIsError">既に追加されているものを、更に追加しようとしたときにエラーにするなら真。</param>
        /// <param name="log_Reports"></param>
        public void PutFilepath(
            string sName_Variable,
            Expression_Node_Filepath ec_InitialValue,
            bool bDuplicatedIsError,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

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

            if (this.dictionaryExpression_Item.ContainsKey(sName_Variable))
            {
                if (bDuplicatedIsError)
                {
                    goto gt_Error_Duplicated;
                }
                else
                {
                    // 上書き
                    string sOldValue = "";
                    if (log_Method.CanInfo())
                    {
                        sOldValue = this.dictionaryExpression_Item[sName_Variable].Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                    }

                    this.dictionaryExpression_Item[sName_Variable] = ec_InitialValue;

                    if (log_Method.CanInfo())
                    {
                        log_Method.WriteInfo_ToConsole("変数[" + sName_Variable + "]は既に[" + sOldValue + "]と定義されていましたが、[" + ec_InitialValue.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "]で上書きしました。");
                    }
                }
            }
            else
            {
                this.dictionaryExpression_Item.Add(sName_Variable, ec_InitialValue);
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_Duplicated:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー922!", log_Method);
                r.Message = "変数[" + sName_Variable + "]は既に定義されていますが、さらに定義されました。";
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
示例#8
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);
        }
示例#9
0
        //────────────────────────────────────────

        private void Load_Form2_(Log_Reports pg_Logging)
        {
            //
            //
            //
            //()メソッド開始
            //
            //
            //
            Log_Method pg_Method = new Log_MethodImpl(0);

            pg_Method.BeginMethod(Info_Toolwindow.Name_Library, this, "Form1_Load", pg_Logging);



            StringBuilder sb = new StringBuilder();

            MemoryAatoolxmlDialog moAatoolxmlDialog;

            if (null != this.Owner_MemoryApplication)
            {
                moAatoolxmlDialog = this.Owner_MemoryApplication.MemoryForms.MemoryAatoolxmlDialog;
            }
            else
            {
                // ダミーを作成。
                pg_Method.WriteInfo_ToConsole("ダミー・MemoryAatoolxmlDialogを作成。");
                moAatoolxmlDialog = new MemoryAatoolxmlDialogImpl(this.Owner_MemoryApplication);
            }

            moAatoolxmlDialog.MemoryAatoolxml = new MemoryAatoolxmlImpl(this.Owner_MemoryApplication);


            Configurationtree_Node parent_Conf = new Configurationtree_NodeImpl("!ハードコーディング_" + this.GetType().Name + "#Form1_Load", null);


            // ツール設定ファイルへのパスは固定とします。
            Expression_Node_Filepath ec_Fpath_toolcnf;

            {
                Configurationtree_NodeFilepath cf_Fpath = new Configurationtree_NodeFilepathImpl("ファイルパス出典未指定L09TcDlg_3", parent_Conf);
                cf_Fpath.InitPath(
                    ValuesAttr.S_FPATHR_AATOOLXML,
                    pg_Logging);
                if (!pg_Logging.Successful)
                {
                    // 既エラー。
                    goto gt_EndMethod;
                }

                ec_Fpath_toolcnf = new Expression_Node_FilepathImpl(cf_Fpath);
            }


            //
            //
            //
            //「ツール設定ファイル」読取り
            //
            //
            //
            moAatoolxmlDialog.MemoryAatoolxml.LoadFile(ec_Fpath_toolcnf, pg_Logging);
            if (!pg_Logging.Successful)
            {
                // 既エラー。
                goto gt_EndMethod;
            }

            {
                UsercontrolListbox uctLst = (UsercontrolListbox)this.UctlstNameProject;
                uctLst.Clear();
                foreach (string sName_Project in moAatoolxmlDialog.MemoryAatoolxml.Dictionary_Editor.Dictionary_Item.Keys)
                {
                    uctLst.Items.Add(sName_Project);
                }

                if ("" == moAatoolxmlDialog.Name_SelectedEditor)
                {
                    // 選択プロジェクト名が指定されていなければ。

                    if (0 < uctLst.Items.Count)
                    {
                        // 先頭の要素を選択します。
                        uctLst.ControlCommon.BAutomaticinputting = true;
                        uctLst.SelectedIndex = 0;
                        uctLst.ControlCommon.BAutomaticinputting = false;
                    }
                    else
                    {
                        // 非選択にします。
                        uctLst.ControlCommon.BAutomaticinputting = true;
                        uctLst.SelectedIndex = -1;
                        uctLst.ControlCommon.BAutomaticinputting = false;
                    }
                }
                else
                {
                    // 選択プロジェクト名が指定されていれば。

                    int selectedIndex = uctLst.Items.IndexOf(moAatoolxmlDialog.Name_SelectedEditor);

                    uctLst.ControlCommon.BAutomaticinputting = true;
                    uctLst.SelectedIndex = selectedIndex;
                    uctLst.ControlCommon.BAutomaticinputting = false;
                }
            }

            sb.Append("[◆コマンドライン引数]");
            sb.Append(Environment.NewLine);

            // コマンドライン引数を取得します。
            string[] args = System.Environment.GetCommandLineArgs();

            //コマンドライン引数の表示
            int n = 1;

            foreach (string sArg in args)
            {
                sb.Append("【");
                sb.Append(n);
                sb.Append("】");
                sb.Append(sArg);
                sb.Append(Environment.NewLine);
            }

            this.pctxtInformation.Text = sb.ToString();

            Expression_Node_String parent_Expression_Null = null;

            //  ■
            //■  ■ 「変数書出ボタン」のイベント設定
            //  ■
            {
                Expression_Node_Function expr_Func = Collection_Function.NewFunction2(Expression_Node_Function45Impl.NAME_FUNCTION,
                                                                                      parent_Expression_Null, parent_Conf, this.Owner_MemoryApplication, pg_Logging);
                expr_Func.SetAttribute(Expression_Node_Function28Impl.PM_MESSAGE, new Expression_Leaf_StringImpl("変数出力試し", null, parent_Conf), pg_Logging);
            }

            //  ■
            //■  ■ 「フォームCSV書出ボタン」のイベント設定
            //  ■
            {
                Expression_Node_Function expr_Func = Collection_Function.NewFunction2(Expression_Node_Function46Impl.NAME_FUNCTION,
                                                                                      parent_Expression_Null, parent_Conf, this.Owner_MemoryApplication, pg_Logging);
                expr_Func.SetAttribute(Expression_Node_Function28Impl.PM_MESSAGE, new Expression_Leaf_StringImpl("フォームCSV出力試し", null, parent_Conf), pg_Logging);

                this.uctButton2.UsercontroleventhandlerClick += new EventHandler(expr_Func.Execute4_OnOEa);
            }

            goto gt_EndMethod;
            //
            //
gt_EndMethod:
            pg_Method.EndMethod(pg_Logging);
        }