Асинхронная задача получения данных из интерфейса?C#

Место общения программистов C#
Ответить
Гость
 Асинхронная задача получения данных из интерфейса?

Сообщение Гость »


so I've been working on something for the past few days and currently at the point of implementing the server, but having a little problem finding the correct avenue for getting access to accounts

This is where I need to access Accounts

Inside ServerModule.cs, ran by Main as SM

static async Task ClientAsync(TcpClient client) { // here I need to get to the Accounts some how } I have these on Form1.cs

AccountHolderInterface Accounts = new AccountHolder(); TaskInterface Tasks = new TaskHolder(); ServerInterface Servers = new ServerHolder(); Inside these will have:

Form1.Accounts Form1.Accounts.Sectors Form1.Servers Form1.Servers.Main -> running async task, but needs access to data in Accounts Form1.Servers.Cont -> likewise situation here Form1.Servers.Main has:
IServer.Server.Main.MainModels.ServerModule SM; public string Name { get; set; } public int Port { get; set; } public string Status { get; set; } public Main() { Status = "Stopped"; } public bool Start() { StartMain(Name, Port); Status = "Started"; return true; } private async Task StartMain(string name, int port) { SM = new IServer.Server.Main.MainModels.ServerModule(); await SM.Main(name, port); }

Источник: https://stackoverflow.com/questions/780 ... -interface
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C#»