Exemplo n.º 1
0
        public StateControl(API.DriveService.Stream stream)
        {
            try
            {
                InitializeComponent();

                Enabled = false;
                Stream  = stream;

                if (stream.IsFolder)
                {
                    pictureBox1.Image = global::DriveProxy.Properties.Resources.smFolder;
                }
                else
                {
                    Icon icon = DriveService.GetFileIcon(stream.FileInfo, 16, 16, true);

                    if (icon == null)
                    {
                        pictureBox1.Image = global::DriveProxy.Properties.Resources.smFile;
                    }
                    else
                    {
                        pictureBox1.Image = icon.ToBitmap();

                        icon.Dispose();
                        icon = null;
                    }
                }

                labelDescription.Text = stream.Title;

                stream.OnProgressChanged += Stream_ProgressChanged;

                labelStatus.Text = "Queued for " + stream.Type;
            }
            catch (Exception exception)
            {
                Log.Error(exception, false);
            }
        }