Пример #1
0
        private void lvwPlaces_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (int i = 0; i < pnlPlaceDetail.Controls.Count; i++)
            {
                pnlPlaceDetail.Controls[i].Dispose();
            }
            pnlPlaceDetail.Controls.Clear();

            if (lvwPlaces.SelectedItems.Count == 1)
            {
                Landmark l = new Landmark(instance, ((DirectoryManager.DirectoryParcel)lvwPlaces.SelectedItems[0].Tag).ID);
                l.Dock = DockStyle.Fill;
                pnlPlaceDetail.Controls.Add(l);
            }
        }
Пример #2
0
        private void tmnuCreateLandmark_Click(object sender, EventArgs e)
        {
            string location = string.Format(", {0} ({1}, {2}, {3})",
                client.Network.CurrentSim.Name,
                (int)client.Self.SimPosition.X,
                (int)client.Self.SimPosition.Y,
                (int)client.Self.SimPosition.Z
                );

            string name = tlblParcel.Text;
            int maxLen = 63 - location.Length;

            if (name.Length > maxLen)
                name = name.Substring(0, maxLen);

            name += location;

            client.Inventory.RequestCreateItem(
                client.Inventory.FindFolderForType(AssetType.Landmark),
                name,
                tlblParcel.ToolTipText,
                AssetType.Landmark,
                UUID.Random(),
                InventoryType.Landmark,
                PermissionMask.All,
                (bool success, InventoryItem item) =>
                {
                    if (success)
                    {
                        BeginInvoke(new MethodInvoker(() =>
                            {
                                Landmark ln = new Landmark(instance, (InventoryLandmark)item);
                                ln.Dock = DockStyle.Fill;
                                ln.Detached = true;
                            }));
                    }
                }
            );
        }
Пример #3
0
        void UpdateItemInfo(InventoryItem item)
        {
            foreach (Control c in pnlDetail.Controls)
            {
                c.Dispose();
            }
            pnlDetail.Controls.Clear();
            pnlItemProperties.Tag = item;

            if (item == null)
            {
                pnlItemProperties.Visible = false;
                return;
            }

            pnlItemProperties.Visible = true;
            btnProfile.Enabled = true;
            txtItemName.Text = item.Name;
            txtItemDescription.Text = item.Description;
            txtCreator.AgentID = item.CreatorID;
            txtCreator.Tag = item.CreatorID;
            txtCreated.Text = item.CreationDate.ToString();

            if (item.AssetUUID != UUID.Zero)
            {
                txtAssetID.Text = item.AssetUUID.ToString();
            }
            else
            {
                txtAssetID.Text = String.Empty;
            }

            Permissions p = item.Permissions;
            cbOwnerModify.Checked = (p.OwnerMask & PermissionMask.Modify) != 0;
            cbOwnerCopy.Checked = (p.OwnerMask & PermissionMask.Copy) != 0;
            cbOwnerTransfer.Checked = (p.OwnerMask & PermissionMask.Transfer) != 0;

            cbNextOwnModify.CheckedChanged -= cbNextOwnerUpdate_CheckedChanged;
            cbNextOwnCopy.CheckedChanged -= cbNextOwnerUpdate_CheckedChanged;
            cbNextOwnTransfer.CheckedChanged -= cbNextOwnerUpdate_CheckedChanged;

            cbNextOwnModify.Checked = (p.NextOwnerMask & PermissionMask.Modify) != 0;
            cbNextOwnCopy.Checked = (p.NextOwnerMask & PermissionMask.Copy) != 0;
            cbNextOwnTransfer.Checked = (p.NextOwnerMask & PermissionMask.Transfer) != 0;

            cbNextOwnModify.CheckedChanged += cbNextOwnerUpdate_CheckedChanged;
            cbNextOwnCopy.CheckedChanged += cbNextOwnerUpdate_CheckedChanged;
            cbNextOwnTransfer.CheckedChanged += cbNextOwnerUpdate_CheckedChanged;

            switch (item.AssetType)
            {
                case AssetType.Texture:
                    SLImageHandler image = new SLImageHandler(instance, item.AssetUUID, item.Name, IsFullPerm(item));
                    image.Dock = DockStyle.Fill;
                    pnlDetail.Controls.Add(image);
                    break;

                case AssetType.Notecard:
                    Notecard note = new Notecard(instance, (InventoryNotecard)item);
                    note.Dock = DockStyle.Fill;
                    note.TabIndex = 3;
                    note.TabStop = true;
                    pnlDetail.Controls.Add(note);
                    note.rtbContent.Focus();
                    break;

                case AssetType.Landmark:
                    Landmark landmark = new Landmark(instance, (InventoryLandmark)item);
                    landmark.Dock = DockStyle.Fill;
                    pnlDetail.Controls.Add(landmark);
                    break;

                case AssetType.LSLText:
                    ScriptEditor script = new ScriptEditor(instance, (InventoryLSL)item);
                    script.Dock = DockStyle.Fill;
                    script.TabIndex = 3;
                    script.TabStop = true;
                    pnlDetail.Controls.Add(script);
                    break;

                case AssetType.Gesture:
                    Guesture gesture = new Guesture(instance, (InventoryGesture)item);
                    gesture.Dock = DockStyle.Fill;
                    pnlDetail.Controls.Add(gesture);
                    break;

            }

            tabsInventory.SelectedTab = tabDetail;
        }
Пример #4
0
        private void lvwPlaces_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (int i = 0; i < pnlPlaceDetail.Controls.Count; i++)
            {
                pnlPlaceDetail.Controls[i].Dispose();
            }
            pnlPlaceDetail.Controls.Clear();

            if (lvwPlaces.SelectedItems.Count == 1)
            {
                Landmark l = new Landmark(instance, ((DirectoryManager.DirectoryParcel)lvwPlaces.SelectedItems[0].Tag).ID);
                l.Dock = DockStyle.Fill;
                pnlPlaceDetail.Controls.Add(l);
            }
        }
Пример #5
0
        void attachmentMenuItem_Click(object sender, EventArgs e)
        {
            if (sender is ToolStripMenuItem)
            {
                ToolStripMenuItem titem = (ToolStripMenuItem)sender;
                InventoryItem item = (InventoryItem)titem.Tag;

                switch (item.AssetType)
                {
                    case AssetType.Texture:
                        SLImageHandler ih = new SLImageHandler(instance, item.AssetUUID, string.Empty);
                        ih.Text = item.Name;
                        ih.ShowDetached();
                        break;

                    case AssetType.Landmark:
                        Landmark ln = new Landmark(instance, (InventoryLandmark)item);
                        ln.ShowDetached();
                        break;

                    case AssetType.Notecard:
                        client.Inventory.RequestCopyItemFromNotecard(UUID.Zero,
                            notecard.UUID,
                            notecard.ParentUUID,
                            item.UUID,
                            Inventory_OnInventoryItemCopied);
                        break;
                }
            }
        }