Example #1
0
        //────────────────────────────────────────
        #endregion



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

        /// <summary>
        /// イベント アクション リストを作成します。
        /// </summary>
        /// <param nFcName="eventName"></param>
        /// <param nFcName="nActionSuper"></param>
        /// <param nFcName="log_Reports"></param>
        public Functionlist CreateFunctionlist(
            ConfigurationtreeToExpression_Event sToE_Event,
            MemoryApplication owner_MemoryApplication,
            Log_Reports log_Reports
            )
        {
            Log_Method pg_Method = new Log_MethodImpl();

            pg_Method.BeginMethod(Info_Controls.Name_Library, this, "CreateFunctionlist", log_Reports);
            //
            //
            Functionlist fw_Result = null;

            //.WriteLine(this.GetType().Name + "#CreateEventActionList: <構築>【開始】 イベントに対応ついたアクションリストを追加します。 (ピクチャー)");

            switch (sToE_Event.Name)
            {
            case NamesSe.S_LOAD:
            {
                //
                // このコントロールの「アプリケーション起動時」。
                //
                //  (NActionPerformEnum.O_EA)
                //

                //
                // 無視します。
                //
            }
            break;

            default:
                goto gt_Error_NotSupportEvent;
            }


            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_NotSupportEvent:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, this.GetType().Name, log_Reports);                                                            //クラス名
                tmpl.SetParameter(2, sToE_Event.Name, log_Reports);                                                                //イベント名
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(sToE_Event.Configurationtree_Event), log_Reports); //位置パンくずリスト

                owner_MemoryApplication.CreateErrorReport("Er:525;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            pg_Method.EndMethod(log_Reports);
            return(fw_Result);
        }
Example #2
0
        /// <summary>
        /// レコードセットの取得。
        /// </summary>
        /// <param name="eName"></param>
        /// <param name="log_Reports"></param>
        /// <returns>該当がなければヌル。</returns>
        public RecordSet Get(Expression_Node_String ec_Name,
                             MemoryApplication memoryApplication,
                             Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_Expr.Name_Library, this, "Get", log_Reports);
            //
            //

            string sName = ec_Name.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports).Trim();


            RecordSet nResult;

            try
            {
                //ystem.Console.WriteLine(Info_N.LibraryName + ":" + this.GetType().Name + "#Remove: 【レコードセット削除】sName=[" + sName + "]");
                nResult = this.dictionary_Recordset[sName];
            }
            catch (KeyNotFoundException ex)
            {
                nResult = null;

                {
                    Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                    tmpl.SetParameter(1, sName, log_Reports);                                                                 //名前
                    tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(ec_Name.Cur_Configuration), log_Reports); //設定位置パンくずリスト
                    tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Exception(ex), log_Reports);                            //例外メッセージ

                    memoryApplication.CreateErrorReport("Er:6043;", tmpl, log_Reports);
                }
            }
            catch (Exception ex)
            {
                nResult = null;

                {
                    Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                    tmpl.SetParameter(1, sName, log_Reports);                                                                 //名前
                    tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(ec_Name.Cur_Configuration), log_Reports); //設定位置パンくずリスト
                    tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Exception(ex), log_Reports);                            //例外メッセージ

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

            //
            //
            //
            //

            log_Method.EndMethod(log_Reports);
            return(nResult);
        }
Example #3
0
        //────────────────────────────────────────

        /// <summary>
        /// 必須属性の有無テスト。
        /// </summary>
        /// <param name="x_Cur"></param>
        /// <param name="s_Cur"></param>
        /// <param name="log_Reports"></param>
        protected virtual void Test_Attributes(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, "Test_Attributes", log_Reports);

            //
            // 必須属性の有無テスト
            //
            string err_SName_Attr;

            if (null != this.List_SName_RequiredPm)
            {
                foreach (string sName_Attr in this.List_SName_RequiredPm)
                {
                    if (!cur_Cf.Dictionary_Attribute.ContainsKey(sName_Attr))
                    {
                        // エラー。
                        err_SName_Attr = sName_Attr;
                        goto gt_Error_NothingAttr;
                    }
                }
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_NothingAttr:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, cur_X.Name, log_Reports);                                         //要素名
                tmpl.SetParameter(2, err_SName_Attr, log_Reports);                                     //属性名
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports); //設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:8009;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Example #4
0
        //────────────────────────────────────────

        protected void TestExists_EmptyFilePath(
            string sArgName,
            Expression_Node_Filepath ec_Fpath,
            string sFpath_SelectedProject,
            Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

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

            if (null == ec_Fpath)
            {
                goto gt_Error_NullFpath;
            }
            else if ("" == ec_Fpath.Humaninput)
            {
                goto gt_Error_NoData;
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_NullFpath:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, sFpath_SelectedProject, log_Reports); //選択したエディター・フォルダーのファイルパス
                tmpl.SetParameter(2, sArgName, log_Reports);               //引数名

                this.Owner_MemoryApplication.CreateErrorReport("Er:110005;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_NoData:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, sArgName, log_Reports);                                                               //引数名
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(ec_Fpath.Cur_Configuration), log_Reports); //設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:110006;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Example #5
0
        //────────────────────────────────────────
        #endregion



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

        /// <summary>
        /// レコードセットの追加。
        /// </summary>
        /// <param name="eName"></param>
        /// <param name="recordSet"></param>
        /// <param name="log_Reports"></param>
        public void Add(
            Expression_Node_String ec_Name, RecordSet recordSet,
            MemoryApplication memoryApplication,
            Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_Expr.Name_Library, this, "Add", log_Reports);
            //
            //

            string sName = ec_Name.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports).Trim();

            try
            {
                this.dictionary_Recordset.Add(sName, recordSet);

                //// debug: 追加したレコードセットの内容。
                //{
                //    ystem.Console.WriteLine(Info_N.LibraryName + ":" + this.GetType().Name + "#Add: 追加したレコードセットの内容"+
                //        " fld=["+oRecordSet.NField.E_Execute(EnumHitcount.Unconstraint, log_Reports)+"]" +
                //        " lookup-value=["+oRecordSet.NLookupValue.E_Execute(EnumHitcount.Unconstraint, log_Reports)+"]" +
                //        " required=[" + oRecordSet.NRequired.E_Execute(EnumHitcount.Unconstraint, log_Reports) + "]" +
                //        " from=[" + oRecordSet.NFrom.E_Execute(EnumHitcount.Unconstraint, log_Reports) + "]" +
                //        " description=[" + oRecordSet.NDescription.E_Execute(EnumHitcount.Unconstraint, log_Reports) + "]" +
                //        " Storage=[" + oRecordSet.NStorage.E_Execute(EnumHitcount.Unconstraint, log_Reports) + "]"
                //        );

                //}
            }
            catch (ArgumentException ex)
            {
                //return;

                {
                    Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                    tmpl.SetParameter(1, sName, log_Reports);                                                                 //名前
                    tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(ec_Name.Cur_Configuration), log_Reports); //設定位置パンくずリスト
                    tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Exception(ex), log_Reports);                            //例外メッセージ

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

            //
            //
            //
            //

            log_Method.EndMethod(log_Reports);
        }
Example #6
0
        /// <summary>
        /// レコードセットの削除。
        /// </summary>
        /// <param name="eStorage"></param>
        /// <param name="log_Reports"></param>
        public void Remove(Expression_Node_String ec_Storage,
                           MemoryApplication memoryApplication,
                           Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_Expr.Name_Library, this, "Remove", log_Reports);
            //
            //

            string sStorage = ec_Storage.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports).Trim();

            Exception err_Excp;

            try
            {
                this.dictionary_Recordset.Remove(sStorage);

                // #デバッグ中
                System.Console.WriteLine(Info_Expr.Name_Library + ":" + this.GetType().Name + "#Remove: 【レコードセット削除】sName=[" + sStorage + "]");
            }
            catch (Exception ex)
            {
                err_Excp = ex;
                goto gt_Error_Exception;
            }


            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_Exception:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, sStorage, log_Reports);                                                                 //名前
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(ec_Storage.Cur_Configuration), log_Reports); //設定位置パンくずリスト
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Exception(err_Excp), log_Reports);                         //例外メッセージ

                memoryApplication.CreateErrorReport("Er:6045;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Example #7
0
        //────────────────────────────────────────

        protected virtual string E_Execute_NoUse(
            Expression_Node_Function ec_CommonFunction,
            string sLibraryName,
            string sClassName,
            string sMethodName,
            EnumEventhandler enumEH,
            Configuration_Node conf_Node,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_Expr.Name_Library, this, "E_Execute_NoUse", log_Reports);
            //
            //

            string sResult = "";

            //#このルートはエラー
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, log_Method.Fullname, log_Reports); //問題の起こったメソッド
                tmpl.SetParameter(2, enumEH.ToString(), log_Reports);   //イベントハンドラー

                string sFncName0;
                ec_CommonFunction.TrySelectAttribute(out sFncName0, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);
                tmpl.SetParameter(3, sFncName0, log_Reports);                                             //関数名
                tmpl.SetParameter(4, Log_RecordReportsImpl.ToText_Configuration(conf_Node), log_Reports); //設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:6039;", tmpl, log_Reports);
            }

            //            ((E_SysFncAbstract)this.E_SystemAction).EventMonitor.BNowActionWorking = false;

            //
            //
            log_Method.EndMethod(log_Reports);
            return(sResult);
        }
