Skip to content

Commit

Permalink
Update System.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Sep 21, 2023
1 parent 6373847 commit 7c283ca
Showing 1 changed file with 87 additions and 26 deletions.
113 changes: 87 additions & 26 deletions src/Shared/Engine/Sucrose.Shared.Engine/Helper/System.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,64 +16,125 @@ public static async void GetSystem()
{
try
{
if (SSEMI.Client == null)
{
SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port);
SSEMI.Client = new(SGSGSS.ChannelInstance);
}
SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port);
SSEMI.Client = new(SGSGSS.ChannelInstance);
}
catch { }

_ = Task.Run(() =>
_ = Task.Run(() =>
{
try
{
BackgroundogCpuResponse Response = SGCSBCS.GetCpu(SSEMI.Client);
SSEMI.CpuData = Response.Info;
});
}
catch
{
SSEMI.CpuData = string.Empty;
}
});

_ = Task.Run(() =>
_ = Task.Run(() =>
{
try
{
BackgroundogBiosResponse Response = SGCSBCS.GetBios(SSEMI.Client);
SSEMI.BiosData = Response.Info;
});
}
catch
{
SSEMI.BiosData = string.Empty;
}
});

_ = Task.Run(() =>
_ = Task.Run(() =>
{
try
{
BackgroundogDateResponse Response = SGCSBCS.GetDate(SSEMI.Client);
SSEMI.DateData = Response.Info;
});
}
catch
{
SSEMI.DateData = string.Empty;
}
});

_ = Task.Run(() =>
_ = Task.Run(() =>
{
try
{
BackgroundogAudioResponse Response = SGCSBCS.GetAudio(SSEMI.Client);
SSEMI.AudioData = Response.Info;
});
}
catch
{
SSEMI.AudioData = string.Empty;
}
});

_ = Task.Run(() =>
_ = Task.Run(() =>
{
try
{
BackgroundogMemoryResponse Response = SGCSBCS.GetMemory(SSEMI.Client);
SSEMI.MemoryData = Response.Info;
});
}
catch
{
SSEMI.MemoryData = string.Empty;
}
});

_ = Task.Run(() =>
_ = Task.Run(() =>
{
try
{
BackgroundogBatteryResponse Response = SGCSBCS.GetBattery(SSEMI.Client);
SSEMI.BatteryData = Response.Info;
});
}
catch
{
SSEMI.BatteryData = string.Empty;
}
});

_ = Task.Run(() =>
_ = Task.Run(() =>
{
try
{
BackgroundogNetworkResponse Response = SGCSBCS.GetNetwork(SSEMI.Client);
SSEMI.NetworkData = Response.Info;
});
}
catch
{
SSEMI.NetworkData = string.Empty;
}
});

_ = Task.Run(() =>
_ = Task.Run(() =>
{
try
{
BackgroundogMotherboardResponse Response = SGCSBCS.GetMotherboard(SSEMI.Client);
SSEMI.MotherboardData = Response.Info;
});
}
catch
{
//
}
}
catch
{
SSEMI.MotherboardData = string.Empty;
}
});
}
else
{
SSEMI.CpuData = string.Empty;
SSEMI.BiosData = string.Empty;
SSEMI.DateData = string.Empty;
SSEMI.AudioData = string.Empty;
SSEMI.MemoryData = string.Empty;
SSEMI.BatteryData = string.Empty;
SSEMI.NetworkData = string.Empty;
SSEMI.MotherboardData = string.Empty;
}

await Task.CompletedTask;
Expand Down

0 comments on commit 7c283ca

Please sign in to comment.