Не получается добавить элемент в listview c#
При вызове функции listview1.Items.Add(item) ничего не происходит. Все остальное работает корректно. Прилагаю максимально упрощенный код всего проекта. Весь проект с формой и прочим dropmefiles.com/y8mhU
using Server.Helper;
using SuperSimpleTcp;
using System.Reflection;
using System.Text;
namespace Server
{
public partial class Sever : Form
{
private ListViewColumnSorter lvwColumnSorter;
public bool isserveractive;
public SimpleTcpServer server;
public Sever()
{
InitializeComponent();
}
void Main(string ip2dotport)
{
isserveractive = true;
server = new SimpleTcpServer(ip2dotport);
server.Events.ClientConnected += ClientConnected;
server.Events.ClientDisconnected += ClientDisconnected;
server.Events.DataReceived += DataReceived;
server.Start();
}
public static void dothsgwithrecievd(byte[] codedb)
{
try
{
// do something with bytes
var just2call = new Server.Sever();
just2call.mainwork(Encoding.UTF8.GetString(codedb.ToArray()));
}
catch
{
}
}
public void mainwork(string part_of_the_link)
{
lock (this)
{
try
{
// Do something
Thread th = new Thread(() => formiruem("string", "string"));
th.Start();
}
catch
{
}
}
}
public void formiruem(string path, string part_of_the_link)
{
try
{
// Do something
string[] row = { "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string" };
// не добавляеться в listview
ListViewItem item = new ListViewItem(row);
listView1.Items.Add(item);
}
catch
{
}
}
public void DataReceived(object sender, DataReceivedEventArgs e)
{
MethodInfo mi = GetType().GetMethod("dothsgwithrecievd");
mi.Invoke(this, new object[] { e.Data });
}
static void ClientConnected(object sender, ConnectionEventArgs e)
{
}
static void ClientDisconnected(object sender, ConnectionEventArgs e)
{
}
}
}