Example #8
0
        //────────────────────────────────────────

        public override void XmlToConfigurationtree(
            XmlElement cur_X,                 //<key-event>
            Configurationtree_Node parent_Cf, //<control>
            MemoryApplication memoryApplication,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "XmlToConfigurationtree", log_Reports);
            //
            //


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


            //
            //
            //
            // 属性
            //
            //
            //
            this.Parse_SAttribute(cur_X, cur_Cf, memoryApplication, log_Reports);


            //
            // コントロールの、key-eventリストに、S_KeyEventを追加。
            //
            if (log_Reports.Successful)
            {
                XmlToConfigurationtree_C15_Elm to = XmlToConfigurationtree_Collection.GetTranslatorByNodeName(NamesNode.S_KEY_ACTION, log_Reports);

                //List<string> li = new List<string>();
                //li.Add(PmNames.TYPE.Name_Pm);
                //li.Add(PmNames.S_DESCRIPTION.Name_Attribute);
                //xToS.List_AttrName = li;

                //
                //
                // fncノードを列挙
                //
                XmlNodeList child_XNl = cur_X.ChildNodes;
                foreach (XmlNode xChild in child_XNl)
                {
                    if (XmlNodeType.Element == xChild.NodeType)
                    {
                        if (NamesNode.S_FNC == xChild.Name)
                        {
                            XmlElement xFnc = (XmlElement)xChild;

                            to.XmlToConfigurationtree(
                                xFnc,
                                cur_Cf,
                                memoryApplication,
                                log_Reports
                                );
                        }
                        else
                        {
                            //#連続エラー
                            {
                                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                                tmpl.SetParameter(1, xChild.Name, log_Reports);                                        //ノード名
                                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports); //設定位置パンくずリスト

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



            //
            //
            //
            // 親へ連結
            //
            //
            //
            if (log_Reports.Successful)
            {
                parent_Cf.List_Child.Add(cur_Cf, log_Reports);
            }



            //
            //
            //
            //
            log_Method.EndMethod(log_Reports);
        }
Example #9
0
        //────────────────────────────────────────
        #endregion



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

        /// <summary>
        /// ユーザー定義プログラムの実行。
        /// </summary>
        /// <param name="hits"></param>
        /// <param name="log_Reports"></param>
        /// <returns></returns>
        public override string Execute4_OnExpressionString(
            EnumHitcount hits,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_Expr.Name_Library, this, "Execute4_OnExpressionString", log_Reports);
            //
            //

            //
            // 子要素を実行し、文字列連結。
            string sFormValue;
            {
                StringBuilder sb = new StringBuilder();
                List <Expression_Node_String> ecList_Child = this.List_Expression_Child.SelectList(//Nv_Elem
                    EnumHitcount.Unconstraint,
                    log_Reports
                    );

                //// debug:
                //if (true)
                //{
                //    ystem.Console.WriteLine(Info_N.LibraryName + ":" + this.GetType().Name + "#E_Execute: childNList.Count=[" + childNList.Count + "]");
                //}

                foreach (Expression_Node_String ec_11 in ecList_Child)
                {
                    //
                    // <f-cell>要素を想定。
                    sb.Append(ec_11.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                }
                sFormValue = sb.ToString();
            }


            string sResult;

            if (log_Reports.Successful)//無限ループ防止
            {
                string sType;
                {
                    bool bHit = this.TrySelectAttribute(out sType, PmNames.S_TYPE.Name_Pm, EnumHitcount.One, log_Reports);
                }

                if ("chk" == sType.Trim())
                {
                    //
                    // true/false型のチェックボックスの場合

                    bool bValue;
                    if ("" == sFormValue)
                    {
                        //
                        // 空文字列なら、真。
                        sResult = "true";
                    }
                    else if (Boolean.TryParse(sFormValue, out bValue))
                    {
                        if (bValue)
                        {
                            //
                            // "true" が入っていたら、偽。
                            sResult = "false";
                        }
                        else
                        {
                            //
                            // "false" が入っていたら、真。
                            sResult = "true";
                        }
                    }
                    else
                    {
                        //
                        // 判定不能なら。
                        goto gt_Error_ParseFailure01;
                    }
                }
                else if ("chk01" == sType.Trim())
                {
                    //
                    // 0/1型のチェックボックスの場合

                    int nValue;
                    if ("" == sFormValue)
                    {
                        //
                        // 空文字列なら、真。
                        sResult = "true";
                    }
                    else if (int.TryParse(sFormValue, out nValue))
                    {
                        if (0 == nValue)
                        {
                            //
                            // 0 が入っていたら、真。
                            sResult = "true";
                        }
                        else
                        {
                            //
                            // それ以外は、偽。
                            sResult = "false";
                        }
                    }
                    else
                    {
                        //
                        // 判定不能なら。
                        goto gt_Error_ParseFailure02;
                    }
                }
                else
                {
                    if ("" == sFormValue)
                    {
                        sResult = "true";
                    }
                    else
                    {
                        sResult = "false";
                    }
                }
            }
            else
            {
                sResult = "false";
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_ParseFailure01:
            sResult = "false";
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, sFormValue, log_Reports);                                                         //コントロールの値
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(this.Cur_Configuration), log_Reports); //設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:6035;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_ParseFailure02:
            sResult = "false";
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, sFormValue, log_Reports);                                                         //コントロールの値
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(this.Cur_Configuration), log_Reports); //設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:6036;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return(sResult);
        }
Example #10
0
        //────────────────────────────────────────

        public static Usercontrol GetUsercontrol(
            Configurationtree_Node cf_CurTree,
            MemoryApplication memoryApplication,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_XmlToConf.Name_Library, "Util_XmlToConfigurationtree_NodeImpl", "GetUsercontrol", log_Reports);

            Usercontrol fcUc = null;
            string      sFcName;
            string      err_FcName;

            //
            // 対応するコントロール。
            List <Usercontrol> list_Usercontrol;

            {
                // コントロール名。
                Expression_Node_StringImpl ec_String = new Expression_Node_StringImpl(null, memoryApplication.MemoryValidators.Configurationtree_Validatorsconfig);
                {
                    PmName pmName = PmNames.S_NAME;
                    if (cf_CurTree.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                    {
                        cf_CurTree.Dictionary_Attribute.TryGetValue(pmName, out sFcName, true, log_Reports);

                        ec_String.AppendTextNode(
                            sFcName,
                            memoryApplication.MemoryValidators.Configurationtree_Validatorsconfig,
                            log_Reports
                            );
                    }
                    else
                    {
                        //
                        // エラー。
                        err_FcName = "<コントロール名無し>";
                        goto gt_Error_NotFoundFc02;
                    }
                }


                list_Usercontrol = memoryApplication.MemoryForms.GetUsercontrolsByName(
                    ec_String,
                    true,
                    log_Reports
                    );
            }

            if (list_Usercontrol.Count < 1)
            {
                //
                // エラー。
                err_FcName = sFcName;
                goto gt_Error_NotFoundFc02;
            }
            else
            {
                fcUc = list_Usercontrol[0];
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_NotFoundFc02:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_FcName, log_Reports);                                                                                                        //関数名
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(memoryApplication.MemoryValidators.Configurationtree_Validatorsconfig), log_Reports); //設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:8001;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return(fcUc);
        }
