Example #1
0
        private FrmViewer(long tweetId, List<MediaInfo> lst)
        {
            this.m_lst = lst;
            this.m_containsVideo = lst.Exists(e => e.MediaType == MediaTypes.Video);
            this.TweetId = tweetId;

            InitializeComponent();
            this.Text = "[ 0 / 0 ] Azpe";

            this.SuspendLayout();

            this.m_pic			= new ImageViwer();
            this.m_pic.Dock		= DockStyle.Fill;
            this.m_pic.Visible	= false;
            this.Controls.Add(this.m_pic);

            if (this.m_containsVideo)
            {
                this.m_media		= new VideoViewer();
                this.m_host			= new ElementHost();
                this.m_host.Visible	= false;
                this.m_host.Dock	= DockStyle.Fill;
                this.m_host.Child	= this.m_media;
                this.Controls.Add(this.m_host);
            }

            this.ResumeLayout(false);

            lst.ForEach(e => { e.SetParent(this); e.StartDownload(); });

            if (Settings.Left != -1)	this.Left	= Settings.Left;
            if (Settings.Top != -1)		this.Top	= Settings.Top;
            if (Settings.Width != -1)	this.Width	= Settings.Width;
            if (Settings.Height != -1)	this.Height	= Settings.Height;
        }
Example #2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (this.sfd != null)
                {
                    this.sfd.Dispose();
                    this.sfd = null;
                }

                if (this.m_pic != null)
                {
                    this.m_pic.Dispose();
                    this.m_pic = null;
                }

                if (this.m_host != null)
                {
                    this.m_host.Dispose();
                    this.m_host	= null;
                }

                this.m_lst.ForEach(e => e.Dispose());
            }
            base.Dispose(disposing);
        }