qol: simplify calls

This commit is contained in:
Gary Sharp
2025-07-20 15:20:22 +10:00
parent 1add4ee0f5
commit 9656c15c4b
61 changed files with 214 additions and 214 deletions
+2 -2
View File
@@ -85,7 +85,7 @@ namespace Disco.Client
string reportJson = JsonConvert.SerializeObject(report);
string reportResponse;
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(ServicePathTemplate);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(ServicePathTemplate);
request.UserAgent = $"Disco-Client/{Assembly.GetExecutingAssembly().GetName().Version.ToString(3)}";
request.ContentType = "application/json";
request.Method = WebRequestMethods.Http.Post;
@@ -105,7 +105,7 @@ namespace Disco.Client
}
}
System.Diagnostics.Debug.WriteLine("Error Report Logged to Server; Response: {0}", reportResponse);
Debug.WriteLine("Error Report Logged to Server; Response: {0}", reportResponse);
}
#endregion
@@ -26,7 +26,7 @@ namespace Disco.Client.Extensions
else
serviceUrl = string.Format(ServicePathUnauthenticatedTemplate, Service.Feature);
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(serviceUrl);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceUrl);
request.UserAgent = $"Disco-Client/{Assembly.GetExecutingAssembly().GetName().Version.ToString(3)}";
request.ContentType = "application/json";
request.Method = WebRequestMethods.Http.Post;
+1 -1
View File
@@ -133,7 +133,7 @@ namespace Disco.Client.Extensions
Presentation.UpdateStatus("Enrolling Device", $"Configuring the device owner:\r\n{enrolResponse.AssignedUserDescription} ({enrolResponse.AssignedUserDomain}\\{enrolResponse.AssignedUserUsername})", true, -1, 3000);
if (enrolResponse.AssignedUserIsLocalAdmin)
Interop.LocalAuthentication.AddLocalGroupMembership("Administrators", enrolResponse.AssignedUserSID, enrolResponse.AssignedUserUsername, enrolResponse.AssignedUserDomain);
LocalAuthentication.AddLocalGroupMembership("Administrators", enrolResponse.AssignedUserSID, enrolResponse.AssignedUserUsername, enrolResponse.AssignedUserDomain);
// Make Windows think this user was the last to logon
using (RegistryKey regWinlogon = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", true))
+1 -1
View File
@@ -20,7 +20,7 @@ namespace Disco.Client
}
public static void UpdateStatus(string SubHeading, string Message, bool ShowProgress, int Progress, int TryDelay)
{
Presentation.UpdateStatus(SubHeading, Message, ShowProgress, Progress);
UpdateStatus(SubHeading, Message, ShowProgress, Progress);
if (TryDelay > 0)
Presentation.TryDelay(TryDelay);
}
+4 -4
View File
@@ -35,14 +35,14 @@ namespace Disco.Client
Presentation.WriteBanner();
// WhoAmI Phase
keepProcessing = Program.WhoAmI();
keepProcessing = WhoAmI();
// Enrol Phase
if (keepProcessing)
keepProcessing = Program.Enrol();
keepProcessing = Enrol();
// End conversation with Bootstrapper
Presentation.WriteFooter(Program.RebootRequired, Program.AllowUninstall, !keepProcessing);
Presentation.WriteFooter(RebootRequired, AllowUninstall, !keepProcessing);
}
public static void SetupEnvironment()
@@ -128,7 +128,7 @@ namespace Disco.Client
{
// Send Request
Presentation.UpdateStatus("Enrolling Device", "Sending the enrolment request to the server.", true, -1);
response = request.Post(Program.IsAuthenticated);
response = request.Post(IsAuthenticated);
// Process Response
Presentation.UpdateStatus("Enrolling Device", "Processing the enrolment response from the server.", true, -1);