Example #11
0
        //────────────────────────────────────────

        public void XmlToConfigurationtree(
            XmlElement cur_X,
            Configurationtree_Node cur_Cf,
            MemoryApplication memoryApplication,
            Log_Reports log_Reports
            )
        {
            //
            //
            //
            //()メソッド開始
            //
            //
            //
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "XmlToConfigurationtree", log_Reports);


            //
            //
            //
            //()子要素
            //
            //
            //
            XmlNodeList child_XNl = cur_X.ChildNodes;

            string     err_SName_CurNode = "";
            XmlElement err_XElm          = null;
            Exception  err_Excp          = null;

            foreach (XmlNode child_XNode in child_XNl)
            {
                if (XmlNodeType.Element == child_XNode.NodeType)
                {
                    XmlElement xChild = (XmlElement)child_XNode;

                    string sName_Node = xChild.Name;


                    XmlToConfigurationtree_C15_Elm to;

                    bool bHit = this.Dictionary_XmlToConfigurationtree_ElmP.ContainsKey(sName_Node);
                    if (!bHit)
                    {
                        // 未該当=エラー
                        err_SName_CurNode = cur_X.Name;
                        err_XElm          = xChild;
                        goto gt_Error_UndefinedElement;
                    }

                    to = this.Dictionary_XmlToConfigurationtree_ElmP[sName_Node];

                    if (log_Reports.Successful)
                    {
                        try
                        {
                            to.XmlToConfigurationtree(xChild, cur_Cf, memoryApplication, log_Reports);
                        }
                        catch (Exception ex)
                        {
                            //
                            // エラー。
                            err_XElm = xChild;
                            err_Excp = ex;
                            goto gt_Error_Exception;
                        }
                    }
                }
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_UndefinedElement:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_XElm.Name, log_Reports);     //子要素名
                tmpl.SetParameter(2, err_SName_CurNode, log_Reports); //自要素名

                StringBuilder s1 = new StringBuilder();
                foreach (string key in this.Dictionary_XmlToConfigurationtree_ElmP.Keys)
                {
                    s1.Append(" <");
                    s1.Append(key);
                    s1.Append(">");
                    s1.Append(Environment.NewLine);
                }
                tmpl.SetParameter(3, s1.ToString(), log_Reports);                                      //要素リスト

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

                memoryApplication.CreateErrorReport("Er:8033;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_Exception:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_XElm.Name, log_Reports);                                      //要素名
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports); //設定位置パンくずリスト
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Exception(err_Excp), log_Reports);   //例外メッセージ

                memoryApplication.CreateErrorReport("Er:8034;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Example #12
0
        //────────────────────────────────────────
        #endregion



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

        /// <summary>
        /// フィールドから値を取得。
        ///
        /// TODO:セルタイプ以外にも対応したい。
        /// </summary>
        /// <param name="RecordSet_toSave">ヌル不可</param>
        /// <param name="eSelectedFldName">選択フィールド</param>
        /// <param name="RecordSetSaveTo_or_null"></param>
        /// <param name="log_Reports"></param>
        /// <returns>行リスト<列リスト></returns>
        public List <List <string> > P5_Select_CellType(
            RecordSet dst_Rs_toSave,
            Selectstatement selectSt_ToSave,
            Expressionv_4ASelectRecord ecv_selRec_OrNull, //where
            Configuration_Node parent_Cf_Query,           //this
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_Expr.Name_Library, this, "P5_Select", log_Reports);
            //
            //

            List <List <string> > reslt_sFieldListList = new List <List <string> >();



            //
            // (1)テーブル
            Table_Humaninput o_Table;

            {
                o_Table = this.Owner_MemoryApplication.MemoryTables.GetTable_HumaninputByName(
                    selectSt_ToSave.Expression_From, true, log_Reports);

                if (null == o_Table)
                {
                    // エラー。
                    goto gt_Error_NullTable;
                }
            }
            if (!log_Reports.Successful)
            {
                //
                // エラーが出ていたら、さっさと抜ける。
                goto gt_EndMethod;
            }


            //
            //
            //
            //
            // 条件
            //
            //
            //
            //
            Fielddefinition keyFldDefinition     = null;
            string          err_SSelectedFldName = null;
            Exception       err_Exception        = null;
            Recordcondition err_Recordcondition  = null;

            foreach (Recordcondition recCond in selectSt_ToSave.List_Recordcondition)
            {
                err_Recordcondition = recCond;

                //
                // (2)検索のキーフィールドの定義を調べます。

                // キーフィールド定義
                {
                    List <string> sList_KeyFldName;
                    {
                        // 要素数1個。
                        sList_KeyFldName = new List <string>();
                        sList_KeyFldName.Add(recCond.Name_Field);
                    }

                    RecordFielddefinition recordFielddefinition;
                    bool bHit = o_Table.TryGetFieldDefinitionByName(
                        out recordFielddefinition,
                        sList_KeyFldName,
                        false,
                        log_Reports
                        );
                    if (!log_Reports.Successful || !bHit)
                    {
                        // エラー
                        goto gt_EndMethod;
                    }

                    keyFldDefinition = recordFielddefinition.ValueAt(0);
                }



                //
                // (3)選択対象のフィールドの定義を調べます。
                RecordFielddefinition recordFieldDefinition_Selected;
                {
                    bool bHit = o_Table.TryGetFieldDefinitionByName(
                        out recordFieldDefinition_Selected,
                        selectSt_ToSave.List_SName_SelectField,
                        true,
                        log_Reports
                        );
                    if (!log_Reports.Successful)
                    {
                        // エラー
                        goto gt_EndMethod;
                    }
                }



                //
                // (4)
                if (null == keyFldDefinition)
                {
                    // エラー。
                    goto gt_Error_NullKeyFldDefinition;
                }


                List <string> list_FldImpl3 = new List <string>();

                recordFieldDefinition_Selected.ForEach(delegate(Fielddefinition fielddefinition_Selected, ref bool isBreak2, Log_Reports log_Reports2)
                {
                    string sSelectField = fielddefinition_Selected.Name_Trimupper;

                    //
                    // (5)
                    if (null == fielddefinition_Selected)
                    {
                        // エラー。
                        isBreak2 = true;
                        goto gt_Error_NullSelectedFldDefinition;
                    }

                    //
                    // (6)欠番

                    //
                    // (7)
                    if (null == dst_Rs_toSave || dst_Rs_toSave.List_Field.Count < 1)
                    {
                        bool bExpectedValueRequired;
                        {
                            bool parseSuccessful = bool.TryParse(selectSt_ToSave.Required, out bExpectedValueRequired);
                        }

                        //
                        // 条件
                        //
                        string name_KeyField;
                        Fielddefinition fielddefinition_Key;
                        string value_Expected;
                        P2_ReccondImpl sel2 = new P2_ReccondImpl();
                        sel2.GetFirstAwhrReccond(
                            out name_KeyField,
                            out fielddefinition_Key,
                            out value_Expected,
                            selectSt_ToSave.List_Recordcondition,
                            o_Table,
                            log_Reports
                            );
                        List <DataRow> dst_Row = new List <DataRow>();

                        SelectPerformerImpl sp = new SelectPerformerImpl();
                        sp.Select(
                            out dst_Row,
                            name_KeyField,
                            value_Expected,
                            bExpectedValueRequired,
                            fielddefinition_Key,
                            o_Table.DataTable,
                            parent_Cf_Query,
                            log_Reports
                            );

                        dst_Rs_toSave.AddList(dst_Row, log_Reports);
                        if (!log_Reports.Successful)
                        {
                            // 既エラー。
                            isBreak2 = true;
                            goto gt_EndInnermethod;
                        }

                        if (null == dst_Rs_toSave)
                        {
                            // (7-2)

                            isBreak2 = true;
                            goto gt_Error_UndefinedPrimitiveType;
                        }
                    }
                    else
                    {
                        // レコードセットは、一時記憶から取得済み。
                    }


                    // (8)
                    if (log_Reports.Successful)
                    {
                        // キー_フィールドの型別に、処理。
                        switch (keyFldDefinition.Type_Field)
                        {
                        case EnumTypeFielddefinition.String:
                            {
                                // (8-1)キーが string型フィールドなら

                                // この行の、選択対象のフィールドの値。

                                foreach (Dictionary <string, Value_Humaninput> record in dst_Rs_toSave.List_Field)
                                {
                                    // 値。

                                    Value_Humaninput selectedCellData;
                                    try
                                    {
                                        selectedCellData = (Value_Humaninput)record[sSelectField];
                                    }
                                    catch (KeyNotFoundException ex)
                                    {
                                        selectedCellData     = null;
                                        err_SSelectedFldName = sSelectField;
                                        err_Exception        = ex;
                                        isBreak2             = true;
                                        goto gt_Error_NotFoundFld;
                                    }

                                    Expression_Node_String ec_SelectedValue = this.GetSelectedFieldValue(
                                        fielddefinition_Selected,
                                        selectedCellData,
                                        parent_Cf_Query,
                                        log_Reports
                                        );

                                    list_FldImpl3.Add(ec_SelectedValue.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                                }
                            }
                            break;

                        case EnumTypeFielddefinition.Int:
                            {
                                //
                                // (8-2) キー・フィールドが int型の場合。

                                foreach (Dictionary <string, Value_Humaninput> record in dst_Rs_toSave.List_Field)
                                {
                                    // この行の、選択対象のフィールドの値。

                                    if (null != log_Reports && !log_Reports.Successful)    //無限ループ防止
                                    {
                                        // エラー発生時は無視。
                                    }
                                    else
                                    {
                                        Value_Humaninput selectedCellData;
                                        try
                                        {
                                            selectedCellData = record[sSelectField];
                                        }
                                        catch (KeyNotFoundException ex)
                                        {
                                            selectedCellData     = null;
                                            err_SSelectedFldName = sSelectField;
                                            err_Exception        = ex;
                                            isBreak2             = true;
                                            goto gt_Error_NotFoundFld;
                                        }

                                        {
                                            // 値。
                                            Expression_Node_String ec_SelectedValue = this.GetSelectedFieldValue(
                                                fielddefinition_Selected,
                                                selectedCellData,
                                                parent_Cf_Query,
                                                log_Reports
                                                );

                                            list_FldImpl3.Add(ec_SelectedValue.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                                        }
                                    }
                                }
                            }
                            break;

                        case EnumTypeFielddefinition.Bool:
                            {
                                // (8-3) キーが、bool型フィールド

                                // 値。
                                foreach (Dictionary <string, Value_Humaninput> record in dst_Rs_toSave.List_Field)
                                {
                                    // この行の、選択対象のフィールドの値。
                                    Value_Humaninput selectedCellData;
                                    try
                                    {
                                        selectedCellData = (Value_Humaninput)record[sSelectField];
                                    }
                                    catch (KeyNotFoundException ex)
                                    {
                                        selectedCellData     = null;
                                        err_SSelectedFldName = sSelectField;
                                        err_Exception        = ex;
                                        isBreak2             = true;
                                        goto gt_Error_NotFoundFld;
                                    }

                                    Expression_Node_String ec_SelectedValue = this.GetSelectedFieldValue(
                                        fielddefinition_Selected,
                                        selectedCellData,
                                        parent_Cf_Query,
                                        log_Reports
                                        );

                                    list_FldImpl3.Add(ec_SelectedValue.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                                }
                            }
                            break;

                        default:
                            {
                                //
                                // (8-4)

                                //
                                // 既にエラー対策済み。

                                if (null != log_Reports)    //無限ループ防止
                                {
                                    //
                                    // エラー。
                                    isBreak2 = true;
                                    goto gt_Error_UndefinedPrimitiveType;
                                }

                                //
                                // 非エラー中断。
                                isBreak2 = true;
                                goto gt_EndInnermethod;
                            }
                            break;
                        }
                    }

                    goto gt_EndInnermethod;
                    //
                    #region 異常系
                    //────────────────────────────────────────
                    gt_Error_NullSelectedFldDefinition:
                    {
                        Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                        tmpl.SetParameter(1, o_Table.Name, log_Reports);                                                //テーブル名
                        tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(parent_Cf_Query), log_Reports); //設定位置パンくずリスト

                        this.Owner_MemoryApplication.CreateErrorReport("Er:6026;", tmpl, log_Reports);
                    }
                    goto gt_EndInnermethod;
                    //────────────────────────────────────────
                    gt_Error_UndefinedPrimitiveType:
                    {
                        Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                        tmpl.SetParameter(1, keyFldDefinition.ToString_Type(), log_Reports);                            //キー・フィールド定義型名
                        tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(parent_Cf_Query), log_Reports); //設定位置パンくずリスト

                        this.Owner_MemoryApplication.CreateErrorReport("Er:6027;", tmpl, log_Reports);
                    }
                    goto gt_EndInnermethod;
                    //────────────────────────────────────────
                    gt_Error_NotFoundFld:
                    {
                        Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                        tmpl.SetParameter(1, err_SSelectedFldName, log_Reports);                                        //選択フィールド名
                        tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(parent_Cf_Query), log_Reports); //設定位置パンくずリスト
                        tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Exception(err_Exception), log_Reports);       //例外メッセージ

                        this.Owner_MemoryApplication.CreateErrorReport("Er:6028;", tmpl, log_Reports);
                    }
                    goto gt_EndInnermethod;
                    //────────────────────────────────────────
                    #endregion
                    //
                    gt_EndInnermethod:
                    ;
                }, log_Reports);//select列1つ

                if (0 < list_FldImpl3.Count)
                {
                    // フィールドがあれば追加。
                    reslt_sFieldListList.Add(list_FldImpl3);
                }
            }

            goto gt_EndMethod;
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_NullTable:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();

                this.Owner_MemoryApplication.CreateErrorReport("Er:6024;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_NullKeyFldDefinition:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Configuration(parent_Cf_Query), log_Reports);//設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:6025;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return(reslt_sFieldListList);
        }
Example #13
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);
        }
