Commit 3073682f authored by Meelad Vahdat's avatar Meelad Vahdat

Lots of changes in this one:

- General
-- Changed logos and icons to official Listware Desktop logos and icons

- AutoDetectInputs.cs
-- Added phone and email variations

- Output.cs
-- Added a linesWritten counter as well as method numberOfLinesWritten

- MainForm.cs
-- Changed backgroundWorker1_DoWork to utilize multi-threading

- MainForm.Designer.cs
-- Added a location at the top to change number of threads

- GenerateReport.cs
-- Made it so that any result codes not found in the config do not cause an exception and are counted as "XXXX" in the report

- ValidDescriptions.cfg
-- Added "XXXX" to mean "Could not find results"

- AboutForm.Designer.cs
-- Changed pictureBox1 to new logo

- InputPreviewForm.cs
-- Added and call resizeForm() in the constructor to resize the form automatically

- SetConfigurationForm.cs
-- Changed logic to correctly show setConfigurationFormCheckedListBox
-- Added and call resizeForm() in the constructor to resize the form automatically

- SetInputsForm.cs
-- Added and call resizeForm() in the constructor to resize the form automatically

- SetOutputsForm.cs
-- Added and call resizeForm() in the constructor to resize the form automatically
Signed-off-by: Meelad Vahdat's avatarMeelad Vahdat <meelad@melissadata.com>
parent 1a60f250
......@@ -33,6 +33,10 @@ namespace ListwareDesktop.Framework
static string[] recordIDVariations = { "recordid", "recnum", "recno", "recid", "id", "rec" };
static string[] phoneVariations = { "phone", "phonenumber", "fone", "fonenumber", "phonenum", "fonenum" };
static string[] emailVariations = { "email", "emailaddress", "emailaddr", "e-mail" };
//This relates input column names to the variation lists
//Add input columns from services here in all lower case as the key, then the variation list as the value
internal static Dictionary<string, string[]> variationDictionary = new Dictionary<string, string[]>()
......@@ -52,7 +56,9 @@ namespace ListwareDesktop.Framework
{"lastname", lastNameVariations},
{"fullname", fullNameVariations},
{"companyname", companyVariations},
{"recordid", recordIDVariations}
{"recordid", recordIDVariations},
{"emailaddress", emailVariations},
{"phonenumber", phoneVariations}
};
}
}
......@@ -14,10 +14,12 @@ namespace ListwareDesktop.Framework
private string filePath { get; set; }
private string delimiter;
private string qualifier;
private int linesWritten;
//Constructor that sets all the settings for the writer
internal Output(string filePath, string delimiter, string qualifier)
{
this.linesWritten = 0;
this.filePath = filePath;
this.delimiter = delimiter;
this.qualifier = qualifier;
......@@ -36,17 +38,23 @@ namespace ListwareDesktop.Framework
{
if ((qualifier == null) && (tempRecord.fieldAndData[currentHeader].Contains(delimiter)))
{
tempString += "\"" + tempRecord.fieldAndData[currentHeader] + "\"" + delimiter;
tempString += "\"" + tempRecord.fieldAndData[currentHeader].Trim() + "\"" + delimiter;
}
else
{
tempString += qualifier + tempRecord.fieldAndData[currentHeader] + qualifier + delimiter;
tempString += qualifier + tempRecord.fieldAndData[currentHeader].Trim() + qualifier + delimiter;
}
}
streamWriter.WriteLine(tempString);
streamWriter.WriteLine(tempString.TrimEnd(new char[]{delimiter[0]}));
linesWritten++;
}
}
internal int numberOfLinesWritten()
{
return this.linesWritten;
}
//Writes header line
internal void writeHeaders(Record sampleRecord)
{
......@@ -59,7 +67,7 @@ namespace ListwareDesktop.Framework
tempString += qualifier + header + qualifier + delimiter;
}
streamWriter.WriteLine(tempString);
streamWriter.WriteLine(tempString.TrimEnd(new char[]{delimiter[0]}));
}
internal void checkIfEmpty(Record sampleRecord)
......
......@@ -160,11 +160,11 @@
</ItemGroup>
<ItemGroup>
<Content Include="Images\ListwareDesktop.PNG" />
<Content Include="Images\Melissa-favicon-32x32.png" />
<Content Include="Images\Melissa-new-logo-no-tag-200px.png" />
<Content Include="Images\Melissa.ico" />
<Content Include="Images\LWDT.ico" />
<Content Include="Images\LWDT.png" />
<Content Include="Reporting\ReportTemplate.html" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory>https://www.melissa.com/company/support</SupportUrlHistory>
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory>http://wiki.melissadata.com/</ErrorReportUrlHistory>
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>
\ No newline at end of file
......@@ -96,6 +96,9 @@
this.aboutCreditsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.purchaseCreditsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.numberOfThreadsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.numberOfThreadsMenuStripTextBox = new System.Windows.Forms.ToolStripTextBox();
this.pauseButton = new System.Windows.Forms.Button();
this.inputFileGroupBox.SuspendLayout();
this.inputFileQualifierGroupBox.SuspendLayout();
......@@ -184,7 +187,6 @@
this.backgroundWorker1.WorkerReportsProgress = true;
this.backgroundWorker1.WorkerSupportsCancellation = true;
this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork);
this.backgroundWorker1.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker1_ProgressChanged);
this.backgroundWorker1.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted);
//
// inputFileGroupBox
......@@ -778,7 +780,8 @@
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.licenseToolStripMenuItem,
this.creditsToolStripMenuItem,
this.aboutToolStripMenuItem});
this.aboutToolStripMenuItem,
this.optionsToolStripMenuItem});
this.menuStrip.Location = new System.Drawing.Point(0, 0);
this.menuStrip.Name = "menuStrip";
this.menuStrip.Size = new System.Drawing.Size(841, 24);
......@@ -833,6 +836,33 @@
this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
// optionsToolStripMenuItem
//
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.numberOfThreadsToolStripMenuItem});
this.optionsToolStripMenuItem.Font = new System.Drawing.Font("Segoe UI", 8.25F);
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
this.optionsToolStripMenuItem.Text = "Options";
//
// numberOfThreadsToolStripMenuItem
//
this.numberOfThreadsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.numberOfThreadsMenuStripTextBox});
this.numberOfThreadsToolStripMenuItem.Name = "numberOfThreadsToolStripMenuItem";
this.numberOfThreadsToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.numberOfThreadsToolStripMenuItem.Text = "Number of Threads";
this.numberOfThreadsToolStripMenuItem.MouseEnter += new System.EventHandler(this.numberOfThreadsToolStripMenuItem_MouseEnter);
//
// numberOfThreadsMenuStripTextBox
//
this.numberOfThreadsMenuStripTextBox.Font = new System.Drawing.Font("Segoe UI", 8.25F);
this.numberOfThreadsMenuStripTextBox.MaxLength = 2;
this.numberOfThreadsMenuStripTextBox.Name = "numberOfThreadsMenuStripTextBox";
this.numberOfThreadsMenuStripTextBox.Size = new System.Drawing.Size(100, 22);
this.numberOfThreadsMenuStripTextBox.Text = "5";
this.numberOfThreadsMenuStripTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.numberOfThreadsMenuStripTextBox_KeyPress);
//
// pauseButton
//
this.pauseButton.Enabled = false;
......@@ -964,6 +994,9 @@
private System.Windows.Forms.TextBox reportingClientNameTextBox;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
private System.Windows.Forms.Button pauseButton;
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem numberOfThreadsToolStripMenuItem;
private System.Windows.Forms.ToolStripTextBox numberOfThreadsMenuStripTextBox;
}
}
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -59,15 +59,5 @@ namespace ListwareDesktop.Properties {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Melissa_new_logo_no_tag_200px {
get {
object obj = ResourceManager.GetObject("Melissa-new-logo-no-tag-200px", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}
......@@ -118,7 +118,4 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Melissa-new-logo-no-tag-200px" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Images\Melissa-new-logo-no-tag-200px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
\ No newline at end of file
......@@ -162,21 +162,42 @@ namespace ListwareDesktop.Reporting
foreach (int x in rcFields)
{
string mdresults = Fields[x];
string mdresults = "";
try
{
mdresults = Fields[x];
}
catch (IndexOutOfRangeException)
{
mdresults = "XXXX";
}
string[] rowcodes = mdresults.Split(',');
foreach (string rcode in rowcodes)
{
if (!this.openWith.ContainsKey(rcode))
if ((rcode.Length != 4) || ((rcode.Length == 4) && ((!char.IsLetter(rcode[0])) || (!char.IsLetter(rcode[1])) || (!char.IsDigit(rcode[2])) || (!char.IsDigit(rcode[3])))))
{
this.openWith.Add(rcode, 1);
if (!this.openWith.ContainsKey("XXXX"))
{
this.openWith.Add("XXXX", 1);
}
else
{
this.openWith["XXXX"] = openWith["XXXX"] + 1;
}
}
else
{
this.openWith[rcode] = openWith[rcode] + 1;
if (!this.openWith.ContainsKey(rcode))
{
this.openWith.Add(rcode, 1);
}
else
{
this.openWith[rcode] = openWith[rcode] + 1;
}
}
}
}
TTotal++;
......
......@@ -334,3 +334,4 @@ FS08 MEK Match
FE01 No Match
FE02 Minimum Input Not Met
FE03 Multiple Matches
XXXX Could not find results in row. Please check input delimiters and qualifiers.
\ No newline at end of file
......@@ -43,7 +43,7 @@
// companyLabel
//
this.companyLabel.AutoSize = true;
this.companyLabel.Location = new System.Drawing.Point(12, 116);
this.companyLabel.Location = new System.Drawing.Point(12, 101);
this.companyLabel.Name = "companyLabel";
this.companyLabel.Size = new System.Drawing.Size(176, 39);
this.companyLabel.TabIndex = 0;
......@@ -53,7 +53,7 @@
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(12, 184);
this.label5.Location = new System.Drawing.Point(12, 169);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(246, 39);
this.label5.TabIndex = 4;
......@@ -63,7 +63,7 @@
// techSupportEmailLinkLabel
//
this.techSupportEmailLinkLabel.AutoSize = true;
this.techSupportEmailLinkLabel.Location = new System.Drawing.Point(53, 210);
this.techSupportEmailLinkLabel.Location = new System.Drawing.Point(53, 195);
this.techSupportEmailLinkLabel.Name = "techSupportEmailLinkLabel";
this.techSupportEmailLinkLabel.Size = new System.Drawing.Size(117, 13);
this.techSupportEmailLinkLabel.TabIndex = 5;
......@@ -74,7 +74,7 @@
// wikiLabel
//
this.wikiLabel.AutoSize = true;
this.wikiLabel.Location = new System.Drawing.Point(12, 162);
this.wikiLabel.Location = new System.Drawing.Point(12, 147);
this.wikiLabel.Name = "wikiLabel";
this.wikiLabel.Size = new System.Drawing.Size(205, 13);
this.wikiLabel.TabIndex = 6;
......@@ -94,7 +94,7 @@
// websiteLinkLabel
//
this.websiteLinkLabel.AutoSize = true;
this.websiteLinkLabel.Location = new System.Drawing.Point(12, 103);
this.websiteLinkLabel.Location = new System.Drawing.Point(12, 88);
this.websiteLinkLabel.Name = "websiteLinkLabel";
this.websiteLinkLabel.Size = new System.Drawing.Size(91, 13);
this.websiteLinkLabel.TabIndex = 8;
......@@ -104,7 +104,9 @@
//
// pictureBox1
//
this.pictureBox1.Image = global::ListwareDesktop.Properties.Resources.Melissa_new_logo_no_tag_200px;
this.pictureBox1.ErrorImage = null;
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.InitialImage = null;
this.pictureBox1.Location = new System.Drawing.Point(26, 2);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(213, 70);
......@@ -114,7 +116,7 @@
// versionLabel
//
this.versionLabel.AutoSize = true;
this.versionLabel.Location = new System.Drawing.Point(12, 90);
this.versionLabel.Location = new System.Drawing.Point(12, 75);
this.versionLabel.Name = "versionLabel";
this.versionLabel.Size = new System.Drawing.Size(127, 13);
this.versionLabel.TabIndex = 10;
......@@ -124,7 +126,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(261, 228);
this.ClientSize = new System.Drawing.Size(261, 216);
this.Controls.Add(this.versionLabel);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.websiteLinkLabel);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -37,11 +37,15 @@
//
this.previewDataGridView.AllowUserToAddRows = false;
this.previewDataGridView.AllowUserToDeleteRows = false;
this.previewDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
this.previewDataGridView.AllowUserToResizeRows = false;
this.previewDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.previewDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.previewDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
this.previewDataGridView.Location = new System.Drawing.Point(0, 0);
this.previewDataGridView.Name = "previewDataGridView";
this.previewDataGridView.ReadOnly = true;
this.previewDataGridView.RowHeadersVisible = false;
this.previewDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
this.previewDataGridView.Size = new System.Drawing.Size(551, 261);
this.previewDataGridView.TabIndex = 0;
//
......
......@@ -26,10 +26,44 @@ namespace ListwareDesktop.Windows
InitializeComponent();
this.fillDGV();
this.resizeForm();
ClientSize = new Size(previewDataGridView.Width,previewDataGridView.Height);
}
private void resizeForm()
{
int originalHeight = this.previewDataGridView.Height;
int originalWidth = this.previewDataGridView.Width;
int sumHeight = this.previewDataGridView.ColumnHeadersHeight;
int sumWidth = 0;
foreach (DataGridViewRow row in this.previewDataGridView.Rows)
{
sumHeight += row.Height;
}
foreach (DataGridViewColumn column in this.previewDataGridView.Columns)
{
sumWidth += column.Width;
}
int heightDiff = originalHeight - sumHeight;
int widthDiff = originalWidth - sumWidth;
if (heightDiff > 0)
{
this.previewDataGridView.Height = sumHeight + 1;
this.Height = this.Height - heightDiff;
}
if (widthDiff > 0)
{
this.previewDataGridView.Width = sumWidth + 1;
this.Width = this.Width - widthDiff;
}
}
private void fillDGV()
{
Input inputPreview = new Input(inputFilePath, delimiter, qualifier);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -42,15 +42,15 @@
//
this.setConfigurationFormDataGridView.AllowUserToAddRows = false;
this.setConfigurationFormDataGridView.AllowUserToDeleteRows = false;
this.setConfigurationFormDataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.setConfigurationFormDataGridView.AllowUserToResizeRows = false;
this.setConfigurationFormDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
this.setConfigurationFormDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.setConfigurationFormDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.setConfigurationFormDGVOptionName,
this.setConfigurationFormDGVOptionValues});
this.setConfigurationFormDataGridView.Dock = System.Windows.Forms.DockStyle.Top;
this.setConfigurationFormDataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.setConfigurationFormDataGridView.Location = new System.Drawing.Point(0, -2);
this.setConfigurationFormDataGridView.Location = new System.Drawing.Point(0, 0);
this.setConfigurationFormDataGridView.Name = "setConfigurationFormDataGridView";
this.setConfigurationFormDataGridView.RowHeadersVisible = false;
this.setConfigurationFormDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
......@@ -104,7 +104,6 @@
this.setConfigurationFormCheckedListBox.Size = new System.Drawing.Size(120, 94);
this.setConfigurationFormCheckedListBox.TabIndex = 3;
this.setConfigurationFormCheckedListBox.Visible = false;
this.setConfigurationFormCheckedListBox.Leave += new System.EventHandler(this.setConfigurationFormCheckedListBox_Leave);
//
// SetConfigurationForm
//
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -30,9 +30,9 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetInputsForm));
this.setInputsFormDataGridView = new System.Windows.Forms.DataGridView();
this.Inputs = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.setInputsFormSaveButton = new System.Windows.Forms.Button();
this.setInputsFormCancelButton = new System.Windows.Forms.Button();
this.Inputs = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.setInputsFormDataGridView)).BeginInit();
this.SuspendLayout();
//
......@@ -40,8 +40,8 @@
//
this.setInputsFormDataGridView.AllowUserToAddRows = false;
this.setInputsFormDataGridView.AllowUserToDeleteRows = false;
this.setInputsFormDataGridView.AllowUserToResizeRows = false;
this.setInputsFormDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.setInputsFormDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.setInputsFormDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.setInputsFormDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Inputs});
......@@ -49,15 +49,11 @@
this.setInputsFormDataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.setInputsFormDataGridView.Location = new System.Drawing.Point(0, 0);
this.setInputsFormDataGridView.Name = "setInputsFormDataGridView";
this.setInputsFormDataGridView.RowHeadersVisible = false;
this.setInputsFormDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
this.setInputsFormDataGridView.Size = new System.Drawing.Size(284, 436);
this.setInputsFormDataGridView.TabIndex = 0;
//
// Inputs
//
this.Inputs.HeaderText = "Inputs";
this.Inputs.Name = "Inputs";
this.Inputs.ReadOnly = true;
//
// setInputsFormSaveButton
//
this.setInputsFormSaveButton.Location = new System.Drawing.Point(36, 442);
......@@ -78,15 +74,24 @@
this.setInputsFormCancelButton.UseVisualStyleBackColor = true;
this.setInputsFormCancelButton.Click += new System.EventHandler(this.setInputsFormCancelButton_Click);
//
// Inputs
//
this.Inputs.HeaderText = "Inputs";
this.Inputs.Name = "Inputs";
this.Inputs.ReadOnly = true;
this.Inputs.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// SetInputsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ClientSize = new System.Drawing.Size(284, 477);
this.Controls.Add(this.setInputsFormCancelButton);
this.Controls.Add(this.setInputsFormSaveButton);
this.Controls.Add(this.setInputsFormDataGridView);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "SetInputsForm";
this.Text = "Set Inputs";
......@@ -98,8 +103,8 @@
#endregion
private System.Windows.Forms.DataGridView setInputsFormDataGridView;
private System.Windows.Forms.DataGridViewTextBoxColumn Inputs;
private System.Windows.Forms.Button setInputsFormSaveButton;
private System.Windows.Forms.Button setInputsFormCancelButton;
private System.Windows.Forms.DataGridViewTextBoxColumn Inputs;
}
}
\ No newline at end of file
......@@ -21,9 +21,9 @@ namespace ListwareDesktop.Windows
private CheckBox inputColumnsSetCheckBox;
//Pass in IWS interface, so that any service that extends the interface can be passed in
internal SetInputsForm(IWS inputService, string inputFilePath, string delimiter, string qualifier, CheckBox inputColumnsSetCheckBox)
internal SetInputsForm(string inputFilePath, string delimiter, string qualifier, CheckBox inputColumnsSetCheckBox)
{
this.inputService = inputService;
this.inputService = Activator.CreateInstance(MainForm.serviceType) as IWS;
this.inputFilePath = inputFilePath;
this.delimiter = delimiter;
this.qualifier = qualifier;
......@@ -33,9 +33,28 @@ namespace ListwareDesktop.Windows
InitializeComponent();
this.fillDGV();
this.resizeForm();
this.setDefaultValuesForInputs();
}
//Auto size the form to the options
private void resizeForm()
{
int originalHeight = this.setInputsFormDataGridView.Height;
int sum = this.setInputsFormDataGridView.ColumnHeadersHeight;
foreach (DataGridViewRow row in this.setInputsFormDataGridView.Rows)
{
sum += row.Height;
}
this.setInputsFormDataGridView.Height = sum + 1;
int heightDiff = originalHeight - sum;
this.Height = this.Height - heightDiff;
this.setInputsFormSaveButton.Location = new Point(this.setInputsFormSaveButton.Location.X, this.setInputsFormSaveButton.Location.Y - heightDiff);
this.setInputsFormCancelButton.Location = new Point(this.setInputsFormCancelButton.Location.X, this.setInputsFormCancelButton.Location.Y - heightDiff);
}
//Datagridviewer filled with service inputs and columns from input file
private void fillDGV()
{
......@@ -143,7 +162,7 @@ namespace ListwareDesktop.Windows
}
}
}
MainForm.inputAliases = inputAliases;
MainForm.inputAliases = new Dictionary<string,string>(inputAliases);
inputColumnsSetCheckBox.Checked = true;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -31,9 +31,9 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetOutputsForm));
this.setOutputsFormDataGridView = new System.Windows.Forms.DataGridView();
this.FieldName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Select = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.SelectColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.setOutputsFormSaveButton = new System.Windows.Forms.Button();
this.saveOutputsFormCancelButton = new System.Windows.Forms.Button();
this.setOutputsFormCancelButton = new System.Windows.Forms.Button();
this.setOutputsFormSelectAllButton = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.setOutputsFormDataGridView)).BeginInit();
this.SuspendLayout();
......@@ -42,18 +42,19 @@
//
this.setOutputsFormDataGridView.AllowUserToAddRows = false;
this.setOutputsFormDataGridView.AllowUserToDeleteRows = false;
this.setOutputsFormDataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.setOutputsFormDataGridView.AllowUserToResizeRows = false;
this.setOutputsFormDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.setOutputsFormDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.setOutputsFormDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.FieldName,
this.Select});
this.SelectColumn});
this.setOutputsFormDataGridView.Dock = System.Windows.Forms.DockStyle.Top;
this.setOutputsFormDataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.setOutputsFormDataGridView.Location = new System.Drawing.Point(1, 1);
this.setOutputsFormDataGridView.Location = new System.Drawing.Point(0, 0);
this.setOutputsFormDataGridView.Name = "setOutputsFormDataGridView";
this.setOutputsFormDataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.setOutputsFormDataGridView.Size = new System.Drawing.Size(395, 448);
this.setOutputsFormDataGridView.RowHeadersVisible = false;
this.setOutputsFormDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
this.setOutputsFormDataGridView.Size = new System.Drawing.Size(398, 448);
this.setOutputsFormDataGridView.TabIndex = 0;
//
// FieldName
......@@ -62,12 +63,12 @@
this.FieldName.Name = "FieldName";
this.FieldName.ReadOnly = true;
//
// Select
// SelectColumn
//
this.Select.FalseValue = "false";
this.Select.HeaderText = "Select";
this.Select.Name = "Select";
this.Select.TrueValue = "true";
this.SelectColumn.FalseValue = "false";
this.SelectColumn.HeaderText = "Select";
this.SelectColumn.Name = "SelectColumn";
this.SelectColumn.TrueValue = "true";
//
// setOutputsFormSaveButton
//
......@@ -79,15 +80,15 @@
this.setOutputsFormSaveButton.UseVisualStyleBackColor = true;
this.setOutputsFormSaveButton.Click += new System.EventHandler(this.setOutputsFormSaveButton_Click);
//
// saveOutputsFormCancelButton
// setOutputsFormCancelButton
//
this.saveOutputsFormCancelButton.Location = new System.Drawing.Point(263, 455);
this.saveOutputsFormCancelButton.Name = "saveOutputsFormCancelButton";
this.saveOutputsFormCancelButton.Size = new System.Drawing.Size(75, 23);
this.saveOutputsFormCancelButton.TabIndex = 2;
this.saveOutputsFormCancelButton.Text = "Cancel";
this.saveOutputsFormCancelButton.UseVisualStyleBackColor = true;
this.saveOutputsFormCancelButton.Click += new System.EventHandler(this.saveOutputsFormCancelButton_Click);
this.setOutputsFormCancelButton.Location = new System.Drawing.Point(263, 455);
this.setOutputsFormCancelButton.Name = "setOutputsFormCancelButton";
this.setOutputsFormCancelButton.Size = new System.Drawing.Size(75, 23);
this.setOutputsFormCancelButton.TabIndex = 2;
this.setOutputsFormCancelButton.Text = "Cancel";
this.setOutputsFormCancelButton.UseVisualStyleBackColor = true;
this.setOutputsFormCancelButton.Click += new System.EventHandler(this.setOutputsFormCancelButton_Click);
//
// setOutputsFormSelectAllButton
//
......@@ -103,11 +104,13 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ClientSize = new System.Drawing.Size(398, 490);
this.Controls.Add(this.setOutputsFormSelectAllButton);
this.Controls.Add(this.saveOutputsFormCancelButton);
this.Controls.Add(this.setOutputsFormCancelButton);
this.Controls.Add(this.setOutputsFormSaveButton);
this.Controls.Add(this.setOutputsFormDataGridView);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "SetOutputsForm";
this.Text = "Set Outputs";
......@@ -120,9 +123,9 @@
private System.Windows.Forms.DataGridView setOutputsFormDataGridView;
private System.Windows.Forms.Button setOutputsFormSaveButton;
private System.Windows.Forms.Button saveOutputsFormCancelButton;
private System.Windows.Forms.Button setOutputsFormCancelButton;
private System.Windows.Forms.Button setOutputsFormSelectAllButton;
private System.Windows.Forms.DataGridViewTextBoxColumn FieldName;
private System.Windows.Forms.DataGridViewCheckBoxColumn Select;
private System.Windows.Forms.DataGridViewCheckBoxColumn SelectColumn;
}
}
\ No newline at end of file
......@@ -14,29 +14,41 @@ namespace ListwareDesktop.Windows