Example #1
0
        //────────────────────────────────────────
        /// <summary>
        /// 『コントロール設定ファイル(F)』を読み取ります。
        /// 
        /// X→S、S→E、S→A。
        /// </summary>
        public void LoadFile(
            RecordUserformconfig record_Uf,
            Expression_Node_Filepath folderpath_Forms_Expr,
            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);
            //
            //

            // 手入力の Fcnf ファイルパス
            Configurationtree_NodeFilepath filepath_Control_Conf;
            record_Uf.TryGetFilepath_Configurationtree(out filepath_Control_Conf, NamesFld.S_FILE, false, this.Owner_MemoryApplication, log_Reports);
            string filepathHi_Uf = filepath_Control_Conf.GetHumaninput();

            string name_Control;
            record_Uf.TryGetString(out name_Control, NamesFld.S_NAME, true, "", this.Owner_MemoryApplication, log_Reports);

            // FILE フィールド(ファイルパス)が未指定なら、処理せず。
            if (log_Reports.Successful)
            {
                if ("" == filepathHi_Uf)
                {
                    goto gt_EndMethod;
                }
            }

            // (F) 絶対ファイルパス
            string filepathabs_Uf;
            {
                Utility_XmlToConfigurationtree_Usercontrolconfig to = new Utility_XmlToConfigurationtree_Usercontrolconfig();

                Expression_Node_FilepathImpl fpath_Expr = new Expression_Node_FilepathImpl(filepath_Control_Conf);

                filepathabs_Uf = to.GetSFilepath_UsercontrolconfigAbsolute(
                    fpath_Expr,//sl_record.Cf_File,
                    folderpath_Forms_Expr,
                    log_Reports
                    );
            }

            //
            // Fcnf ファイルパス
            Expression_Node_Filepath filepath_Uf_Expr;
            {
                Configurationtree_Node parent_Conf = new Configurationtree_NodeImpl(log_Method.Fullname + ".LoadFcnfFile record[" + filepath_Control_Conf.GetHumaninput() + "]", null);

                Configurationtree_NodeFilepath filepath_Conf = new Configurationtree_NodeFilepathImpl("ファイルパス出典未指定L09Mid_3", parent_Conf);
                filepath_Conf.InitPath(filepathHi_Uf, filepathabs_Uf, log_Reports);
                if (!log_Reports.Successful)
                {
                    // 既エラー。
                    goto gt_EndMethod;
                }

                filepath_Uf_Expr = new Expression_Node_FilepathImpl(filepath_Conf);
            }

            if ("" == filepathabs_Uf)
            {
                // コンポーネント設定ファイルへのパスが指定されていなければ、処理しません。
                goto gt_Error_Fpath;
            }

            Configurationtree_Node Usercontrolconfig_Conf = new Configurationtree_NodeImpl(NamesNode.S_CODEFILE_CONTROLS, filepath_Uf_Expr.Cur_Configuration);

            //
            // X → S
            if (log_Reports.Successful)
            {
                XmlToConfigurationtree_C11_Config to = new XmlToConfigurationtree_C11_ConfigImpl();
                to.XmlToConfigurationtree(
                    name_Control,
                    filepathHi_Uf,
                    filepathabs_Uf,
                    Usercontrolconfig_Conf,
                    folderpath_Forms_Expr,
                    owner_MemoryApplication,
                    log_Reports
                    );
            }

            //
            // (F) X → E
            this.XToEc_Usercontrolconfig(
                Usercontrolconfig_Conf,
                record_Uf,
                folderpath_Forms_Expr,
                log_Reports
                );

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
            gt_Error_Fpath:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("△情報53!", log_Method);

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append("コンポーネント設定ファイルへのパスが指定されていないので、");
                s.Newline();
                s.Newline();
                s.Append("処理しません。");
                s.Newline();
                s.Newline();

                // ヒント

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Example #2
0
        //────────────────────────────────────────
        /// <summary>
        /// 『コントロール設定ファイル(Fcnf)』を読み取ります。
        /// 
        /// X→S、S→E、X→A。
        /// </summary>
        public void XToEc_Usercontrolconfig(
            Configurationtree_Node cf_FcConfig,
            RecordUserformconfig fo_Record,
            Expression_Node_Filepath ec_Fopath_Forms,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "XToEc_Usercontrolcnf",log_Reports);

            //
            //

            //
            // 手入力の (Fcnf) ファイルパス
            Configurationtree_NodeFilepath cf_Fpath_Control;
            fo_Record.TryGetFilepath_Configurationtree(out cf_Fpath_Control, NamesFld.S_FILE, false, this.Owner_MemoryApplication, log_Reports);
            string sFpath_f = cf_Fpath_Control.GetHumaninput();

            //
            // コントロール名。
            string sName_Control;
            fo_Record.TryGetString(out sName_Control, NamesFld.S_NAME, true, "", this.Owner_MemoryApplication, log_Reports);

            //
            // (Fcnf) 絶対ファイルパス
            string sFpatha_f;
            {
                Utility_XmlToConfigurationtree_Usercontrolconfig to = new Utility_XmlToConfigurationtree_Usercontrolconfig();

                Expression_Node_FilepathImpl e_Fpath = new Expression_Node_FilepathImpl(cf_Fpath_Control);

                sFpatha_f = to.GetSFilepath_UsercontrolconfigAbsolute(
                    e_Fpath,//sl_record.Cf_File,
                    ec_Fopath_Forms,
                    log_Reports
                    );
            }

            //
            // X → S (データソース、データターゲットの変換)
            // S → E
            //
            if (log_Reports.Successful)
            {
                Utility_XmlToConfigurationtree_Usercontrolconfig to1 = new Utility_XmlToConfigurationtree_Usercontrolconfig();

                List<string> sList_ControlName = to1.GetList_NameControl(
                    sName_Control,
                    sFpath_f,
                    sFpatha_f,
                    cf_FcConfig,
                    ec_Fopath_Forms,
                    this.Owner_MemoryApplication,
                    log_Reports
                    );

                Log_TextIndented_ConfigurationtreeToExpressionImpl pg_ParsingLog = new Log_TextIndented_ConfigurationtreeToExpressionImpl();
                pg_ParsingLog.BEnabled = false;
                ConfigurationtreeToExpression_F10_ControlList to2 = new ConfigurationtreeToExpression_F10_ControlListImpl();
                to2.Translate(
                    sList_ControlName,
                    cf_FcConfig,
                    this.Owner_MemoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
                if (Log_ReportsImpl.BDebugmode_Static && pg_ParsingLog.BEnabled)
                {
                    log_Method.WriteInfo_ToConsole(" parsingLog=" + pg_ParsingLog.ToString());
                }
            }

            //
            // X → A (イベント_アクション_リストを構築します)
            //
            if (log_Reports.Successful)
            {
                //
                // (1)コントロールの名前を指定。
                //
                List<Usercontrol> list_Usercontrol;
                {
                    Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(null, fo_Record.Parent_TableUserformconfig.Cur_Configurationtree);
                    ec_Str.AppendTextNode(
                        sName_Control,
                        fo_Record.Parent_TableUserformconfig.Cur_Configurationtree,
                        log_Reports
                        );

                    list_Usercontrol = this.Owner_MemoryApplication.MemoryForms.GetUsercontrolsByName(
                        ec_Str,
                        true,
                        log_Reports
                        );
                }

                if (0 < list_Usercontrol.Count)
                {
                    Usercontrol uct = list_Usercontrol[0];

                    if (null != uct.ControlCommon.Configurationtree_Control)
                    {
                        //
                        // 「コントロール設定ファイル」のあったコントロールの
                        // 場合に限る。
                        //

                        List<Configurationtree_Node> cfList_Event = uct.ControlCommon.Configurationtree_Control.GetChildrenByNodename(NamesNode.S_EVENT, false, log_Reports);

                        foreach (Configurationtree_Node cf_Event in cfList_Event)
                        {
                            ConfigurationtreeToExpression_Event sToE_Event = new ConfigurationtreeToExpression_EventImpl();
                            sToE_Event.Configurationtree_Event = cf_Event;
                            Functionlist felist = uct.CreateFunctionlist(
                                sToE_Event,
                                this.Owner_MemoryApplication,
                                log_Reports
                                );
                            sToE_Event.Owner_Functionlist = felist;
                        }

                        //
                        // TODO:「dt」「txa」コントロールの場合、
                        // 値が変わったイベントの時に、「値確定」アクションが必ず起動するように
                        // 自動設定したい。
                        //

                    }
                }

            }

            log_Method.EndMethod(log_Reports);
        }