Example #14
0
        //────────────────────────────────────────

        /// <summary>
        /// レイアウト_レコードを元に、コントロールのスタイルを設定します。
        /// </summary>
        /// <param nFcName="fo_Record"></param>
        /// <param nFcName="log_Reports"></param>
        public void SetupStyle(
            RecordUserformconfig fo_Record,
            Log_Reports log_Reports
            )
        {
            Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            pg_Method.BeginMethod(Info_Controls.Name_Library, this, "SetupStyle", log_Reports);
            //
            //

            // 自動入力ここから
            this.ControlCommon.BAutomaticinputting = true;

            // リストボックスの Text プロパティーは無視。

            bool bEnabled;

            fo_Record.TryGetBool(out bEnabled, NamesFld.S_ENABLED, this.ControlCommon.Owner_MemoryApplication, log_Reports);
            this.UsercontrolEnabled = bEnabled;

            bool bVisible;

            fo_Record.TryGetBool(out bVisible, NamesFld.S_VISIBLE, this.ControlCommon.Owner_MemoryApplication, log_Reports);
            this.UsercontrolVisible = bVisible;

            // 【特殊】チェックボックスの値の型
            string sChkValueType;
            {
                fo_Record.TryGetString(out sChkValueType, NamesFld.S_CHK_VALUE_TYPE, false, "", this.ControlCommon.Owner_MemoryApplication, log_Reports);
                this.sUsercontrolChkvaluetype = sChkValueType.Trim();
                if (ValuesAttr.S_EMPTY == this.sUsercontrolChkvaluetype)
                {
                    this.EnumCheckboxValuetype = EnumCheckboxValuetype.Bool;
                }
                else if (ValuesAttr.S_ZERO_ONE == this.sUsercontrolChkvaluetype)
                {
                    this.EnumCheckboxValuetype = EnumCheckboxValuetype.Zero_One;
                }
                else if (ValuesAttr.S_BOOL == this.sUsercontrolChkvaluetype)
                {
                    this.EnumCheckboxValuetype = EnumCheckboxValuetype.Bool;
                }
                else
                {
                    //エラー
                    goto gt_Error_NotSupportedValue;
                }
            }


            // フォントの設定
            {
                // フォント・サイズの設定
                float nFontSizePt = Utility_Usercontrol.ParseFontSize(fo_Record, this.ControlCommon.Owner_MemoryApplication, log_Reports);
                this.Font = new System.Drawing.Font("MS UI Gothic", nFontSizePt, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
            }

            // タブ・インデックス
            int nTabIndex;

            fo_Record.TryGetInt(out nTabIndex, NamesFld.S_TAB_INDEX, false, -1, this.ControlCommon.Owner_MemoryApplication, log_Reports);
            if (nTabIndex < 0)
            {
                // 未指定の場合は変更しません。
            }
            else
            {
                this.UsercontrolTabindex = nTabIndex;
            }



            int nAbsXLt;

            fo_Record.TryGetInt(out nAbsXLt, NamesFld.S_X_LT, false, -1, this.ControlCommon.Owner_MemoryApplication, log_Reports);

            int nAbsYLt;

            fo_Record.TryGetInt(out nAbsYLt, NamesFld.S_Y_LT, false, -1, this.ControlCommon.Owner_MemoryApplication, log_Reports);

            this.Location = new System.Drawing.Point(nAbsXLt, nAbsYLt);


            int nWidth;

            fo_Record.TryGetInt(out nWidth, NamesFld.S_WIDTH, false, 1, this.ControlCommon.Owner_MemoryApplication, log_Reports);

            int nHeight;

            fo_Record.TryGetInt(out nHeight, NamesFld.S_HEIGHT, false, 1, this.ControlCommon.Owner_MemoryApplication, log_Reports);

            this.Size = new System.Drawing.Size(nWidth, nHeight);


            // 背景色の設定
            string sBackColor;

            fo_Record.TryGetString(out sBackColor, NamesFld.S_BACK_COLOR, false, "", this.ControlCommon.Owner_MemoryApplication, log_Reports);
            this.UsercontrolBackcolor = sBackColor;

            // コントロールは不可視にする。
            this.customcontrolCheckbox1.Visible = false;

            this.ControlCommon.BAutomaticinputting = false;
            // 自動入力ここまで

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_NotSupportedValue:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, this.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports), log_Reports); //コントロール名
                tmpl.SetParameter(2, sChkValueType, log_Reports);                                                                                                  //CHK_VALUE_TYPEフィールド値
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(fo_Record.Parent_TableUserformconfig.Cur_Configurationtree), log_Reports);         //設定位置パンくずリスト

                this.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:519;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            pg_Method.EndMethod(log_Reports);
        }
