Esempio n. 1
0
        //private void MinimizeViews(RSSView maximized)
        //{
        //    RSSView view;

        //    foreach (Control ctrl in this.rssFlowPanel.Controls)
        //    {
        //        view = (ctrl as RSSView);

        //        if ((null != view) && (view != maximized) && (view.Maximized))
        //        {
        //            view.Maximized = false;
        //        }
        //    }
        //}

        private void FlowLayoutPanel_ControlAdded(object sender, ControlEventArgs e)
        {
            if (e.Control is RSSView)
            {
                RSSView view = e.Control as RSSView;

                // Set Size
                SetViewSize(view);

                // Handle link click
                view.LinkClicked += new System.Windows.Forms.Samples.LinkClickedEventHandler(RSSView_LinkClicked);

                // Handle Expand/Compress
                //view.StateChanged += delegate(object sview, EventArgs args)
                //{
                //    // Check
                //    RSSView     vw = (sview as RSSView);

                //    if ((null != vw) && (vw.Maximized))
                //    {
                //        MinimizeViews(vw);
                //    }
                //};
            }
        }
Esempio n. 2
0
        private void SetViewSize(RSSView view)
        {
            // Get width of view
            int padding   = view.Margin.Right + view.Margin.Left;
            int viewWidth = view.MinimumSize.Width + padding;
            int halfWidth = _width / 2;

            // Set width
            if (halfWidth > viewWidth)
            {
                view.Width = halfWidth - padding;
            }
            else
            {
                view.Width = (_width - padding);
            }
        }
Esempio n. 3
0
        private void AddView(string url, bool maximized, bool showImage)
        {
            // Create view
            RSSView     view = new RSSView();

            // Minimize other views
            //if (maximized)
            //{
            //    MinimizeViews(null);
            //}

            // Initialize view
            view.ShowImage = showImage;
            view.Maximized = maximized;

            // Add to panel
            this.rssFlowPanel.Controls.Add(view);

            // Set URL
            view.URL = url;
        }
Esempio n. 4
0
        private void AddView(string url, bool maximized, bool showImage)
        {
            // Create view
            RSSView view = new RSSView();

            // Minimize other views
            //if (maximized)
            //{
            //    MinimizeViews(null);
            //}

            // Initialize view
            view.ShowImage = showImage;
            view.Maximized = maximized;

            // Add to panel
            this.rssFlowPanel.Controls.Add(view);

            // Set URL
            view.URL = url;
        }
Esempio n. 5
0
        private void SetViewSize(RSSView view)
        {
            // Get width of view
            int     padding = view.Margin.Right + view.Margin.Left;
            int     viewWidth = view.MinimumSize.Width + padding;
            int     halfWidth = _width / 2;

            // Set width
            if (halfWidth > viewWidth)
            {
                view.Width = halfWidth - padding;
            }
            else
            {
                view.Width = (_width - padding);
            }
        }