Skip to content

Commit

Permalink
Added new function "merge rows"
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirdock committed Jan 15, 2019
1 parent a49ea82 commit b09e735
Show file tree
Hide file tree
Showing 8 changed files with 579 additions and 18 deletions.
50 changes: 50 additions & 0 deletions DataTableConverter/Assisstant/ThreadHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace DataTableConverter.Assisstant
{
class ThreadHelper
{
private List<Thread> Threads = new List<Thread>();
private readonly Action Start, End;
internal bool Abort;
internal static ThreadAction Threadaction;

internal ThreadHelper(Action start, Action end)
{
Start = start;
End = end;
}

internal void StartThread(ThreadAction action)
{
Thread thread = new Thread(() =>
{
try
{
Start();
Thread.CurrentThread.IsBackground = true;

action(ref Abort);
}
catch (Exception ex)
{
ErrorHelper.LogMessage(ex);
}
finally
{
End();
Threads.Remove(Thread.CurrentThread);
}
});
Threads.Add(thread);
thread.Start();
}

internal delegate void ThreadAction(ref bool abort);
}
}
30 changes: 30 additions & 0 deletions DataTableConverter/Classes/DataRowArray.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataTableConverter.Classes
{
class DataRowArray
{
internal List<List<string>> Values;
internal DataRow DataRow;

internal DataRowArray(DataRow dataRow, List<string> values)
{
Values = new List<List<string>>
{
values
};
DataRow = dataRow;
}

internal void Add(List<string> values)
{
Values.Add(values);
}

}
}
11 changes: 11 additions & 0 deletions DataTableConverter/DataTableConverter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@
<Compile Include="Assisstant\ErrorHelper.cs" />
<Compile Include="Assisstant\HistoryHelper.cs" />
<Compile Include="Assisstant\StringComparer.cs" />
<Compile Include="Assisstant\ThreadHelper.cs" />
<Compile Include="Assisstant\UpdateHelper.cs" />
<Compile Include="Assisstant\WorkflowHelper.cs" />
<Compile Include="Classes\CellMatrix.cs" />
<Compile Include="Assisstant\ImportHelper.cs" />
<Compile Include="Classes\DataRowArray.cs" />
<Compile Include="Classes\History.cs" />
<Compile Include="Classes\HistoryStates.cs" />
<Compile Include="Classes\NotFoundHeaders.cs" />
Expand Down Expand Up @@ -147,6 +149,12 @@
<Compile Include="View\Formula.Designer.cs">
<DependentUpon>Formula.cs</DependentUpon>
</Compile>
<Compile Include="View\MergeColumns.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="View\MergeColumns.Designer.cs">
<DependentUpon>MergeColumns.cs</DependentUpon>
</Compile>
<Compile Include="View\MergeTable.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -225,6 +233,9 @@
<EmbeddedResource Include="View\Formula.resx">
<DependentUpon>Formula.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="View\MergeColumns.resx">
<DependentUpon>MergeColumns.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="View\MergeTable.resx">
<DependentUpon>MergeTable.cs</DependentUpon>
</EmbeddedResource>
Expand Down
50 changes: 34 additions & 16 deletions DataTableConverter/View/Form1.Designer.cs

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

Loading

0 comments on commit b09e735

Please sign in to comment.