Example #15
0
        //────────────────────────────────────────

        public override void XmlToConfigurationtree(
            XmlElement cur_X,                 //<event>
            Configurationtree_Node parent_Cf, //<control>
            MemoryApplication memoryApplication,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "XmlToConfigurationtree", log_Reports);
            //
            //


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


            //
            //
            //
            // 属性
            //
            //
            //
            this.Parse_SAttribute(cur_X, cur_Cf, memoryApplication, log_Reports);



            //
            //
            //
            // 子
            //
            //
            //
            XmlElement err_XAction;
            Exception  err_Excp;

            if (log_Reports.Successful)
            {
                //
                //
                // actionノードを列挙
                //
                XmlNodeList child_XNl = cur_X.ChildNodes;
                foreach (XmlNode xChild in child_XNl)
                {
                    if (XmlNodeType.Element == xChild.NodeType)
                    {
                        XmlElement xAction = (XmlElement)xChild;

                        try
                        {
                            XmlToConfigurationtree_C15_Elm to = this.Dic_XmlToConfigurationtree[xChild.Name];
                            to.XmlToConfigurationtree(
                                xAction,
                                cur_Cf,
                                memoryApplication,
                                log_Reports
                                );
                        }
                        catch (KeyNotFoundException e)
                        {
                            err_XAction = xAction;
                            err_Excp    = e;
                            goto gt_Error_NotFound;
                        }
                        catch (Exception e)
                        {
                            err_Excp = e;
                            goto gt_Error_Excp;
                        }
                    }
                }
            }



            //
            //
            //
            // 親へ連結
            //
            //
            //
            if (log_Reports.Successful)
            {
                parent_Cf.List_Child.Add(cur_Cf, log_Reports);
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_NotFound:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_XAction.Name, log_Reports);                                   //ノード名
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports); //設定位置パンくずリスト
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Exception(err_Excp), log_Reports);   //例外メッセージ

                memoryApplication.CreateErrorReport("Er:8023;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_Excp:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports); //設定位置パンくずリスト
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Exception(err_Excp), log_Reports);   //例外メッセージ

                memoryApplication.CreateErrorReport("Er:8024;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Example #16
0
        //────────────────────────────────────────

        /// <summary>
        /// トゥゲザー名で指定しなかった場合。
        ///
        /// (1)「コントロール設定ファイル(Fcnf)」の<refresher>を読みにいく。
        /// (2)なければ「トゥゲザー設定ファイル(Frfr)」の<refresher>を読みにいく。
        /// </summary>
        /// <param name="log_Reports"></param>
        private void Execute6_ByNoName(
            out Configurationtree_Node cf_TgTogether,
            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_ByNoName", log_Reports);

            if (log_Reports.CanStopwatch)
            {
                log_Method.Log_Stopwatch.Message = Utility_Textformat.Format_StopwatchComment(
                    this,
                    this.Cur_Configuration,
                    log_Reports
                    );

                log_Method.Log_Stopwatch.Begin();
            }
            //
            //

            string sFncName0;

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

            if (null != this.Cur_Configuration)
            {
                Configuration_Node cf_Event = this.Cur_Configuration.GetParentByNodename(
                    NamesNode.S_EVENT, EnumConfiguration.Tree, false, log_Reports);

                if (null != cf_Event)
                {
                    Configuration_Node owner_Configurationtree_Control = cf_Event.GetParentByNodename(
                        NamesNode.S_CONTROL1, EnumConfiguration.Tree, true, log_Reports);
                    if (null != owner_Configurationtree_Control)
                    {
                        //
                        // (1)「コントロール設定ファイル(Fcnf)」の<refresher>を読みにいく。
                        //
                        this.Execute3b_ByNoName_1Fcnf(
                            out cf_TgTogether,
                            (Configurationtree_Node)owner_Configurationtree_Control,
                            (Configurationtree_Node)cf_Event,
                            log_Reports);

                        if (null == cf_TgTogether)
                        {
                            //
                            // (2)「トゥゲザー設定ファイル(Frfr)」の<refresher>を読みにいく。
                            //
                            this.Execute3b_ByNoName_2Frfr(
                                out cf_TgTogether,
                                (Configurationtree_Node)owner_Configurationtree_Control,
                                (Configurationtree_Node)cf_Event,
                                log_Reports
                                );
                        }

                        //
                        //
                        // 13:トゥゲザーの実行
                        // 所要時間目安[1]~[4343]ミリ秒ほど
                        //
                        //

                        // 指定のコントロールの内容を、データ・ソースから読取り直して最新表示します。

                        if (log_Reports.Successful)
                        {
                            //
                            // トゥゲザー<together>を使います。
                            //

                            this.Owner_MemoryApplication.MemoryTogethers.RefreshDataByTogether(
                                cf_TgTogether,
                                log_Reports
                                );
                        }
                    }
                    else
                    {
                        cf_TgTogether = null;
                        goto gt_Error_NullParentControl;
                    }
                }
                else
                {
                    cf_TgTogether = null;
                    goto gt_Error_NullParentEvent;
                }
            }
            else
            {
                cf_TgTogether = null;
                goto gt_Error_NullTogetherName;
            }

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

                this.Owner_MemoryApplication.CreateErrorReport("Er:110012;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_NullParentEvent:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, sFncName0, log_Reports);                                                          //関数名
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(this.Cur_Configuration), log_Reports); //設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:110013;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_NullTogetherName:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, sFncName0, log_Reports);                                                          //関数名
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(this.Cur_Configuration), log_Reports); //設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:110014;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Example #17
0
        //────────────────────────────────────────
        #endregion



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

        public override void XmlToConfigurationtree( //override
            XmlElement cur_X,
            Configurationtree_Node parent_Cf,        //トゥゲザー設定ファイル
            MemoryApplication memoryApplication,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(1);

            log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "XmlToConfigurationtree", log_Reports);
            //
            //



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


            //
            //
            //
            //「トゥゲザー登録ファイル」に書かれているのか、
            //「コントロール設定ファイル」に書かれているのかで、処理を変えます。
            //
            //
            //
            bool bGlobalRfr;

            if (NamesNode.S_CODEFILE_TOGETHERS == parent_Cf.Name)
            {
                bGlobalRfr = true;

                //if (log_Method.CanDebug(1))
                //{
                //    log_Method.WriteDebug_ToConsole("親要素がトゥゲザーコンフィグってことは、グローバル・トゥゲザー?");
                //}
            }
            else
            {
                bGlobalRfr = false;

                //if (log_Method.CanDebug(1))
                //{
                //    log_Method.WriteDebug_ToConsole("トゥゲザーコンフィグじゃないって何?");
                //}
            }



            //
            //
            //
            // 属性
            //
            //
            //

            //name(未設定可)
            if (log_Reports.Successful)
            {
                XmlNode xNd = cur_X.Attributes.GetNamedItem(PmNames.S_NAME.Name_Attribute);
                if (null != xNd)
                {
                    cur_Cf.Dictionary_Attribute.Add(PmNames.S_NAME.Name_Pm, xNd.Value, cur_Cf, false, log_Reports);
                }
            }

            //in(未設定可。コントロール設定ファイルには無い)
            if (log_Reports.Successful)
            {
                if (bGlobalRfr)
                {
                    XmlNode xNd = cur_X.Attributes.GetNamedItem(PmNames.S_IN.Name_Pm);
                    if (null != xNd)
                    {
                        cur_Cf.Dictionary_Attribute.Set(PmNames.S_IN.Name_Pm, xNd.Value, log_Reports);
                    }
                }
            }

            //on(コントロール設定ファイルでは必須、グローバル・トゥゲザー登録ファイルには無い)
            if (log_Reports.Successful)
            {
                if (!bGlobalRfr)
                {
                    XmlNode xNd = cur_X.Attributes.GetNamedItem(PmNames.S_ON.Name_Attribute);
                    if (null != xNd)
                    {
                        cur_Cf.Dictionary_Attribute.Add(PmNames.S_ON.Name_Pm, xNd.Value, cur_Cf, false, log_Reports);
                    }
                    else
                    {
                        // エラー
                        goto gt_Error_NoOn;
                    }
                }
            }

            // target(コントロール設定ファイルでは必須、グローバル・トゥゲザー登録ファイルには無い)
            if (log_Reports.Successful)
            {
                if (!bGlobalRfr)
                {
                    XmlNode xNd = cur_X.Attributes.GetNamedItem(PmNames.S_TARGET1.Name_Attribute);
                    if (null != xNd)
                    {
                        cur_Cf.Dictionary_Attribute.Add(PmNames.S_TARGET1.Name_Pm, xNd.Value, cur_Cf, false, log_Reports);
                    }
                    else
                    {
                        // エラー
                        goto gt_Error_NoTarget;
                    }
                }
            }

            //description(未設定可)
            if (log_Reports.Successful)
            {
                XmlNode xNd = cur_X.Attributes.GetNamedItem(PmNames.S_DESCRIPTION.Name_Attribute);
                if (null != xNd)
                {
                    cur_Cf.Dictionary_Attribute.Add(PmNames.S_DESCRIPTION.Name_Pm, xNd.Value, cur_Cf, true, log_Reports);
                }
            }



            //
            //
            //
            // 子
            //
            //
            //
            XmlElement err_Child_X;

            if (log_Reports.Successful)
            {
                if (bGlobalRfr)
                {
                    if (log_Reports.Successful)
                    {
                        //
                        // target要素
                        //
                        XmlNodeList child_XNl = cur_X.ChildNodes;

                        foreach (XmlNode child_XNode in child_XNl)
                        {
                            if (XmlNodeType.Element == child_XNode.NodeType)
                            {
                                XmlElement xChild = (XmlElement)child_XNode;

                                if (NamesNode.S_TARGET == xChild.Name)
                                {
                                    //
                                    // target要素
                                    //
                                    string sName_Target = xChild.Attributes.GetNamedItem(PmNames.S_NAME.Name_Attribute).Value;

                                    Configurationtree_Node cfRfr_Target = new Configurationtree_NodeImpl(NamesNode.S_TARGET, cur_Cf);
                                    cfRfr_Target.Dictionary_Attribute.Set(PmNames.S_NAME.Name_Pm, sName_Target, log_Reports);

                                    cur_Cf.List_Child.Add(cfRfr_Target, log_Reports);
                                }
                                else
                                {
                                    // エラー
                                    err_Child_X = xChild;
                                    goto gt_Error_Child;
                                }
                            }
                        }
                    }
                }
            }


            //
            //
            //
            // 親
            //
            //
            //
            string err_SIn;

            if (bGlobalRfr)
            {
                string sIn;
                if (log_Reports.Successful)
                {
                    // 重複チェック用。
                    List <string> sList_In   = new List <string>();
                    List <string> sList_Name = new List <string>();


                    //
                    //
                    //
                    // (1)in属性が付いていれば そちらへ、
                    // (2)nameが付いていれば そちらへ。
                    // 重複名があれば発見したい。
                    //
                    //
                    //
                    cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_IN, out sIn,
                                                            false,//空文字列でも構わない。
                                                            log_Reports);

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


                    if ("" != sIn)
                    {
                        // トゥゲザー登録ファイルに、in指定での<together>要素を追加。

                        // 重複チェック。
                        if (!sList_In.Contains(sIn))
                        {
                            sList_In.Add(sIn);
                            parent_Cf.List_Child.Add(cur_Cf, log_Reports);
                        }
                        else
                        {
                            // エラー。
                            err_SIn = sIn;
                            goto gtj_Error_DuplicationIn;
                        }
                    }
                    else if ("" != sName_Rfr)
                    {
                        // トゥゲザー設定ファイルに、name指定での<together>要素を追加。

                        // 重複チェック。
                        if (!sList_Name.Contains(sName_Rfr))
                        {
                            sList_Name.Add(sName_Rfr);
                            parent_Cf.List_Child.Add(cur_Cf, log_Reports);
                        }
                        else
                        {
                            // エラー
                            goto gt_Error_DuplicationTogether;
                        }
                    }
                    else
                    {
                        // エラー
                        goto gt_Error_Attr;
                    }
                }



                goto gt_EndMethod;
            }
            else
            {
                //
                //
                //
                // 親
                //
                //
                //
                if (log_Reports.Successful)
                {
                    string sOn;
                    cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_ON, out sOn, false, log_Reports);

                    List <Configurationtree_Node> listCf_Together = parent_Cf.GetChildrenByNodename(NamesNode.S_TOGETHER, false, log_Reports);
                    foreach (Configurationtree_Node cf_Together in listCf_Together)
                    {
                        string sOn2;
                        cf_Together.Dictionary_Attribute.TryGetValue(PmNames.S_ON, out sOn2, false, log_Reports);

                        if (sOn == sOn2)
                        {
                            // エラー
                            goto gt_Error_DuplicationOn;
                        }
                    }

                    parent_Cf.List_Child.Add(cur_Cf, log_Reports);
                }
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gtj_Error_DuplicationIn:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, NamesNode.S_TOGETHER, log_Reports);                               //ノード名
                tmpl.SetParameter(2, PmNames.S_IN.Name_Attribute, log_Reports);                        //引数名
                tmpl.SetParameter(3, err_SIn, log_Reports);                                            //in属性値
                tmpl.SetParameter(4, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports); //設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:8026;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_DuplicationTogether:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, NamesNode.S_TOGETHER, log_Reports);//ノード名

                string sName_Tg;
                cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Tg, false, log_Reports);
                tmpl.SetParameter(2, sName_Tg, log_Reports);                                           //指定したtogether名

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

                memoryApplication.CreateErrorReport("Er:8027;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_DuplicationOn:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, PmNames.S_ON.Name_Attribute, log_Reports);                           //属性名on
                tmpl.SetParameter(2, NamesNode.S_TOGETHER, log_Reports);                                  //ノード名トゥゲザー
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(parent_Cf), log_Reports); //設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:8028;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_Attr:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, NamesNode.S_TOGETHER, log_Reports);                               //ノード名

                tmpl.SetParameter(2, "in,name", log_Reports);                                          //属性名リスト

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

                memoryApplication.CreateErrorReport("Er:8029;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_Child:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, NamesNode.S_TOGETHER, log_Reports);                               //ノード名
                tmpl.SetParameter(2, NamesNode.S_TARGET, log_Reports);                                 //期待する子ノード名
                tmpl.SetParameter(3, err_Child_X.Name, log_Reports);                                   //実際の子ノード名
                tmpl.SetParameter(4, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports); //設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:8030;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_NoTarget:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, NamesNode.S_TOGETHER, log_Reports);                                  //ノード名
                tmpl.SetParameter(2, PmNames.S_TARGET1.Name_Attribute, log_Reports);                      //期待する属性名
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(parent_Cf), log_Reports); //設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:8031;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_NoOn:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, NamesNode.S_TOGETHER, log_Reports);                                  //ノード名
                tmpl.SetParameter(2, PmNames.S_ON.Name_Attribute, log_Reports);                           //期待する属性名
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(parent_Cf), log_Reports); //設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:8032;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return;
        }
Example #18
0
        //────────────────────────────────────────
        #endregion



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

        /// <summary>
        /// イベント アクション リストを作成します。
        /// </summary>
        /// <param nFcName="eventName"></param>
        /// <param nFcName="nActionSuper"></param>
        /// <param nFcName="log_Reports"></param>
        public Functionlist CreateFunctionlist(
            ConfigurationtreeToExpression_Event sToE_Event,
            MemoryApplication owner_MemoryApplication,
            Log_Reports log_Reports
            )
        {
            Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            pg_Method.BeginMethod(Info_Controls.Name_Library, this, "CreateFunctionlist", log_Reports);
            //
            //
            Functionlist fc_Result = null;

            //.WriteLine(this.GetType().Name + "#CreateEventActionList: <構築>【開始】 イベントに対応ついたアクションリストを追加します。 (ボタン)");

            switch (sToE_Event.Name)
            {
            case NamesSe.S_LOAD:
            {
                //
                // このコントロールの「アプリケーション起動時」。
                //
                //  (NActionPerformEnum.O_EA)
                //

                //
                // 無視します。
                //
            }
            break;

            case NamesSe.S_BUTTON_PRESSED:
            {
                //  (NActionPerformEnum.O_EA)

                if (null == this.functionlist_Event_Click)
                {
                    fc_Result = new Functionlist_FormImpl(
                        //EnumEventhandler.O_Ea,
                        sToE_Event, owner_MemoryApplication);
                    this.functionlist_Event_Click = fc_Result;
                    ((Functionlist_FormImpl)this.functionlist_Event_Click).InitializeBeforeUse();

                    this.UsercontroleventhandlerClick += new System.EventHandler(this.functionlist_Event_Click.Execute4_OnOEa);
                    //ccButton.Click += new System.EventHandler(this.e_ActionList_Click.Perform_OEa);

                    // ★DEBUG
                    //essageBox.Show(Info_Forms.LibraryName + ":" + this.GetType().Name + "#Perform_OEa: FC[" + this.ControlCommon.NFcName.GetString(EnumHitcount.Unconstraint, log_Reports) + "]で、EV[" + rEvent.Name + "]のアクションが登録されました。");
                }
            }
            break;

            default:
                goto gt_Error_NotSupportedEvent;
            }


            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_NotSupportedEvent:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, this.GetType().Name, log_Reports);                                                            //クラス名
                tmpl.SetParameter(2, sToE_Event.Name, log_Reports);                                                                //イベント名
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(sToE_Event.Configurationtree_Event), log_Reports); //位置パンくずリスト

                owner_MemoryApplication.CreateErrorReport("Er:532;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            pg_Method.EndMethod(log_Reports);
            return(fc_Result);
        }
