| Line 121... |
Line 121... |
| 121 |
this.Controls.Add(this.button_cancel);
|
121 |
this.Controls.Add(this.button_cancel);
|
| 122 |
this.Controls.Add(this.button_ok);
|
122 |
this.Controls.Add(this.button_ok);
|
| 123 |
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
123 |
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
| 124 |
this.Name = "ExportToReqProCSVForm";
|
124 |
this.Name = "ExportToReqProCSVForm";
|
| 125 |
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
125 |
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
| - |
|
126 |
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
| 126 |
this.Text = "Export To ReqPro CSV";
|
127 |
this.Text = "Export To ReqPro CSV";
|
| 127 |
this.TopMost = true;
|
128 |
this.TopMost = true;
|
| 128 |
this.ResumeLayout(false);
|
129 |
this.ResumeLayout(false);
|
| 129 |
|
130 |
|
| 130 |
}
|
131 |
}
|
| Line 152... |
Line 153... |
| 152 |
ofd.Filter = "CSV files (*.csv)|*.csv|All files (*.*)|*.*";
|
153 |
ofd.Filter = "CSV files (*.csv)|*.csv|All files (*.*)|*.*";
|
| 153 |
DialogResult dlgRes = ofd.ShowDialog();
|
154 |
DialogResult dlgRes = ofd.ShowDialog();
|
| 154 |
if (dlgRes == DialogResult.OK)
|
155 |
if (dlgRes == DialogResult.OK)
|
| 155 |
{
|
156 |
{
|
| 156 |
Main.EA_Repository.EnsureOutputVisible(Main.GUI_OUTPUT_TAB_NAME);
|
157 |
Main.EA_Repository.EnsureOutputVisible(Main.GUI_OUTPUT_TAB_NAME);
|
| 157 |
Main.EA_Repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Exporting to ReqPro CSV File", -1);
|
158 |
Main.WriteOutput("Exporting to ReqPro CSV File", -1);
|
| 158 |
|
159 |
|
| 159 |
// Begin to build the CSV file content, starting with the header line ReqPro requires.
|
160 |
// Begin to build the CSV file content, starting with the header line ReqPro requires.
|
| 160 |
csv_text = new StringBuilder();
|
161 |
csv_text = new StringBuilder();
|
| 161 |
csv_text.Append( String.Format("\"{0} Tag\",\"Requirement text\",\"Name\"\r\n", textBox_tag.Text));
|
162 |
csv_text.Append( String.Format("\"{0} Tag\",\"Requirement text\",\"Name\"\r\n", textBox_tag.Text));
|
| 162 |
|
163 |
|
| Line 166... |
Line 167... |
| 166 |
// write the CSV file content
|
167 |
// write the CSV file content
|
| 167 |
TextWriter tw = new StreamWriter( ofd.FileName );
|
168 |
TextWriter tw = new StreamWriter( ofd.FileName );
|
| 168 |
tw.WriteLine(csv_text.ToString());
|
169 |
tw.WriteLine(csv_text.ToString());
|
| 169 |
tw.Close();
|
170 |
tw.Close();
|
| 170 |
MessageBoxEx.Show("Export Completed", "Progress");
|
171 |
MessageBoxEx.Show("Export Completed", "Progress");
|
| 171 |
Main.EA_Repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Export Completed", -1);
|
172 |
Main.WriteOutput("Export Completed", -1);
|
| 172 |
}
|
173 |
}
|
| 173 |
}
|
174 |
}
|
| 174 |
}
|
175 |
}
|
| 175 |
catch (Exception exc)
|
176 |
catch (Exception exc)
|
| 176 |
{
|
177 |
{
|
| Line 213... |
Line 214... |
| 213 |
string name = theElement.Name.Substring( pos, theElement.Name.Length-pos );
|
214 |
string name = theElement.Name.Substring( pos, theElement.Name.Length-pos );
|
| 214 |
name = name.Trim();
|
215 |
name = name.Trim();
|
| 215 |
|
216 |
|
| 216 |
csv_text.Append( String.Format( "\"{0}\",\"{1}\",\"{2}\"\r\n", tag, theElement.Notes, name) );
|
217 |
csv_text.Append( String.Format( "\"{0}\",\"{1}\",\"{2}\"\r\n", tag, theElement.Notes, name) );
|
| 217 |
|
218 |
|
| 218 |
Main.EA_Repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Exported : " + theElement.Name, theElement.ElementID );
|
219 |
Main.WriteOutput("Exported : " + theElement.Name, theElement.ElementID );
|
| 219 |
}
|
220 |
}
|
| 220 |
// else if user has asked us to ignore wrong tags...
|
221 |
// else if user has asked us to ignore wrong tags...
|
| 221 |
else if (false == checkBox_IgnoreWronglyTaggedItems.Checked)
|
222 |
else if (false == checkBox_IgnoreWronglyTaggedItems.Checked)
|
| 222 |
{
|
223 |
{
|
| 223 |
csv_text.Append( String.Format( "\"{0}\",\"{1}\",\"{2}\"\r\n", textBox_tag.Text, theElement.Notes, theElement.Name) );
|
224 |
csv_text.Append( String.Format( "\"{0}\",\"{1}\",\"{2}\"\r\n", textBox_tag.Text, theElement.Notes, theElement.Name) );
|
| 224 |
|
225 |
|
| 225 |
Main.EA_Repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Exported : " + theElement.Name, theElement.ElementID );
|
226 |
Main.WriteOutput("Exported : " + theElement.Name, theElement.ElementID );
|
| 226 |
}
|
227 |
}
|
| 227 |
// else ignore this requirement
|
228 |
// else ignore this requirement
|
| 228 |
else
|
229 |
else
|
| 229 |
{
|
230 |
{
|
| 230 |
Main.EA_Repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Ignored : " + theElement.Name, theElement.ElementID );
|
231 |
Main.WriteOutput("Ignored : " + theElement.Name, theElement.ElementID );
|
| 231 |
}
|
232 |
}
|
| 232 |
}
|
233 |
}
|
| 233 |
} while (true == elementSorter.getNext(ref theElement, ref theElementsRelativeLevel));
|
234 |
} while (true == elementSorter.getNext(ref theElement, ref theElementsRelativeLevel));
|
| 234 |
}
|
235 |
}
|
| 235 |
|
236 |
|