Radegast.SLImageHandler.Init C# (CSharp) Method

Init() public method

public Init ( Radegast.RadegastInstance instance, UUID image, string label ) : void
instance Radegast.RadegastInstance
image UUID
label string
return void
        public void Init(RadegastInstance instance, UUID image, string label)
        {
            Disposed += new EventHandler(SLImageHandler_Disposed);
            pictureBox1.AllowDrop = true;

            this.instance = instance;
            this.imageID = image;

            Text = string.IsNullOrEmpty(label) ? "Image" : label;

            if (image == UUID.Zero)
            {
                progressBar1.Hide();
                lblProgress.Hide();
                pictureBox1.Enabled = true;
                return;
            }

            // Callbacks
            client.Assets.ImageReceiveProgress += new EventHandler<ImageReceiveProgressEventArgs>(Assets_ImageReceiveProgress);
            UpdateImage(imageID);
        }

Usage Example

        void UpdateParcelDisplay()
        {
            Parcel p = instance.State.Parcel;

            txtParcelTitle.Text       = p.Name;
            txtParcelDescription.Text = p.Desc;
            lblSimType.Text           = client.Network.CurrentSim.ProductName;

            pnlParcelImage.Controls.Clear();

            if (p.SnapshotID != UUID.Zero)
            {
                SLImageHandler imgParcel = new SLImageHandler {
                    Dock = DockStyle.Fill
                };
                pnlParcelImage.Controls.Add(imgParcel);
                imgParcel.Init(instance, p.SnapshotID, string.Empty);
            }

            if (p.IsGroupOwned)
            {
                txtOwner.Text = "(Group owned)";
            }
            else
            {
                txtOwner.AgentID = p.OwnerID;
            }

            if (p.GroupID != UUID.Zero)
            {
                parcelGroupID = p.GroupID;
                client.Groups.RequestGroupName(p.GroupID);
            }

            lblTraffic.Text     = string.Format("{0:0}", p.Dwell);
            lblSimPrims.Text    = string.Format("{0} / {1}", p.SimWideTotalPrims, p.SimWideMaxPrims);
            lblParcelPrims.Text = string.Format("{0} / {1}", p.TotalPrims, p.MaxPrims);
            lblAutoReturn.Text  = p.OtherCleanTime.ToString();
            lblArea.Text        = p.Area.ToString();
        }
All Usage Examples Of Radegast.SLImageHandler::Init