Example #19
0
        //────────────────────────────────────────
        #endregion



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

        /// <summary>
        /// ユーザー定義プログラムの実行。
        /// </summary>
        /// <returns></returns>
        public override string Execute5_Main(
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

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

            Configuration_Node parent_Configurationtree_Node_Query = this.Cur_Configuration;

            StringBuilder sb_Result = new StringBuilder();

            //
            // 外観
            //
            // <f-text-template table="Ut:条件テーブル" lookup-id="100">
            //
            // ・lookup-id は、lookup-value という名前の方が良かった。
            //

            //
            // 指定のテーブルの ID列を指定して、TEXT列の内容を取得。
            Builder_TexttemplateP1pImpl p1pText = new Builder_TexttemplateP1pImpl();
            {
                // <f-text-template>要素。
                Selectstatement selectSt = new SelectstatementImpl(this, this.Cur_Configuration);

                // TODO: logic属性がある版も要るはず。
                Recordcondition recCond1;
                bool            bSuccessful = RecordconditionImpl.TryBuild(out recCond1, EnumLogic.None, Expression_SftextTemplate.S_FIELD_ID, parent_Configurationtree_Node_Query, log_Reports);
                selectSt.List_Recordcondition.Add(recCond1);

                ////
                //// (1)キー_フィールド名
                //{
                //    recCond1.Name_Field = "ID";
                //}

                //
                // (2)探したいキー値
                {
                    //
                    // thisは、<f-text-template>。
                    //

                    string sLookupId;
                    bool   bHit = this.TrySelectAttribute(out sLookupId, PmNames.S_LOOKUP_ID.Name_Pm, EnumHitcount.One, log_Reports);
                    if (bHit)
                    {
                        recCond1.Value = sLookupId;
                    }

                    string sLookupValue;
                    if (log_Reports.Successful)
                    {
                        sLookupValue = recCond1.Value;
                    }
                    else
                    {
                        // エラー
                        goto gt_Error_NotFoundVariable;
                    }

                    // bug:
                    if ("" == sLookupValue.Trim())
                    {
                        //
                        // 検索キーが空欄の場合。
                        sb_Result.Length = 0; //空文字列にする。
                        goto gt_EndMethod;
                    }
                }

                //
                // (3)検索ヒットの必須の有無
                {
                    // 必須指定。
                    selectSt.Required = Expression_SftextTemplate.S_TRUE;
                }

                //
                // (4)テーブル名
                {
                    Expression_Node_String ec_Result;//ソース情報利用
                    bool bHit = this.TrySelectAttribute(out ec_Result, PmNames.S_TABLE.Name_Pm, EnumHitcount.One, log_Reports);
                    selectSt.Expression_From = ec_Result;
                }

                //
                // (5)欲しいデータのあるフィールド名
                selectSt.List_SName_SelectField.Add(Expression_SftextTemplate.S_FIELD_TEXT);



                //
                // (1)レコードセットの絞り込み。
                RecordSet dst_Rs;
                {
                    Table_Humaninput o_Tbl = this.Owner_MemoryApplication.MemoryTables.GetTable_HumaninputByName(
                        selectSt.Expression_From,//これが空文字列の場合がある??
                        true,
                        log_Reports
                        );
                    dst_Rs = new RecordSetImpl(o_Tbl);
                }
                //dst_Rs.Selectstatement = selectSt;//★


                {
                    // テーブル名。
                    if ("" == selectSt.Expression_From.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports).Trim())
                    {
                        //
                        // エラー。
                        goto gt_Error_EmptyTableName;
                    }

                    Table_Humaninput o_Table = this.Owner_MemoryApplication.MemoryTables.GetTable_HumaninputByName(selectSt.Expression_From, true, log_Reports);

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



                    bool isRequired_ExpectedValue;
                    {
                        bool parseSuccessful = bool.TryParse(selectSt.Required, out isRequired_ExpectedValue);
                    }


                    //
                    //
                    //
                    // 条件
                    //
                    //
                    //
                    string          name_KeyField;
                    Fielddefinition fielddefinition_Key;
                    string          value_Expected;
                    P2_ReccondImpl  sel2 = new P2_ReccondImpl();
                    sel2.GetFirstAwhrReccond(
                        out name_KeyField,
                        out fielddefinition_Key,
                        out value_Expected,
                        selectSt.List_Recordcondition,
                        o_Table,
                        log_Reports
                        );

                    List <DataRow> dst_Row = new List <DataRow>();

                    if (log_Reports.Successful)
                    {
                        SelectPerformerImpl sp = new SelectPerformerImpl();
                        sp.Select(
                            out dst_Row,
                            name_KeyField,
                            value_Expected,
                            isRequired_ExpectedValue,
                            fielddefinition_Key,
                            o_Table.DataTable,
                            parent_Configurationtree_Node_Query,
                            log_Reports
                            );
                    }

                    if (log_Reports.Successful)
                    {
                        dst_Rs.AddList(dst_Row, log_Reports);
                    }

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


                if (!log_Reports.Successful)
                {
                    //
                    // エラーが出ていたら、さっさと抜ける。
                    //sResult = "";
                    goto gt_EndMethod;
                }

                //
                // フィールド値の取得。
                P5_CellsSelecterImpl  sel5            = new P5_CellsSelecterImpl(this.Owner_MemoryApplication);
                List <List <string> > sListList_reslt = sel5.P5_Select_CellType(
                    dst_Rs,
                    selectSt,
                    null,//nwhere_recordSetSaveTo,
                    this.Cur_Configuration,
                    log_Reports
                    );



                if (0 < sListList_reslt.Count)
                {
                    // 先頭行の、
                    List <string> sList_Fld = sListList_reslt[0];
                    // 先頭フィールドの値。
                    string sString = sList_Fld[0];

                    //e_string.SetValidation(...);
                    p1pText.Text = sString;
                }
                else
                {
                    // エラー

                    Log_TextIndented txt = new Log_TextIndentedImpl();
                    txt.Append(this.GetType().Name);
                    txt.Append("#GetString:(" + Info_Expr.Name_Library + ") エラー。該当なし。");

                    txt.Append(" 選択フィールド=[");

                    txt.Append(selectSt.ToSelectFieldNameListCsv());

                    txt.Append("]");

                    txt.Append(" テーブル=[");

                    txt.Append(selectSt.Expression_From.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                    txt.Append("]");

                    // キーフィールド
                    txt.Append(" [");

                    txt.Append(recCond1.Name_Field);

                    txt.Append("]が");

                    // 探す値。
                    txt.Append("[");
                    txt.Append(recCond1.Value);
                    txt.Append("]のとき");



                    p1pText.Text = txt.ToString();
                }
            }



            List <int> nList_P1p = p1pText.ExistsP1pNumbers(
                this.Dictionary_Expression_Attribute,
                log_Reports
                );

            foreach (int n_P1p in nList_P1p)
            {
                string p1pValue;
                {
                    bool bHit = this.TrySelectAttribute(
                        out p1pValue,
                        "p" + n_P1p + "p",
                        EnumHitcount.One,
                        log_Reports
                        );

                    if (log_Reports.Successful)
                    {
                    }
                    else
                    {
                        p1pValue = null;
                    }

                    p1pText.Dictionary_NumberAndValue_Parameter.Add(n_P1p, p1pValue);
                }
            }


            Expression_Node_String ec_TextTemplate = p1pText.Compile(
                log_Reports
                );

            sb_Result.Append(ec_TextTemplate.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));


            //
            //
            //
            // TODO: 制約の判定
            //
            //
            //

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

                this.Owner_MemoryApplication.CreateErrorReport("Er:6009;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_EmptyTableName:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Configuration(parent_Configurationtree_Node_Query), log_Reports);//設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:6010;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_NullTable:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Configuration(parent_Configurationtree_Node_Query), log_Reports);//設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:6011;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return(sb_Result.ToString());
        }
Example #20
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);
        }
