Exemplo n.º 1
0
 //────────────────────────────────────────
 /// <summary>
 /// コンストラクター。
 /// </summary>
 public MemoryApplicationImpl()
 {
     this.memoryBackup = new MemoryBackupImpl(this);
     this.memoryValidators = new MemoryValidatorsImpl(this);
     this.memoryTogethers = new MemoryTogethersImpl(this);
     this.memoryTables = new MemoryTablesImpl(this);
     this.memoryCodefiles = new MemoryCodefilesImpl(this);
     this.memoryFunctions = new MemoryFunctionsImpl(this);
     this.memoryVariables = new MemoryVariablesImpl(this);
     this.memoryForms = new MemoryFormsImpl(this);
     this.memoryStyles = new MemoryStylesImpl();
     this.memoryLogwriter = new MemoryLogwriterImpl();
     this.memoryBrushes = new MemoryBrushesImpl();
     this.memoryAatoolxml = new MemoryAatoolxmlImpl(this);
     this.memoryRecordset = new MemoryRecordsetImpl();
 }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
0
        //────────────────────────────────────────
        /// <summary>
        /// 『Aa_Tool.xml/<editor>要素』または、『Aa_Editor.xml/<ルート>要素』を読み取ります。
        /// <f-set-var>を読み取った場合、逐次、変数モデルに追加していきます。
        /// </summary>
        public void LoadFile_Aaxml(
            Expression_Node_Filepath ec_Fpath_Aaxml,
            MemoryVariables moVariables,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "LoadFile_Aaxml",log_Reports);

            string sFpatha;
            {
                sFpatha = ec_Fpath_Aaxml.Execute4_OnExpressionString(
                    EnumHitcount.Unconstraint,
                    log_Reports//out sErrorMsg
                    );//絶対ファイルパス
                if (!log_Reports.Successful)
                {
                    // 既エラー。
                    goto gt_EndMethod;
                }
            }

            System.Xml.XmlDocument xDoc = new System.Xml.XmlDocument();

            Exception err_Excp;
            try
            {

                xDoc.Load(sFpatha);

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

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

                foreach (XmlNode xNode_Fsetvar in xNl_Fsetvar)
                {
                    if (XmlNodeType.Element == xNode_Fsetvar.NodeType)
                    {
                        //<f-set-var>要素
                        XmlElement xFsetvar = (XmlElement)xNode_Fsetvar;

                        //name-var属性
                        string sNamevar = xFsetvar.GetAttribute(PmNames.S_NAME_VAR.Name_Attribute);

                        //folder属性
                        string sFolder = xFsetvar.GetAttribute(PmNames.S_FOLDER.Name_Attribute);

                        //value属性
                        string sValue = xFsetvar.GetAttribute(PmNames.S_VALUE.Name_Attribute);

                        //description属性
                        string sDescription = xFsetvar.GetAttribute(PmNames.S_DESCRIPTION.Name_Attribute);

                        Configurationtree_Node cf_Fsetvar = new Configurationtree_NodeImpl(NamesNode.S_F_SET_VAR,
                            null//todo:親ノード
                            );
                        cf_Fsetvar.Dictionary_Attribute.Set(PmNames.S_NAME_VAR.Name_Pm, sNamevar, log_Reports);
                        cf_Fsetvar.Dictionary_Attribute.Set(PmNames.S_FOLDER.Name_Pm, sFolder, log_Reports);
                        cf_Fsetvar.Dictionary_Attribute.Set(PmNames.S_VALUE.Name_Pm, sValue, log_Reports);
                        cf_Fsetvar.Dictionary_Attribute.Set(PmNames.S_DESCRIPTION.Name_Pm, sDescription, log_Reports);

                        this.Dictionary_Fsetvar_Configurationtree.List_Child.Add(cf_Fsetvar, log_Reports);

                        //変数への追加
                        {
                            if (
                                NamesVar.Test_Filepath(sNamevar)
                                )
                            {
                                // ファイルパスの場合
                                Configurationtree_NodeFilepath cf_Fpath = new Configurationtree_NodeFilepathImpl("name-var=[" + sNamevar + "]", ec_Fpath_Aaxml.Cur_Configuration);
                                cf_Fpath.InitPath(
                                    sValue,
                                    log_Reports
                                    );
                                if ("" != sFolder)
                                {
                                    Expression_Node_Filepath ec_Folder = moVariables.GetExpressionfilepathByVariablename(new Expression_Leaf_StringImpl(sFolder, ec_Fpath_Aaxml, cf_Fsetvar), true, log_Reports);

                                    if (log_Reports.Successful)
                                    {
                                        cf_Fpath.SetDirectory_Base(
                                            ec_Folder.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports)
                                            //sFolder
                                            );
                                    }
                                }

                                if (log_Reports.Successful)
                                {
                                    Expression_Node_Filepath ec_Fpath = new Expression_Node_FilepathImpl(cf_Fpath);
                                    moVariables.PutFilepath(
                                        sNamevar,
                                        ec_Fpath,
                                        true,
                                        log_Reports
                                        );
                                }
                            }
                            else
                            {
                                // ファイルパスでない場合
                                moVariables.PutString(
                                    sNamevar,
                                    sValue,
                                    log_Reports
                                    );
                            }

                        }
                    }

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

                if (!log_Reports.Successful)
                {
                    // 既エラー。
                    goto gt_EndMethod;
                }
            }
            catch (System.IO.IOException ex)
            {
                // 既エラー。
                err_Excp = ex;
                goto gt_Error_IOException;
            }

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

                StringBuilder s = new StringBuilder();
                s.Append("エディター設定ファイルが見つかりません。:" + err_Excp.Message);

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

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



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

        /// <summary>
        /// 『Aa_Tool.xml/<editor>要素』または、『Aa_Editor.xml/<ルート>要素』を読み取ります。
        /// <f-set-var>を読み取った場合、逐次、変数モデルに追加していきます。
        /// </summary>
        public void LoadFile_Aaxml(
            Expression_Node_Filepath ec_Fpath_Aaxml,
            MemoryVariables moVariables,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0);

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

            string sFpatha;

            {
                sFpatha = ec_Fpath_Aaxml.Execute4_OnExpressionString(
                    EnumHitcount.Unconstraint,
                    log_Reports //out sErrorMsg
                    );          //絶対ファイルパス
                if (!log_Reports.Successful)
                {
                    // 既エラー。
                    goto gt_EndMethod;
                }
            }

            System.Xml.XmlDocument xDoc = new System.Xml.XmlDocument();

            Exception err_Excp;

            try
            {
                xDoc.Load(sFpatha);

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


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

                foreach (XmlNode xNode_Fsetvar in xNl_Fsetvar)
                {
                    if (XmlNodeType.Element == xNode_Fsetvar.NodeType)
                    {
                        //<f-set-var>要素
                        XmlElement xFsetvar = (XmlElement)xNode_Fsetvar;

                        //name-var属性
                        string sNamevar = xFsetvar.GetAttribute(PmNames.S_NAME_VAR.Name_Attribute);

                        //folder属性
                        string sFolder = xFsetvar.GetAttribute(PmNames.S_FOLDER.Name_Attribute);

                        //value属性
                        string sValue = xFsetvar.GetAttribute(PmNames.S_VALUE.Name_Attribute);

                        //description属性
                        string sDescription = xFsetvar.GetAttribute(PmNames.S_DESCRIPTION.Name_Attribute);

                        Configurationtree_Node cf_Fsetvar = new Configurationtree_NodeImpl(NamesNode.S_F_SET_VAR,
                                                                                           null//todo:親ノード
                                                                                           );
                        cf_Fsetvar.Dictionary_Attribute.Set(PmNames.S_NAME_VAR.Name_Pm, sNamevar, log_Reports);
                        cf_Fsetvar.Dictionary_Attribute.Set(PmNames.S_FOLDER.Name_Pm, sFolder, log_Reports);
                        cf_Fsetvar.Dictionary_Attribute.Set(PmNames.S_VALUE.Name_Pm, sValue, log_Reports);
                        cf_Fsetvar.Dictionary_Attribute.Set(PmNames.S_DESCRIPTION.Name_Pm, sDescription, log_Reports);


                        this.Dictionary_Fsetvar_Configurationtree.List_Child.Add(cf_Fsetvar, log_Reports);

                        //変数への追加
                        {
                            if (
                                NamesVar.Test_Filepath(sNamevar)
                                )
                            {
                                // ファイルパスの場合
                                Configurationtree_NodeFilepath cf_Fpath = new Configurationtree_NodeFilepathImpl("name-var=[" + sNamevar + "]", ec_Fpath_Aaxml.Cur_Configuration);
                                cf_Fpath.InitPath(
                                    sValue,
                                    log_Reports
                                    );
                                if ("" != sFolder)
                                {
                                    Expression_Node_Filepath ec_Folder = moVariables.GetExpressionfilepathByVariablename(new Expression_Leaf_StringImpl(sFolder, ec_Fpath_Aaxml, cf_Fsetvar), true, log_Reports);

                                    if (log_Reports.Successful)
                                    {
                                        cf_Fpath.SetDirectory_Base(
                                            ec_Folder.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports)
                                            //sFolder
                                            );
                                    }
                                }

                                if (log_Reports.Successful)
                                {
                                    Expression_Node_Filepath ec_Fpath = new Expression_Node_FilepathImpl(cf_Fpath);
                                    moVariables.PutFilepath(
                                        sNamevar,
                                        ec_Fpath,
                                        true,
                                        log_Reports
                                        );
                                }
                            }
                            else
                            {
                                // ファイルパスでない場合
                                moVariables.PutString(
                                    sNamevar,
                                    sValue,
                                    log_Reports
                                    );
                            }
                        }
                    }


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



                if (!log_Reports.Successful)
                {
                    // 既エラー。
                    goto gt_EndMethod;
                }
            }
            catch (System.IO.IOException ex)
            {
                // 既エラー。
                err_Excp = ex;
                goto gt_Error_IOException;
            }

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

                StringBuilder s = new StringBuilder();
                s.Append("エディター設定ファイルが見つかりません。:" + err_Excp.Message);

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

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