-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSparseMatrixIndexLegacy.cs
More file actions
71 lines (62 loc) · 2.06 KB
/
SparseMatrixIndexLegacy.cs
File metadata and controls
71 lines (62 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using PLP;
using PatternTools;
namespace PatternLab
{
public partial class SparseMatrixIndexLegacy : UserControl
{
public SparseMatrixIndexLegacy()
{
InitializeComponent();
openFileDialog1.Filter = "Text file (*.txt)|*.txt";
saveFileDialog1.Filter = "PatternLab project file (*.plp)|*.plp";
}
private void buttonBrowseIndex_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
{
textBoxIndex.Text = openFileDialog1.FileName;
}
}
private void buttonBrowseSparseMatrix_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
{
textBoxSparseMatrix.Text = openFileDialog1.FileName;
}
}
private void buttonConvert_Click(object sender, EventArgs e)
{
if (!File.Exists(textBoxIndex.Text))
{
MessageBox.Show("Please specify an index file.");
return;
}
if (!File.Exists(textBoxSparseMatrix.Text))
{
MessageBox.Show("Please specify a sparse matrix file.");
return;
}
if (textBoxProjectDescription.Text.Length == 0)
{
MessageBox.Show("Please enter a simple project description.");
return;
}
if (saveFileDialog1.ShowDialog() != DialogResult.Cancel)
{
PatternLabProject plp = new PatternLabProject(textBoxSparseMatrix.Text, textBoxIndex.Text, textBoxProjectDescription.Text);
plp.Save(saveFileDialog1.FileName);
MessageBox.Show("Project converted.");
}
}
}
}