private void ShowSelectedButton(TreeNode item)
        {
            panelParams.Controls.Clear();
            if (item == null)
            {
                tbButtonDisplayName.Text = "";
                btnPicture.ImageIndex    = -1;
                return;
            }

            var group = item.Tag as ToolButtonGroup;

            if (group != null)
            {
                // показать настройки группы кнопок - картинку и заголовок
                tbButtonDisplayName.Text             = group.Title;
                btnPicture.ImageIndex                = group.ImageIndex;
                isVisibleDisplayNameCheckBox.Enabled = false;
                isVisibleDisplayNameCheckBox.Checked = false;
                return;
            }

            var btnSets = (ChartToolButtonSettings)item.Tag;

            if (btnSets == null)
            {
                return;
            }
            tbButtonDisplayName.Text             = btnSets.ToString();
            btnPicture.ImageIndex                = btnSets.Image;
            isVisibleDisplayNameCheckBox.Enabled = true;
            isVisibleDisplayNameCheckBox.Checked = btnSets.IsVisibleDisplayName;

            // показать параметры команды
            const int editorHeight = 23;

            foreach (var ptr in btnSets.toolParams)
            {
                var editor = new GenericObjectEditor(ptr.title, ptr.paramType, ptr.defaultValue);
                editor.SetBounds(0, 0, 100, editorHeight);
                editor.Dock = DockStyle.Top;
                panelParams.Controls.Add(editor);
            }
        }
        private void ShowSelectedButton(TreeNode item)
        {
            panelParams.Controls.Clear();
            if (item == null)
            {
                tbButtonDisplayName.Text = "";
                btnPicture.ImageIndex = -1;
                return;
            }

            var group = item.Tag as ToolButtonGroup;
            if (group != null)
            {
                // показать настройки группы кнопок - картинку и заголовок
                tbButtonDisplayName.Text = group.Title;
                btnPicture.ImageIndex = group.ImageIndex;
                isVisibleDisplayNameCheckBox.Enabled = false;
                isVisibleDisplayNameCheckBox.Checked = false;
                return;
            }

            var btnSets = (ChartToolButtonSettings) item.Tag;
            if (btnSets == null)
                return;
            tbButtonDisplayName.Text = btnSets.ToString();
            btnPicture.ImageIndex = btnSets.Image;
            isVisibleDisplayNameCheckBox.Enabled = true;
            isVisibleDisplayNameCheckBox.Checked = btnSets.IsVisibleDisplayName;

            // показать параметры команды
            const int editorHeight = 23;
            foreach (var ptr in btnSets.toolParams)
            {
                var editor = new GenericObjectEditor(ptr.title, ptr.paramType, ptr.defaultValue);
                editor.SetBounds(0, 0, 100, editorHeight);
                editor.Dock = DockStyle.Top;
                panelParams.Controls.Add(editor);
            }
        }
        private void ShowSeriesSettings(Type seriesType)
        {
            // очистить
            panelSeriesParams.Controls.Clear();
            if (seriesType == null) return;

            // добавить редакторы
            const int editorHeight = 24;
            foreach (var prop in seriesType.GetProperties(BindingFlags.Static | BindingFlags.Public))
            {
                if (prop.GetCustomAttributes(typeof(PropertyXMLTagAttribute), true).Length == 0) continue;
                // имя параметра
                var paramName = prop.Name;
                var displayAttrs = prop.GetCustomAttributes(typeof(DisplayNameAttribute), true);
                if (displayAttrs.Length == 1)
                    paramName = ((DisplayNameAttribute) displayAttrs[0]).DisplayName;

                // редактор
                var editor = new GenericObjectEditor(paramName, prop.PropertyType, prop.GetValue(null, null))
                                 {Tag = prop};
                editor.SetBounds(0, 0, 100, editorHeight);
                editor.Dock = DockStyle.Top;
                panelSeriesParams.Controls.Add(editor);
            }
        }