private void btnAddTags_Click(object sender, EventArgs e)
 {
     Tags tags = new Tags();
     InputBox form = new InputBox("Add tags", "Add tags seperated by ;", "tag1;tag2;tag3");
     DialogResult result = form.ShowDialog(this);
     if (result == DialogResult.OK)
     {
         tags.AddTags(form.InputTekst, false);
     }
 }
        private void btnExport_Click(object sender, EventArgs e)
        {
            Tags tags = new Tags();
            ArrayList list = new ArrayList();
            DialogResult result = saveFileDialog1.ShowDialog(this);

            if(result == DialogResult.OK)
            {
                StreamWriter sw = null;
                try
                {
                    sw = new StreamWriter(saveFileDialog1.FileName, false, Encoding.UTF8);
                    if (rbShowTags.Checked)
                    {
                        list = tags.GetTags(txtSearchBox.Text);
                        sw.WriteLine("tag,info");
                        foreach (Tag tag in list)
                        {
                            sw.WriteLine(tag.Name + "," + tag.Info.Replace(",", "<;>"));
                        }

                    }
                    else if (rbShowTexts.Checked)
                    {

                    }
                }
                catch (Exception exc)
                {
                    Log.Write(exc, this.Name, "btnExport_Click", Log.LogType.ERROR);
                }
                finally
                {
                    sw.Close();
                }
            }
        }
 private void ShowTagsTexts(string tagsText)
 {
     Tags tags = new Tags();
     dgwPanel.Rows.Clear();
     Application.DoEvents();
     if (rbShowTags.Checked)
     {
         tags.GetTags(tagsText);
     }
     else if (rbShowTexts.Checked)
     {
         tags.GetTexts(tagsText);
     }
     foreach (Tag tag in tags.List)
     {
         DataGridViewRow row = dgwPanel.Rows[dgwPanel.Rows.Add()];
         row.Cells["tag"].Value = tag.Name;
         row.Cells["tag"].Tag = tag.ID;
         row.Cells["info"].Value = tag.Info;
         row.Cells["Edit"].Value = "Edit";
     }
 }