Skip to content

Commit

Permalink
Added description column
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Nov 4, 2023
1 parent 171752a commit 59fe9ac
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 21 deletions.
28 changes: 20 additions & 8 deletions MiniserverForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 17 additions & 12 deletions MiniserverForm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
Expand Down Expand Up @@ -42,7 +42,8 @@ public string Name
_name = null;
}
if(string.IsNullOrEmpty(_name))
_name = FileName;
//_name = FileName;
_name = "Download to view description";
}
return _name;
}
Expand Down Expand Up @@ -136,7 +137,10 @@ private void RefreshGridView()
MsFileInfo = msMap[f].FirstOrDefault(),
FileInfo = localMap[f].FirstOrDefault(),
}).
OrderBy(f => f).
// Order by descriptio
//OrderBy(f => f).
// Order by filename if available else by name
OrderBy(f => f.MsFileInfo?.FileName ?? f.FileInfo?.Name).
ToList();
_dataGridView.RowCount = _fileItems.Count;
_dataGridView.Refresh();
Expand Down Expand Up @@ -299,12 +303,13 @@ private void DataGridView_CellValueNeeded(object sender, DataGridViewCellValueEv
var fileItem = _fileItems[e.RowIndex];
switch(e.ColumnIndex)
{
case 0: e.Value = fileItem.Name; break;
case 1: e.Value = fileItem.YearMonth; break;
case 2: e.Value = fileItem.Status; break;
case 3: e.Value = "Download"; break;
case 4: e.Value = "Edit"; break;
case 5: e.Value = "Upload"; break;
case 0: e.Value = fileItem.FileName; break;
case 1: e.Value = fileItem.Name; break;
case 2: e.Value = fileItem.YearMonth; break;
case 3: e.Value = fileItem.Status; break;
case 4: e.Value = "Download"; break;
case 5: e.Value = "Edit"; break;
case 6: e.Value = "Upload"; break;
default: e.Value = null; break;
}
}
Expand All @@ -323,16 +328,16 @@ private void DataGridView_CellContentClick(object sender, DataGridViewCellEventA
var fileItem = _fileItems[e.RowIndex];
switch(e.ColumnIndex)
{
case 3: //Download
case 4: //Download
Download(fileItem);
RefreshLocal();
RefreshGridView();
break;
case 4: //Edit
case 5: //Edit
using(var form = new LoxStatFileForm(fileItem.FileInfo.FullName))
form.ShowDialog(this);
break;
case 5: //Upload
case 6: //Upload
Upload(fileItem);
RefreshMs();
RefreshGridView();
Expand Down
5 changes: 4 additions & 1 deletion MiniserverForm.resx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -141,6 +141,9 @@
<metadata name="_nameCol.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="_descriptionCol.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="_yearMonthCol.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
Expand Down

0 comments on commit 59fe9ac

Please sign in to comment.