/// <summary>
        /// PanelSettingsRowを取得する
        /// </summary>
        /// <param name="panelName">パネルの名前</param>
        public PanelSettings FindPanelSettingByName(string panelName)
        {
            var settings = new PanelSettings()
            {
                PanelName          = panelName,
                Top                = 10,
                Left               = 10,
                Margin             = 5,
                Horizontal         = false,
                FixedPositionSpell = false,
            };

            lock (this.spellTimerPanels)
            {
                var s = PanelTable.Instance.SettingsTable
                        .Where(x => x.PanelName == panelName)
                        .FirstOrDefault();

                if (s != null)
                {
                    settings = s;
                }
                else
                {
                    PanelTable.Instance.SettingsTable.Add(settings);
                }
            }

            return(settings);
        }
        public PanelSettings GetPanelSettings(
            string panelName)
        {
            double normalize(double value)
            {
                var result = value;

                if (double.IsNaN(result))
                {
                    result = 0;
                }

                if (value > 65535)
                {
                    result = 65535;
                }

                if (value < -65535)
                {
                    result = -65535;
                }

                return(result);
            }

            var settings = new PanelSettings()
            {
                PanelName          = panelName,
                Top                = 10,
                Left               = 10,
                Margin             = 5,
                Horizontal         = false,
                FixedPositionSpell = false,
            };

            lock (this.spellTimerPanels)
            {
                var panel = this.FindPanelByName(panelName);
                if (panel != null)
                {
                    settings.Top                = panel.Top;
                    settings.Left               = panel.Left;
                    settings.Margin             = panel.SpellMargin;
                    settings.Horizontal         = panel.IsHorizontal;
                    settings.FixedPositionSpell = panel.SpellPositionFixed;
                }
                else
                {
                    var s = this.FindPanelSettingByName(panelName);
                    if (s != null)
                    {
                        settings = s;
                    }
                }
            }

            // 変な値が入っていたら補正する
            settings.Top    = normalize(settings.Top);
            settings.Left   = normalize(settings.Left);
            settings.Margin = normalize(settings.Margin);

            return(settings);
        }