// Add a resource
        private void addresource_Click(object sender, EventArgs e)
        {
            ResourceOptionsForm resoptions;
            Rectangle           startposition;

            // Open resource options dialog
            resoptions = new ResourceOptionsForm(new DataLocation(), "Add Resource");
            resoptions.StartPosition = FormStartPosition.Manual;
            startposition            = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);
            startposition            = this.RectangleToScreen(startposition);
            Screen screen = Screen.FromPoint(startposition.Location);

            if (startposition.X + resoptions.Size.Width > screen.WorkingArea.Right)
            {
                startposition.X = screen.WorkingArea.Right - resoptions.Size.Width;
            }
            if (startposition.Y + resoptions.Size.Height > screen.WorkingArea.Bottom)
            {
                startposition.Y = screen.WorkingArea.Bottom - resoptions.Size.Height;
            }
            resoptions.Location = startposition.Location;
            if (resoptions.ShowDialog(this) == DialogResult.OK)
            {
                // Add resource
                AddItem(resoptions.ResourceLocation);
            }

            // Raise content changed event
            if (OnContentChanged != null)
            {
                OnContentChanged();
            }
        }
        // Edit resource
        private void editresource_Click(object sender, EventArgs e)
        {
            ResourceOptionsForm resoptions;
            Rectangle           startposition;
            ListViewItem        selecteditem;
            DataLocation        rl;

            // Anything selected?
            if (resourceitems.SelectedItems.Count > 0)
            {
                // Get selected item
                selecteditem = resourceitems.SelectedItems[0];

                // Open resource options dialog
                resoptions = new ResourceOptionsForm((DataLocation)selecteditem.Tag, "Resource Options");
                resoptions.StartPosition = FormStartPosition.Manual;
                startposition            = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);
                startposition            = this.RectangleToScreen(startposition);
                Screen screen = Screen.FromPoint(startposition.Location);
                if (startposition.X + resoptions.Size.Width > screen.WorkingArea.Right)
                {
                    startposition.X = screen.WorkingArea.Right - resoptions.Size.Width;
                }
                if (startposition.Y + resoptions.Size.Height > screen.WorkingArea.Bottom)
                {
                    startposition.Y = screen.WorkingArea.Bottom - resoptions.Size.Height;
                }
                resoptions.Location = startposition.Location;
                if (resoptions.ShowDialog(this) == DialogResult.OK)
                {
                    // Start editing list
                    resourceitems.BeginUpdate();

                    // Update item
                    rl = resoptions.ResourceLocation;
                    selecteditem.Text       = rl.location;
                    selecteditem.Tag        = rl;
                    selecteditem.ImageIndex = GetIconIndex(rl.type, false);

                    // Done
                    resourceitems.EndUpdate();

                    // Raise content changed event
                    if (OnContentChanged != null)
                    {
                        OnContentChanged();
                    }
                }
            }
        }
        // Add a resource
        private void addresource_Click(object sender, EventArgs e)
        {
            // Open resource options dialog
            ResourceOptionsForm resoptions = new ResourceOptionsForm(new DataLocation(), "Add Resource", StartPath);

            resoptions.StartPosition = FormStartPosition.Manual;
            Rectangle startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);

            startposition = this.RectangleToScreen(startposition);
            Screen screen = Screen.FromPoint(startposition.Location);

            if (startposition.X + resoptions.Size.Width > screen.WorkingArea.Right)
            {
                startposition.X = screen.WorkingArea.Right - resoptions.Size.Width;
            }
            if (startposition.Y + resoptions.Size.Height > screen.WorkingArea.Bottom)
            {
                startposition.Y = screen.WorkingArea.Bottom - resoptions.Size.Height;
            }
            resoptions.Location = startposition.Location;
            if (resoptions.ShowDialog(this) == DialogResult.OK)
            {
                // Add resource
                if (!AddItem(resoptions.ResourceLocation))
                {
                    General.Interface.DisplayStatus(StatusType.Warning, "Resource already added!"); //mxd
                    return;                                                                         //mxd
                }
            }

            // Raise content changed event
            if (OnContentChanged != null)
            {
                OnContentChanged();
            }
        }