Example #21
0
        //────────────────────────────────────────
        #endregion



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

        /// <summary>
        /// ユーザー定義プログラムの実行。
        /// </summary>
        /// <param name="hits"></param>
        /// <param name="log_Reports"></param>
        /// <returns></returns>
        public override string Execute4_OnExpressionString(
            EnumHitcount hits,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_Expr.Name_Library, this, "Execute4_OnExpressionString", log_Reports);
            //
            //

            Expression_Node_String err_Ev11;
            bool bAllFldsIsEmpty = true;

            Expression_Node_String ec_RecordSetLoadFrom;//ソース情報利用
            bool bHit = this.TrySelectAttribute(out ec_RecordSetLoadFrom, NamesNode.S_RECORD_SET_LOAD_FROM, EnumHitcount.One, log_Reports);

            //
            // 一時記憶に記憶されているレコードセットのコピー内容。
            RecordSet recordSet;

            if (log_Reports.Successful)
            {
                string sRecordSetLoadFrom = ec_RecordSetLoadFrom.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                // #デバッグ中
                System.Console.WriteLine(Info_Expr.Name_Library + ":" + this.GetType().Name + "#E_Execute: ★★ record-set-load-from=[" + sRecordSetLoadFrom + "]");

                recordSet = this.Owner_MemoryApplication.MemoryRecordset.RecordsetStorage.Get(ec_RecordSetLoadFrom,
                                                                                              this.Owner_MemoryApplication,
                                                                                              log_Reports);
            }
            else
            {
                recordSet = null;
            }

            Value_Humaninput err_OValue;
            string           err_SFldName;
            Exception        err_Excp;
            string           err_SCsv;
            List <string>    err_SList;

            if (log_Reports.Successful)
            {
                //
                // 子<f-●●>要素を実行し、文字列連結。
                // 「SK10,LV10,OP10,COND10,COND10x,COND10y,COND10z,PRI10,RATE10,PER10」といった文字列が取得できることを期待。
                StringBuilder sb_Csv = new StringBuilder();
                {
                    List <Expression_Node_String> ecList_Child = this.List_Expression_Child.SelectList(
                        EnumHitcount.Unconstraint,
                        log_Reports
                        );

                    foreach (Expression_Node_String ec_11 in ecList_Child)
                    {
                        if (ec_11 is Expressionv_Elem99)
                        {
                            Expressionv_Elem99 ev_elem = (Expressionv_Elem99)ec_11;
                            ev_elem.SetDataRow(this.DataRow);
                            sb_Csv.Append(ev_elem.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                        }
                        else if (ec_11 is Expression_Node_StringImpl)
                        {
                            sb_Csv.Append(ec_11.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));
                        }
                        else
                        {
                            err_Ev11        = ec_11;
                            bAllFldsIsEmpty = false;
                            goto gt_Error_UndefinedElementClass;
                        }
                    }
                }

                //
                // コンマ区切り文字列を、リスト化。
                List <string> sList;
                {
                    CsvTo_ListImpl csvTo = new CsvTo_ListImpl();
                    sList = csvTo.Read(sb_Csv.ToString());
                }


                //
                // 全部真なら真、1つでも偽なら偽。
                foreach (string sFldName in sList)
                {
                    // bug: argumentException
                    Value_Humaninput oValue;
                    try
                    {
                        // レコードセットの1件目だけをとりあえず確認。TODO:
                        oValue = recordSet.List_Field[0][sFldName.ToUpper()];
                        //oValue = (OValue)dataRow[fldName];
                    }
                    catch (KeyNotFoundException ex)
                    {
                        err_Excp     = ex;
                        err_SFldName = sFldName;
                        err_SCsv     = sb_Csv.ToString();
                        err_SList    = sList;
                        goto gt_Error_UndefinedFld;
                    }


                    // #デバッグ中
                    System.Console.WriteLine(Info_Expr.Name_Library + ":" + this.GetType().Name + "#E_Execute: oValue.Text=[" + oValue.Text + "]");


                    if (oValue is Int_HumaninputImpl)
                    {
                        Int_HumaninputImpl oInt = (Int_HumaninputImpl)oValue;

                        if ("" != oInt.Text)
                        {
                            bAllFldsIsEmpty = false;
                        }
                    }
                    else if (oValue is String_HumaninputImpl)
                    {
                        String_HumaninputImpl oString = (String_HumaninputImpl)oValue;

                        if ("" != oString.Text)
                        {
                            bAllFldsIsEmpty = false;
                        }
                    }
                    else if (oValue is Bool_HumaninputImpl)
                    {
                        Bool_HumaninputImpl oBool = (Bool_HumaninputImpl)oValue;

                        if ("" != oBool.Text)
                        {
                            bAllFldsIsEmpty = false;
                        }

                        //
                        // TODO: false/trueタイプ、0/1タイプにも対応したい。
                        //
                    }
                    else
                    {
                        //
                        // エラー。
                        err_OValue = oValue;
                        goto gt_Error_UndefinedType;
                    }
                }
            }


            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_UndefinedType:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_OValue.GetType().Name, log_Reports);                                          //値の型名
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(this.Cur_Configuration), log_Reports); //設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:6032;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_UndefinedElementClass:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_Ev11.GetType().Name, log_Reports);                                            //クラス名
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(this.Cur_Configuration), log_Reports); //設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:6033;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_UndefinedFld:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_SFldName.ToUpper(), log_Reports); //フィールド名大文字化
                tmpl.SetParameter(2, err_SCsv, log_Reports);               //指定されたフィールド名の文字列

                StringBuilder s1 = new StringBuilder();
                foreach (string str in err_SList)
                {
                    s1.Append("[");
                    s1.Append(str);
                    s1.Append("]");
                    s1.Append(Environment.NewLine);
                }
                tmpl.SetParameter(3, s1.ToString(), log_Reports);//指定されたフィールド名の文字列

                StringBuilder s2 = new StringBuilder();
                // あるフィールド名の一覧
                foreach (DataColumn dataColumn in this.DataRow.Table.Columns)
                {
                    s2.Append("[");
                    s2.Append(dataColumn.ColumnName);
                    s2.Append("]");
                    s2.Append(Environment.NewLine);
                }
                tmpl.SetParameter(4, s1.ToString(), log_Reports);                                                      //指定されたフィールド名の文字列

                tmpl.SetParameter(5, Log_RecordReportsImpl.ToText_Configuration(this.Cur_Configuration), log_Reports); //設定位置パンくずリスト
                tmpl.SetParameter(6, Log_RecordReportsImpl.ToText_Exception(err_Excp), log_Reports);                   //例外メッセージ

                this.Owner_MemoryApplication.CreateErrorReport("Er:6034;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return(bAllFldsIsEmpty.ToString());
        }
Example #22
0
        //────────────────────────────────────────

        /// <summary>
        /// イベント アクション リストを作成します。
        /// </summary>
        /// <param nFcName="eventName"></param>
        /// <param nFcName="nActionSuper"></param>
        /// <param nFcName="log_Reports"></param>
        public Functionlist CreateFunctionlist(
            ConfigurationtreeToExpression_Event sToE_Event,
            MemoryApplication owner_MemoryApplication,
            Log_Reports log_Reports
            )
        {
            Log_Method pg_Method = new Log_MethodImpl();

            pg_Method.BeginMethod(Info_Controls.Name_Library, this, "CreateFunctionlist", log_Reports);
            //
            //
            Functionlist result_Felist = null;

            switch (sToE_Event.Name)
            {
            case NamesSe.S_LOAD:
            {
                //
                // このコントロールの「アプリケーション起動時」。
                //
                //  (NActionPerformEnum.O_EA)
                //

                //
                // 無視します。
                //
            }
            break;

            case NamesSe.S_VALUE_CHANGED:
            {
                //
                // テキストボックスの内容変更時。
                //

                if (null == this.functionlist_Event_ValueChanged)
                {
                    result_Felist = new Functionlist_FormImpl(
                        //EnumEventhandler.O_Ea,
                        sToE_Event,
                        owner_MemoryApplication
                        );
                    this.functionlist_Event_ValueChanged = result_Felist;
                    ((Functionlist_FormImpl)this.functionlist_Event_ValueChanged).InitializeBeforeUse();


                    this.customcontrolTextbox1.TextChanged += new System.EventHandler(this.functionlist_Event_ValueChanged.Execute4_OnOEa);
                }
            }
            break;

            default:
                goto gt_Error_NotSupportedEvent;
            }


            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_NotSupportedEvent:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, this.GetType().Name, log_Reports);                                                            //クラス名
                tmpl.SetParameter(2, sToE_Event.Name, log_Reports);                                                                //イベント名
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(sToE_Event.Configurationtree_Event), log_Reports); //設定位置パンくずリスト

                this.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:516;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            pg_Method.EndMethod(log_Reports);
            return(result_Felist);
        }
Example #23
0
        //────────────────────────────────────────

        /// <summary>
        /// イベント アクション リストを作成します。
        /// </summary>
        /// <param nFcName="eventName"></param>
        /// <param nFcName="nActionSuper"></param>
        /// <param nFcName="log_Reports"></param>
        public Functionlist CreateFunctionlist(
            ConfigurationtreeToExpression_Event sToE_Event,
            MemoryApplication owner_MemoryApplication,
            Log_Reports log_Reports
            )
        {
            Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            pg_Method.BeginMethod(Info_Controls.Name_Library, this, "CreateFunctionlist", log_Reports);
            //
            //
            Functionlist fc_Result = null;

            //.WriteLine(this.GetType().Name + "#CreateEventActionList: <構築>【開始】 イベントに対応ついたアクションリストを追加します。 (チェックボックス)");

            switch (sToE_Event.Name)
            {
            case NamesSe.S_LOAD:
            {
                //
                // このコントロールの「アプリケーション起動時」。
                //
                //  (NActionPerformEnum.O_EA)
                //

                //
                // 無視します。
                //
            }
            break;

            case NamesSe.S_ITEM_SELECTED:
            {
                //
                // チェックした時/チェックを外した時
                //

                if (null == this.functionlist_Event_CheckedChanged)
                {
                    Functionlist_FormChkImpl fw = new Functionlist_FormChkImpl(
                        //EnumEventhandler.O_Ea,
                        sToE_Event, owner_MemoryApplication);
                    fw.InitializeBeforeUse();
                    fc_Result = fw;

                    this.functionlist_Event_CheckedChanged = fw;


                    this.customcontrolCheckbox1.CheckedChanged += new System.EventHandler(this.functionlist_Event_CheckedChanged.Execute4_OnOEa);
                }
            }
            break;

            default:
                goto gt_Error_NotSupportedEvent;
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_NotSupportedEvent:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, this.GetType().Name, log_Reports);                                                            //クラス名
                tmpl.SetParameter(2, sToE_Event.Name, log_Reports);                                                                //イベント名
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(sToE_Event.Configurationtree_Event), log_Reports); //設定位置パンくずリスト

                this.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:519;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            pg_Method.EndMethod(log_Reports);

            //.WriteLine(this.GetType().NFcName + "#CreateEventActionList: ■■■■■■■■■■未実装です。無視されます。rEvent.NFcName=[" + rEvent.NFcName + "]■■■■■■■■■■");
            return(fc_Result);
        }
Example #24
0
        //────────────────────────────────────────

        /// <summary>
        /// <f-str>
        /// </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,    //<f-str>
            Expression_Node_String parent_Ec, //親<●●>。
            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("(30)" + cur_Cf.Name);
            }

            //
            //
            //
            //

            if (null == parent_Ec)
            {
                goto gt_Error_NullFAelem;
            }


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


            //
            //
            //
            // 属性
            //
            //
            //
            if (log_Reports.Successful)
            {
                this.ParseAttr_InConfigurationtreeToExpression(
                    cur_Cf,
                    ec_Cur,
                    false, //name属性は無い。
                    true,  //value属性を、子<f-str>にする場合、真。
                    log_Reports
                    );
            }


            //
            //
            //
            // 子
            //
            //
            //
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    ec_Cur,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }


            //
            //
            //
            // 親へ連結 ※子連結が基本
            //
            //
            //
            {
                parent_Ec.List_Expression_Child.Add(ec_Cur, log_Reports);
            }

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

                memoryApplication.CreateErrorReport("Er:7016;", 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);
        }
Example #25
0
        //────────────────────────────────────────

        /// <summary>
        /// 変数を設定します。
        /// </summary>
        protected void Execute6_Sub(
            object sender,
            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 sFlowSkip;

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


            string sFncName0;

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

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

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

                if (sender is Customcontrol)
                {
                    Customcontrol fcCc = (Customcontrol)sender;

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

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


            Expression_Node_String ec_ArgVarName;

            this.TrySelectAttribute(out ec_ArgVarName, Expression_Node_Function34Impl.PM_NAME_VAR, EnumHitcount.One_Or_Zero, log_Reports);

            if (null == ec_ArgVarName)
            {
                goto gt_Error_NullArgVarName;
            }


            Expression_Node_String ec_ArgValue;

            this.TrySelectAttribute(out ec_ArgValue, Expression_Node_Function34Impl.PM_VALUE, EnumHitcount.One_Or_Zero, log_Reports);

            if (null == ec_ArgValue)
            {
                goto gt_Error_NullArgValue;
            }

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

                this.Owner_MemoryApplication.MemoryVariables.SetVariable(
                    new XenonNameImpl(
                        ec_ArgVarName.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports),
                        ec_ArgVarName.Cur_Configuration
                        ),
                    ec_ArgValue,
                    true,
                    log_Reports
                    );
            }

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

                this.Owner_MemoryApplication.CreateErrorReport("Er:110017;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_NullArgValue:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Configuration(this.Cur_Configuration), log_Reports);//設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:110018;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Example #26
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);
        }
