Exemplo n.º 1
0
 private void New()
 {
     using (var form = new ExportCustomTextFormat("NewÆÆ{number}\r\n{start} --> {end}\r\n{text}\r\n\r\nÆhh:mm:ss,zzzÆ[Do not modify]Æ"))
     {
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             var arr = form.FormatOk.Split('Æ');
             if (arr.Length == 6)
             {
                 string name = arr[0];
                 int    i    = 1;
                 while (NameExists(name))
                 {
                     form.FormatOk = form.FormatOk.Remove(0, name.Length);
                     name          = arr[0] + " (" + i + ")";
                     form.FormatOk = name + form.FormatOk;
                     i++;
                 }
                 _templates.Add(form.FormatOk);
                 ShowTemplates(_templates);
                 listViewTemplates.Items[listViewTemplates.Items.Count - 1].Selected = true;
             }
         }
     }
     SaveTemplates();
 }
Exemplo n.º 2
0
        private void New()
        {
            var form = new ExportCustomTextFormat("NewÆÆ{number}\r\n{start} --> {end}\r\n{text}\r\n\r\nÆhh:mm:ss,zzzÆ[Do not modify]Æ");

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                _templates.Add(form.FormatOK);
                ShowTemplates(_templates);
                listViewTemplates.Items[listViewTemplates.Items.Count - 1].Selected = true;
            }
            SaveTemplates();
        }
Exemplo n.º 3
0
 private void buttonNew_Click(object sender, EventArgs e)
 {
     if (listViewTemplates.SelectedItems.Count == 1)
     {
         var form = new ExportCustomTextFormat("NewÆÆ{number}\r\n{start} --> {end}\r\n{text}\r\n\r\nÆhh:mm:ss,zzzÆ[Do not modify]Æ");
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             _templates.Add(form.FormatOK);
             ShowTemplates(_templates);
             listViewTemplates.Items[listViewTemplates.Items.Count - 1].Selected = true;
         }
     }
     SaveTemplates();
 }
Exemplo n.º 4
0
 private void buttonEdit_Click(object sender, EventArgs e)
 {
     if (listViewTemplates.SelectedItems.Count == 1)
     {
         int idx  = listViewTemplates.SelectedItems[0].Index;
         var form = new ExportCustomTextFormat(_templates[idx]);
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             _templates[idx] = form.FormatOK;
             ShowTemplates(_templates);
             if (idx < listViewTemplates.Items.Count)
             {
                 listViewTemplates.Items[idx].Selected = true;
             }
         }
     }
 }
Exemplo n.º 5
0
 private void Edit()
 {
     if (listViewTemplates.SelectedItems.Count == 1)
     {
         int idx  = listViewTemplates.SelectedItems[0].Index;
         var form = new ExportCustomTextFormat(_templates[idx]);
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             _templates[idx] = form.FormatOk;
             ShowTemplates(_templates);
             if (idx < listViewTemplates.Items.Count)
             {
                 listViewTemplates.Items[idx].Selected = true;
             }
         }
     }
 }
Exemplo n.º 6
0
 private void Edit()
 {
     if (listViewTemplates.SelectedItems.Count == 1)
     {
         int idx = listViewTemplates.SelectedItems[0].Index;
         using (var form = new ExportCustomTextFormat(_templates[idx]))
         {
             if (form.ShowDialog(this) == DialogResult.OK)
             {
                 _templates[idx] = form.FormatOk;
                 SaveTemplates();
                 ShowTemplates(_templates);
                 if (idx < listViewTemplates.Items.Count)
                     listViewTemplates.Items[idx].Selected = true;
             }
         }
     }
 }
Exemplo n.º 7
0
 private void New()
 {
     using (var form = new ExportCustomTextFormat("NewÆÆ{number}\r\n{start} --> {end}\r\n{text}\r\n\r\nÆhh:mm:ss,zzzÆ[Do not modify]Æ"))
     {
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             var arr = form.FormatOk.Split('Æ');
             if (arr.Length == 6)
             {
                 string name = arr[0];
                 int i = 1;
                 while (NameExists(name))
                 {
                     form.FormatOk = form.FormatOk.Remove(0, name.Length);
                     name = arr[0] + " (" + i + ")";
                     form.FormatOk = name +  form.FormatOk;
                     i++;
                 }
                 _templates.Add(form.FormatOk);
                 ShowTemplates(_templates);
                 listViewTemplates.Items[listViewTemplates.Items.Count - 1].Selected = true;
             }
         }
     }
     SaveTemplates();
 }
 private void New()
 {
     using (var form = new ExportCustomTextFormat("NewÆÆ{number}\r\n{start} --> {end}\r\n{text}\r\n\r\nÆhh:mm:ss,zzzÆ[Do not modify]Æ"))
     {
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             _templates.Add(form.FormatOk);
             ShowTemplates(_templates);
             listViewTemplates.Items[listViewTemplates.Items.Count - 1].Selected = true;
         }
     }
     SaveTemplates();
 }
Exemplo n.º 9
0
 private void buttonNew_Click(object sender, EventArgs e)
 {
     if (listViewTemplates.SelectedItems.Count == 1)
     {
         var form = new ExportCustomTextFormat("NewÆÆ{number}\r\n{start} --> {end}\r\n{text}\r\n\r\nÆhh:mm:ss,zzzÆ[Do not modify]Æ");
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             _templates.Add(form.FormatOK);
             ShowTemplates(_templates);
             listViewTemplates.Items[listViewTemplates.Items.Count - 1].Selected = true;
         }
     }
     SaveTemplates();
 }
Exemplo n.º 10
0
 private void buttonEdit_Click(object sender, EventArgs e)
 {
     if (listViewTemplates.SelectedItems.Count == 1)
     {
         int idx = listViewTemplates.SelectedItems[0].Index;
         var form = new ExportCustomTextFormat(_templates[idx]);
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             _templates[idx] = form.FormatOK;
             ShowTemplates(_templates);
             if (idx < listViewTemplates.Items.Count)
                 listViewTemplates.Items[idx].Selected = true;
         }
     }
 }