Ejemplo n.º 1
0
        //────────────────────────────────────────

        /// <summary>
        /// スタイルシート・テーブルは、最低限「NAME」「STYLE」の2つで構成されたテーブルです。
        /// </summary>
        /// <param name="oStyleSheetTable"></param>
        /// <returns></returns>
        public MemoryStyles Translate(
            Table_Humaninput xenonTable_Stylesheet,
            Log_Reports log_Reports
            )
        {
            Log_Method pg_Method = new Log_MethodImpl();

            pg_Method.BeginMethod(Info_Operating.Name_Library, this, "MToO", log_Reports);

            //
            //
            //
            //

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

            MemoryStyles oStyleAttrList = new MemoryStylesImpl();

            int nIndex = 0;

            foreach (DataRow dataRow in xenonTable_Stylesheet.DataTable.Rows)
            {
                string sId;
                if (log_Reports.Successful)
                {
                    // 正常時

                    Value_Humaninput valueH;
                    if (log_Reports.Successful)
                    {
                        // 正常時

                        valueH = Utility_Row.GetFieldvalue(
                            "NAME",
                            dataRow,
                            true,
                            log_Reports,
                            "スタイルシートテーブル(NAME検索時)"
                            );
                        if (!log_Reports.Successful)
                        {
                            // 既エラー。
                            goto gt_EndMethod;
                        }
                    }
                    else
                    {
                        valueH = null;
                    }

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

                        sId = ((Value_Humaninput)valueH).Text;//"スタイルシートテーブルパーサーのID"
                    }
                    else
                    {
                        sId = "";
                    }
                }
                else
                {
                    sId = "";
                }

                string sStyle;
                if (log_Reports.Successful)
                {
                    // 正常時

                    Value_Humaninput valueH = Utility_Row.GetFieldvalue(
                        "STYLE",
                        dataRow,
                        true,
                        log_Reports,
                        "スタイルシートテーブル(STYLE検索時)"
                        );
                    if (!log_Reports.Successful)
                    {
                        // 既エラー。
                        goto gt_EndMethod;
                    }

                    sStyle = ((Value_Humaninput)valueH).Text;//"スタイルシートテーブルパーサーのSTYLE"
                }
                else
                {
                    sStyle = "";
                }

                RecordXenonStyle item = new RecordXenonStyleImpl();
                item.Id    = sId;
                item.Style = sStyle;
                oStyleAttrList.Dictionary_RecordStyle.Add(sId, item);

                nIndex++;
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_NullTable:
            {
                oStyleAttrList = null;

                if (log_Reports.CanCreateReport)
                {
                    Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                    r.SetTitle("▲エラー99999!", pg_Method);

                    StringBuilder t = new StringBuilder();
                    t.Append("テーブルがヌルでした。");
                    t.Append(Environment.NewLine);
                    t.Append(Environment.NewLine);

                    // ヒント

                    r.Message = t.ToString();
                    log_Reports.EndCreateReport();
                }
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            pg_Method.EndMethod(log_Reports);
            return(oStyleAttrList);
        }
Ejemplo n.º 2
0
        //────────────────────────────────────────
        #endregion



        #region イベントハンドラー
        //────────────────────────────────────────

        public override string P2b_GetStyleName(
            int nCurIx, CustomcontrolListbox cctLst, Log_Reports pg_Logging
            )
        {
            Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            pg_Method.BeginMethod(Info_LayoutImpl.Name_Library, this, "P2_GetStyleAttrNames", pg_Logging);
            //
            //


            string sResult;

            // 行をセットしたので、取り出されるのも行です。
            // DataRowをセットしましたが、取り出されるのは DataRowViewになるようです。
            DataRowView row = (DataRowView)cctLst.Items[nCurIx];

            // スタイルのNAME値が入っている。
            Value_Humaninput valueH = Utility_Row.GetFieldvalue(
                NamesFld.S_EXPL_SS,
                row.Row,
                false,//該当なしも可
                pg_Logging,
                Info_LayoutImpl.Name_Library + ":" + this.GetType().Name + "#P2_:リストボックスのEXPL-SS"
                );

            if (!pg_Logging.Successful)
            {
                // 既エラー。
                sResult = "";
                goto gt_EndMethod;
            }

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

                if (null == valueH)
                {
                    sResult = "";
                }
                else
                {
                    sResult = ((Value_Humaninput)valueH).Text;
                }
            }
            else
            {
                sResult = "";
            }

            goto gt_EndMethod;

            //
            //
            //
            //
gt_EndMethod:
            pg_Method.EndMethod(pg_Logging);
            return(sResult);
        }