Example #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("終了└──┘");
            }
        }
Example #28
0
        //────────────────────────────────────────

        /// <summary>
        /// Aa_Files.xmlの「FOLDER」「FILE」列を読取ります。
        /// </summary>
        /// <param name="ec_Fpath"></param>
        /// <param name="sTableNameToPuts"></param>
        /// <param name="sFpatha_Aafiles"></param>
        /// <param name="dataRow"></param>
        /// <param name="o_IndexTable"></param>
        /// <param name="log_Reports"></param>
        private void Read_Folder_File(
            out Expression_Node_Filepath ec_Fpath,
            string sTableNameToPuts,
            string sFpatha_Aafiles,
            DataRow dataRow,
            Table_Humaninput o_IndexTable,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0);

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


            string sFpath;   //バックアップ用に使い回す文字列。

            ec_Fpath = null; //セットパス用に使い回す。

            {
                //
                // フォルダー変数の指定の有無
                //
                string sNamevarFolder;
                {
                    string sFieldName2 = NamesFld.S_FOLDER;
                    if (String_HumaninputImpl.TryParse(
                            dataRow[sFieldName2],
                            out sNamevarFolder,
                            o_IndexTable.Name,
                            sFieldName2,
                            log_Method,
                            log_Reports))
                    {
                        // 正常、スルー。
                    }
                    else
                    {
                        sNamevarFolder = "";
                    }
                }


                // テーブルのファイルのパスを取得
                string sName_Field = NamesFld.S_FILE;
                if (String_HumaninputImpl.TryParse(
                        dataRow[sName_Field],
                        out sFpath,
                        o_IndexTable.Name,
                        sName_Field,
                        log_Method,
                        log_Reports))
                {
                    if ("" != sNamevarFolder.Trim())
                    {
                        // FOLDER列に、変数名が指定されているとき。

                        Expression_Node_String ec_Namevar_Folder = new Expression_Leaf_StringImpl(sNamevarFolder.Trim(), null, new Configurationtree_NodeImpl(o_IndexTable.Name, null));//todo:

                        log_Reports.Log_Callstack.Push(log_Method, "③");
                        Expression_Node_Filepath ec_Fopath = this.Owner_MemoryApplication.MemoryVariables.GetExpressionfilepathByVariablename(
                            ec_Namevar_Folder, true, log_Reports);
                        log_Reports.Log_Callstack.Pop(log_Method, "③");

                        if (null == ec_Fopath)
                        {
                            goto gt_Error_NullFolder;
                        }

                        //if (log_Method.CanDebug(1))
                        //{
                        //    log_Method.WriteDebug_ToConsole(".csvのFOLDER列に[" + sNamevarFolder + "]と指定されていました。");
                        //}

                        log_Reports.Log_Callstack.Push(log_Method, "⑧");
                        //bug:フォルダーパスだと Execute4_OnExpressionString は空白を返す??
                        string sFopath2 = ec_Fopath.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                        if ("" == sFopath2)
                        {
                            //bug:フォルダーパスだと Execute4_OnExpressionString は空白を返すようなので、入力値をそのまま返すことにした。
                            sFopath2 = ec_Fopath.Humaninput.Trim();
                        }
                        log_Reports.Log_Callstack.Pop(log_Method, "⑧");

                        //if (log_Method.CanDebug(1))
                        //{
                        //    log_Method.WriteDebug_ToConsole("[" + sNamevarFolder + "]変数の内容は["+sFopath2+"]");
                        //    //this.Owner_MemoryApplication.MemoryVariables.WriteDebug_ToConsole();
                        //}


                        // 「フォルダー」 + 「¥」 + 「相対パス」
                        sFpath = sFopath2 + System.IO.Path.DirectorySeparatorChar + sFpath;
                    }
                }

                //
                // ファイルパス
                //
                Configurationtree_NodeFilepath cf_Fpath1;
                {
                    StringBuilder s = new StringBuilder();
                    s.Append("L11_1[");
                    s.Append(NamesFile.S_AA_FILES_CSV);
                    s.Append("ファイルの");
                    s.Append(sTableNameToPuts);
                    s.Append("指定=");
                    s.Append(sFpath);
                    s.Append("]");
                    cf_Fpath1 = new Configurationtree_NodeFilepathImpl(s.ToString(), null);
                    //cf_Fpath = new Configurationtree_NodeFilepathImpl("ファイルパス出典未指定L11_1", new Configurationtree_NodeImpl(s.ToString(), null));
                }

                cf_Fpath1.InitPath(sFpath, log_Reports);

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

                ec_Fpath = new Expression_Node_FilepathImpl(cf_Fpath1);
            }

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

                this.Owner_MemoryApplication.CreateErrorReport("Er:110009;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Example #29
0
        //────────────────────────────────────────

        /// <summary>
        /// <data>要素の読取。
        /// </summary>
        /// <param select="xDataSource"></param>
        /// <param select="fcUc"></param>
        public void Translate(
            Configurationtree_Node cur_Cf,    //<data>要素
            Expression_Node_String parent_Ec, //「S■form-component」
            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, "CfToEc", log_Reports);

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

            //
            //
            //
            //


            //
            //
            //
            // 自
            //
            //
            //
            Expression_NodeImpl cur_Ec = new Expression_NodeImpl(parent_Ec, cur_Cf, memoryApplication);


            //
            //
            //
            // 属性
            //
            //
            //
            string err_SAttrName;

            cur_Cf.Dictionary_Attribute.ForEach(delegate(string sPmName, string sValue, ref bool bBreak)
            {
                if (
                    PmNames.S_MEMORY.Name_Pm == sPmName ||
                    PmNames.S_ACCESS.Name_Pm == sPmName ||
                    PmNames.S_NAME_TABLE.Name_Pm == sPmName ||
                    PmNames.S_NAME_VAR.Name_Pm == sPmName || //.Z_ITEM_VALUE_TO_VARIABLE
                    PmNames.S_DESCRIPTION.Name_Pm == sPmName
                    )
                {
                    //ystem.Console.WriteLine(Info_SToE.LibraryName + ":" + this.GetType().Name + "#SToE: <データT >に属性追加 [" + sKey + "]←[" + sValue + "]");

                    // なんでも属性として追加。
                    Expression_Node_String ec_Value = new Expression_Leaf_StringImpl(sValue, cur_Ec, cur_Cf);
                    cur_Ec.SetAttribute(sPmName, ec_Value, log_Reports);
                }
                else
                {
                    err_SAttrName = sPmName;
                    bBreak        = true;
                    goto gt_Error_UndefinedAttr;
                }

                goto gt_gt_EndMethod2;
                //
                //
                //
                //
                gt_Error_UndefinedAttr:
                {
                    Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                    tmpl.SetParameter(1, cur_Cf.Name, log_Reports);                                        //設定ノード名
                    tmpl.SetParameter(2, err_SAttrName, log_Reports);                                      //属性名
                    tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports); //設定位置パンくずリスト

                    memoryApplication.CreateErrorReport("Er:7002;", tmpl, log_Reports);
                }
                goto gt_gt_EndMethod2;

                gt_gt_EndMethod2:
                ;
            });


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


            //
            //
            //
            // 親へ連結
            //
            //
            //
            parent_Ec.List_Expression_Child.Add(cur_Ec, log_Reports);



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

            log_Method.EndMethod(log_Reports);
        }
Example #30
0
        //────────────────────────────────────────

        /// <summary>
        /// ファイルからテーブルを読み取り、モデルに内容を挿入します。
        /// </summary>
        /// <param name="moMre"></param>
        /// <param name="log_Reports"></param>
        public override string Execute5_Main(Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

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

            string sFncName;

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

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

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

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

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

                //
                //
                //
                //

                //
                // 「バックアップ対象のファイルのパス一覧」の変数準備。
                //
                this.List_Expression_Filepath_BackupRequest_Out = new List <Expression_Node_Filepath>();


                //
                //
                //
                //「Aa_Files.csv」
                //
                //
                //
                string name_Table = this.GetSNameTableAafilescsv();
                if ("" == name_Table)
                {
                    goto gt_Error_EmptynameTable;
                }


                //
                //
                //
                //()テーブル読取り。
                //
                //
                //
                Table_Humaninput xenonTable_Aafilescsv;
                if (log_Reports.Successful)
                {
                    xenonTable_Aafilescsv = this.Read_AaFilesCsv(log_Reports);
                }
                else
                {
                    xenonTable_Aafilescsv = null;
                }


                //
                //
                //
                // 「Aa_Files.csv」を、アプリケーションにそのまま追加。
                //
                //
                //
                if (log_Reports.Successful)
                {
                    this.Owner_MemoryApplication.MemoryTables.AddTable_Humaninput(xenonTable_Aafilescsv, log_Reports);
                }


                //
                // 「Aa_Files.csvに書かれているテーブルと、スクリプトファイル」を読取り、登録。
                if (log_Reports.Successful)
                {
                    // 正常時

                    this.ReadAndRegisterFiles(xenonTable_Aafilescsv, log_Reports);
                }


                //
                // 日別バックアップ用の準備
                //
                if (log_Reports.Successful)
                {
                    // 正常時
                    this.RegisterDateBackup(log_Reports);
                }



                //
                // TODO:「フォーム一覧テーブル」を更に読取に行く。
                //
                if (this.Owner_MemoryApplication.MemoryTables.Dictionary_Table_Humaninput.ContainsKey(NamesVar.S_ST_AA_FORMS))
                {
                    //
                    // 「フォーム一覧テーブル」
                    Table_Humaninput o_Table_Aaformscsv = this.Owner_MemoryApplication.MemoryTables.Dictionary_Table_Humaninput[NamesVar.S_ST_AA_FORMS];

                    //
                    // 「テーブルに書かれているテーブル」を読取り、登録。
                    if (log_Reports.Successful)
                    {
                        // 正常時

                        this.ReadAndRegisterFiles(o_Table_Aaformscsv, log_Reports);
                    }
                }
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_EmptynameTable:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, PmNames.S_NAME_TABLE.Name_Pm, log_Reports);                                       //引数名
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(this.Cur_Configuration), log_Reports); //設定位置パンくずリスト

                this.Owner_MemoryApplication.CreateErrorReport("Er:110008;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return("");
        }