private void resourcesList_DoubleClick(object sender, System.EventArgs e)
        {
            Resource res = (Resource)resourcesList.SelectedItem;

            if (res != null)
            {
                AddResourceForm form = new AddResourceForm();
                form.SetModify(res.Name, res.Url);

                DialogResult result = form.ShowDialog(this);
                if (result != DialogResult.Cancel)
                {
                    res.Name = form.ResourceName;
                    res.Url  = form.ResourceUrl;

                    bool success = resourceDAO.UpdateResource(res.ID, res.Name, res.Url);

                    if (success)
                    {
                        RefreshResourceList();
                    }
                    else
                    {
                        Error("Could not update resource.");
                    }
                }
            }
        }
        private void addResourceButton_Click(object sender, System.EventArgs e)
        {
            AddResourceForm form   = new AddResourceForm();
            DialogResult    result = form.ShowDialog(this);

            if (result != DialogResult.Cancel)
            {
                Resource resource = new Resource();
                resource.Name = form.ResourceName;
                resource.Url  = form.ResourceUrl;
                string id = resourceDAO.AddNewResource(resource);
                if (id.Length > 0)
                {
                    resourcesList.Items.Add(resource);
                }
                else
                {
                    Error("Could not add resource.");
                }
            }
        }