示例#1
0
        /* ----------------------------------------------------------------- */
        ///
        /// InitializeTags
        ///
        /// <summary>
        /// 各種タグの状態を更新します。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private void InitializeTags(IEnumerable <Tag> tags)
        {
            try {
                TagsPanel.SuspendLayout();
                if (tags == null)
                {
                    return;
                }

                TagsPanel.Controls.Clear();
                foreach (var tag in tags)
                {
                    TagsPanel.Controls.Add(Create(tag));
                }
            }
            finally
            {
                TagsPanel.ControlAdded   -= TagsPanel_ControlAdded;
                TagsPanel.ControlAdded   += TagsPanel_ControlAdded;
                TagsPanel.ControlRemoved -= TagsPanel_ControlRemoved;
                TagsPanel.ControlRemoved += TagsPanel_ControlRemoved;

                TagsPanel.ResumeLayout();
            }
        }
示例#2
0
        /* ----------------------------------------------------------------- */
        ///
        /// InitializeLayout
        ///
        /// <summary>
        /// レイアウトを初期化します。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private void InitializeLayout(Page src, IEnumerable <Tag> tags)
        {
            AbstractLabel.Text   = src.GetAbstract();
            CreationLabel.Text   = src.Creation.ToString(Properties.Resources.CreationFormat);
            LastUpdateLabel.Text = src.LastUpdate.ToString(Properties.Resources.LastUpdateFormat);

            TagsPanel.SuspendLayout();
            foreach (var tag in tags)
            {
                var button = new TagButton(tag, Dpi / BaseDpi);
                button.Name = tag.Name;
                if (src.Tags.Contains(tag.Name))
                {
                    button.Checked = true;
                }
                TagsPanel.Controls.Add(button);
            }
            TagsPanel.ResumeLayout();

            UpdateLayout(Dpi / BaseDpi);
        }