Skip to content

Commit

Permalink
Refactor method and class names
Browse files Browse the repository at this point in the history
  • Loading branch information
fahminlb33 committed Feb 28, 2021
1 parent e7ffd78 commit e32632b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 31 deletions.
26 changes: 21 additions & 5 deletions src/KFmaintenance/Services/TelemetryService.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using KFlearning.Core.API;
using KFlearning.Core.Services;
using KFmaintenance.Properties;
using System;
using System.Threading.Tasks;

Expand All @@ -26,9 +25,21 @@ public void Load()
try
{
_infoService.Query();
Task.WaitAll(_telemetry.SendAppStart(Resources.AppName, _infoService.DeviceId),
_telemetry.SendIdentification(_infoService.DeviceId, _infoService.CPU, _infoService.RAM,
_infoService.OS, _infoService.Architecture));
Task.WaitAll(
_telemetry.SendTelemetry(new UserEngagementModel
{
DeviceId = _infoService.DeviceId,
AppName = "kfmaintenance",
Event = "app_start" }),
_telemetry.SendIdentification(new DeviceIdentificationModel
{
DeviceId = _infoService.DeviceId,
CPU = _infoService.CPU,
RAM = _infoService.RAM,
OS = _infoService.OS,
Architecture = _infoService.Architecture
})
);
}
catch (Exception)
{
Expand All @@ -41,7 +52,12 @@ public void Save()
try
{
_infoService.Query();
Task.WaitAll(_telemetry.SendAppExit(Resources.AppName, _infoService.DeviceId));
Task.WaitAll(_telemetry.SendTelemetry(new UserEngagementModel
{
DeviceId = _infoService.DeviceId,
AppName = "kfmaintenance",
Event = "app_stop"
}));
}
catch (Exception)
{
Expand Down
14 changes: 2 additions & 12 deletions src/KFmaintenance/Views/AboutForm.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
// SOLUTION : KFlearning
// PROJECT : KFmaintenance
// FILENAME : AboutForm.cs
// AUTHOR : Fahmi Noor Fiqri, Kodesiana.com
// WEBSITE : https://kodesiana.com
// REPO : https://github.com/Kodesiana or https://github.com/fahminlb33
//
// This file is part of KFlearning, see LICENSE.
// See this code in repository URL above!

using KFlearning.Core.Extensions;
using System.Diagnostics;
using System.Windows.Forms;
using KFlearning.Core;

namespace KFmaintenance.Views
{
Expand All @@ -19,7 +9,7 @@ public partial class AboutForm : Form
public AboutForm()
{
InitializeComponent();
lblVersion.Text = Helpers.GetVersionString();
lblVersion.Text = PathHelpers.GetVersionString();
}

private void cmdInstagram_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
Expand Down
14 changes: 2 additions & 12 deletions src/KFmaintenance/Views/AuthForm.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
// SOLUTION : KFlearning
// PROJECT : KFmaintenance
// FILENAME : AuthForm.cs
// AUTHOR : Fahmi Noor Fiqri, Kodesiana.com
// WEBSITE : https://kodesiana.com
// REPO : https://github.com/Kodesiana or https://github.com/fahminlb33
//
// This file is part of KFlearning, see LICENSE.
// See this code in repository URL above!

using KFlearning.Core;
using KFlearning.Core.Extensions;
using KFmaintenance.Properties;
using System.Windows.Forms;

Expand All @@ -23,7 +13,7 @@ public AuthForm()

private void cmdSave_Click(object sender, System.EventArgs e)
{
DialogResult = Helpers.CompareHash(txtCode.Text, Settings.Default.Password)
DialogResult = HashHelpers.CompareHash(txtCode.Text, Settings.Default.Password)
? DialogResult.OK
: DialogResult.Abort;
Close();
Expand Down
4 changes: 2 additions & 2 deletions src/KFmaintenance/Views/FileServerForm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using KFlearning.Core.Services;
using KFlearning.Core.Remoting;
using KFmaintenance.Properties;
using System;
using System.Diagnostics;
Expand All @@ -9,7 +9,7 @@ namespace KFmaintenance.Views
{
public partial class FileServerForm : Form
{
private readonly IKFserverService _server = Program.Container.Resolve<IKFserverService>();
private readonly IKFServer _server = Program.Container.Resolve<IKFServer>();

public FileServerForm()
{
Expand Down

0 comments on commit e32632b

Please sign in to comment.