-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
742c783
commit 61fc5d9
Showing
47 changed files
with
7,020 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Application x:Class="OVR_Dash_Manager.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
StartupUri="MainWindow.xaml"> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Windows; | ||
|
||
namespace OVR_Dash_Manager | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Windows; | ||
|
||
[assembly: ThemeInfo( | ||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located | ||
//(used if a resource is not found in the page, | ||
// or application resource dictionaries) | ||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located | ||
//(used if a resource is not found in the page, | ||
// app, or any theme specific resource dictionaries) | ||
)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,307 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.ServiceProcess; | ||
using System.Threading; | ||
|
||
namespace OVR_Dash_Manager.Dashes | ||
{ | ||
public static class Dash_Manager | ||
{ | ||
private static OVR_Dash Oculus_Dash; | ||
private static OVR_Dash SteamVR_Dash; | ||
private static MainWindow MainForm; | ||
|
||
public static void PassMainForm(MainWindow Form) | ||
{ | ||
MainForm = Form; | ||
} | ||
|
||
public static void MainForm_FixTaskViewIssue() | ||
{ | ||
if (MainForm != null) | ||
Functions_Old.DoAction(MainForm, new Action(delegate () { MainForm.Cancel_TaskView_And_Focus(); })); | ||
} | ||
|
||
public static void MainForm_CheckRunTime() | ||
{ | ||
if (MainForm != null) | ||
Functions_Old.DoAction(MainForm, new Action(delegate () { MainForm.CheckRunTime(); })); | ||
} | ||
|
||
public static bool EmulateReleaseMode() | ||
{ | ||
if (MainForm != null) | ||
return MainForm.Debug_EmulateReleaseMode; | ||
else | ||
return false; | ||
} | ||
|
||
public static void GenerateDashes() | ||
{ | ||
Software.Oculus.Check_Current_Dash(); | ||
|
||
Oculus_Dash = new OVR_Dash("Offical Oculus Dash", "OculusDash_Normal.exe", ProcessToStop: "vrmonitor"); | ||
SteamVR_Dash = new OVR_Dash("ItsKaitlyn03 - Oculus Killer", "ItsKaitlyn03_Oculus_Killer.exe", "Oculus Killer", "ItsKaitlyn03", "OculusKiller", "OculusDash.exe"); | ||
|
||
Software.Oculus.Setup(); | ||
Software.Oculus.Check_Oculus_Is_Installed(); | ||
|
||
CheckInstalled(); | ||
} | ||
|
||
private static void CheckInstalled() | ||
{ | ||
Oculus_Dash.CheckInstalled(); | ||
SteamVR_Dash.CheckInstalled(); | ||
|
||
if (!SteamVR_Dash.Installed) | ||
SteamVR_Dash.Download(); | ||
|
||
Software.Oculus.Check_Current_Dash(); | ||
|
||
if (!Oculus_Dash.Installed) | ||
{ | ||
if (Software.Oculus.Normal_Dash) | ||
{ | ||
// Copy Default Oculus Dash if not already done | ||
File.Copy(Software.Oculus.Oculus_Dash_File, Path.Combine(Software.Oculus.Oculus_Dash_Directory, Oculus_Dash.DashFileName), true); | ||
Oculus_Dash.CheckInstalled(); | ||
} | ||
} | ||
else | ||
{ | ||
// Check if Oculus Updated and check is Oculus Dash has changed by "Length" | ||
if (Software.Oculus.Normal_Dash) | ||
{ | ||
FileInfo CurrentDash = new FileInfo(Path.Combine(Software.Oculus.Oculus_Dash_Directory, Oculus_Dash.DashFileName)); | ||
FileInfo OculusDashFile = new FileInfo(Software.Oculus.Oculus_Dash_File); | ||
|
||
// Update File | ||
if (CurrentDash.Length != OculusDashFile.Length) | ||
File.Copy(Software.Oculus.Oculus_Dash_File, Path.Combine(Software.Oculus.Oculus_Dash_Directory, Oculus_Dash.DashFileName), true); | ||
} | ||
} | ||
} | ||
|
||
public static Boolean IsInstalled(Dash_Type Dash) | ||
{ | ||
switch (Dash) | ||
{ | ||
case Dash_Type.Normal: | ||
return Oculus_Dash.Installed; | ||
|
||
case Dash_Type.OculusKiller: | ||
return SteamVR_Dash.Installed; | ||
|
||
default: | ||
return false; | ||
} | ||
} | ||
|
||
private static bool SetActiveDash(Dash_Type Dash) | ||
{ | ||
Boolean Activated = false; | ||
|
||
switch (Dash) | ||
{ | ||
case Dash_Type.Normal: | ||
Software.Steam.ManagerCalledExit = true; | ||
if (!Properties.Settings.Default.FastSwitch) | ||
Activated = Oculus_Dash.Activate_Dash(); | ||
else | ||
Activated = Oculus_Dash.Activate_Dash_Fast_v2(); | ||
break; | ||
|
||
case Dash_Type.OculusKiller: | ||
if (!Properties.Settings.Default.FastSwitch) | ||
Activated = SteamVR_Dash.Activate_Dash(); | ||
else | ||
Activated = SteamVR_Dash.Activate_Dash_Fast_v2(); | ||
break; | ||
|
||
default: | ||
break; | ||
} | ||
|
||
return Activated; | ||
} | ||
|
||
public static Dash_Type CheckWhosDash(String File_ProductName) | ||
{ | ||
if (SteamVR_Dash.IsThisYourDash(File_ProductName)) | ||
return Dash_Type.OculusKiller; | ||
|
||
if (String.IsNullOrEmpty(File_ProductName)) | ||
return Dash_Type.Normal; | ||
|
||
return Dash_Type.Unknown; | ||
} | ||
|
||
public static String GetDashName(Dash_Type Dash) | ||
{ | ||
switch (Dash) | ||
{ | ||
case Dash_Type.Unknown: | ||
return "Unknown"; | ||
|
||
case Dash_Type.Normal: | ||
return Oculus_Dash.DisplayName; | ||
|
||
case Dash_Type.OculusKiller: | ||
return SteamVR_Dash.DisplayName; | ||
|
||
default: | ||
return "No Name Found"; | ||
} | ||
} | ||
|
||
public static Boolean Activate_FastTransition(Dash_Type Dash) | ||
{ | ||
Boolean Activated = false; | ||
|
||
if (Dash != Dash_Type.Exit) | ||
{ | ||
Debug.WriteLine("Starting Fast Activation: " + Dash.ToString()); | ||
|
||
for (int i = 0; i < 10; i++) | ||
{ | ||
if (AttemptFastSwitch(Dash)) | ||
break; | ||
} | ||
} | ||
else | ||
{ | ||
ServiceController Service = new ServiceController("OVRService"); | ||
Boolean OVRServiceRunning = Running(Service.Status); | ||
|
||
try | ||
{ | ||
Debug.WriteLine("Stopping OVRService"); | ||
|
||
Service.Stop(); | ||
if (OVRServiceRunning) | ||
Service.Start(); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Debug.WriteLine(ex.Message); | ||
} | ||
} | ||
return Activated; | ||
} | ||
|
||
private static Boolean AttemptFastSwitch(Dash_Type Dash) | ||
{ | ||
Boolean Activated = false; | ||
|
||
Activated = SetActiveDash(Dash); | ||
|
||
return Activated; | ||
} | ||
|
||
public static Boolean Activate(Dash_Type Dash) | ||
{ | ||
Debug.WriteLine("Starting Activation: " + Dash.ToString()); | ||
|
||
Boolean Activated = false; | ||
|
||
Boolean OVRServiceRunning = (Service_Manager.GetState("OVRService") == "Running"); | ||
Boolean OVRService_WasRunning = false; | ||
Boolean CanAccess = true; | ||
|
||
if (OVRServiceRunning) | ||
{ | ||
OVRService_WasRunning = true; | ||
try | ||
{ | ||
Debug.WriteLine("Stopping OVRService"); | ||
Software.Steam.ManagerCalledExit = true; | ||
Service_Manager.StopService("OVRService"); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Debug.WriteLine(ex.Message); | ||
CanAccess = false; | ||
} | ||
} | ||
|
||
if (CanAccess) | ||
{ | ||
Debug.WriteLine("Checking OVRService"); | ||
|
||
OVRServiceRunning = (Service_Manager.GetState("OVRService") == "Running"); | ||
|
||
if (!OVRServiceRunning) | ||
{ | ||
Debug.WriteLine("Activating Dash"); | ||
Activated = SetActiveDash(Dash); | ||
} | ||
else | ||
Debug.WriteLine("!!!!!! OVRService Can Not Be Stopped"); | ||
|
||
if (OVRService_WasRunning) | ||
{ | ||
Debug.WriteLine("Restarting OVRService"); | ||
Service_Manager.StartService("OVRService"); | ||
} | ||
} | ||
else | ||
Debug.WriteLine("!!!!!! OVRService Can Not Be Accessed"); | ||
|
||
return Activated; | ||
} | ||
|
||
private static Boolean Running(ServiceControllerStatus Status) | ||
{ | ||
switch (Status) | ||
{ | ||
case ServiceControllerStatus.Running: | ||
return true; | ||
|
||
case ServiceControllerStatus.Stopped: | ||
return false; | ||
|
||
case ServiceControllerStatus.Paused: | ||
return true; | ||
|
||
case ServiceControllerStatus.StopPending: | ||
return true; | ||
|
||
case ServiceControllerStatus.StartPending: | ||
return true; | ||
|
||
default: | ||
return false; | ||
} | ||
} | ||
|
||
public static bool Oculus_Offical_Dash_Installed() | ||
{ | ||
return Oculus_Dash.Installed; | ||
} | ||
|
||
public static OVR_Dash GetDash(Dash_Type Dash) | ||
{ | ||
switch (Dash) | ||
{ | ||
case Dash_Type.Exit: | ||
break; | ||
|
||
case Dash_Type.Unknown: | ||
break; | ||
|
||
case Dash_Type.Normal: | ||
return Oculus_Dash; | ||
|
||
case Dash_Type.OculusKiller: | ||
return SteamVR_Dash; | ||
|
||
default: | ||
break; | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,358 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.IO; | ||
|
||
namespace OVR_Dash_Manager.Dashes | ||
{ | ||
public class OVR_Dash | ||
{ | ||
public OVR_Dash(String DisplayName, String DashFileName, String ProductName = "", String RepoName = "", String ProjectName = "", String AssetName = "", String ProcessToStop = "") | ||
{ | ||
this.DisplayName = DisplayName; | ||
this.DashFileName = DashFileName; | ||
this.ProductName = ProductName; | ||
this.RepoName = RepoName; | ||
this.ProjectName = ProjectName; | ||
this.AssetName = AssetName; | ||
this.ProcessToStop = ProcessToStop; | ||
} | ||
|
||
public readonly String DisplayName = "Dash"; | ||
|
||
public String DashFileName = "Dash.exe"; | ||
public String ProductName = ""; | ||
|
||
public String RepoName = ""; | ||
public String ProjectName = ""; | ||
public String AssetName = ""; | ||
public String ProcessToStop = ""; | ||
|
||
private long _Size = -1; | ||
|
||
private bool _DashActive; | ||
|
||
public bool DashActive | ||
{ | ||
get { return _DashActive; } | ||
private set { _DashActive = value; } | ||
} | ||
|
||
private bool _NeedUpdate; | ||
|
||
public bool NeedUpdate | ||
{ | ||
get { return _NeedUpdate; } | ||
private set { _NeedUpdate = value; } | ||
} | ||
|
||
private bool _Installed; | ||
|
||
public bool Installed | ||
{ | ||
get { return _Installed; } | ||
private set { _Installed = value; } | ||
} | ||
|
||
private string _CurrentVersion; | ||
|
||
public string CurrentVersion | ||
{ | ||
get { return _CurrentVersion; } | ||
private set { _CurrentVersion = value; } | ||
} | ||
|
||
private string _AvaliableVersion; | ||
|
||
public string AvaliableVersion | ||
{ | ||
get { return _AvaliableVersion; } | ||
private set { _AvaliableVersion = value; } | ||
} | ||
|
||
public bool IsThisYourDash(String Dash_ProductName) | ||
{ | ||
return Dash_ProductName == ProductName; | ||
} | ||
|
||
public void CheckInstalled() | ||
{ | ||
if (Directory.Exists(Software.Oculus.Oculus_Dash_Directory)) | ||
{ | ||
String DashPath = Path.Combine(Software.Oculus.Oculus_Dash_Directory, DashFileName); | ||
|
||
if (File.Exists(DashPath)) | ||
_Installed = true; | ||
} | ||
} | ||
|
||
public void CheckUpdate() | ||
{ | ||
if (_Installed) | ||
{ | ||
if (!String.IsNullOrEmpty(RepoName) && !String.IsNullOrEmpty(ProjectName) && !String.IsNullOrEmpty(AssetName)) | ||
{ | ||
String DashPath = Path.Combine(Software.Oculus.Oculus_Dash_Directory, DashFileName); | ||
FileInfo CurrentDash = new FileInfo(DashPath); | ||
_Size = CurrentDash.Length; | ||
|
||
Github Repo = new Github(); | ||
|
||
long LatestSize = Repo.GetLatestSize(RepoName, ProjectName, AssetName); | ||
if (LatestSize != _Size) | ||
_NeedUpdate = true; | ||
} | ||
} | ||
} | ||
|
||
public void Download() | ||
{ | ||
String Temp_DashPath = Path.Combine(Software.Oculus.Oculus_Dash_Directory, DashFileName + ".tmp"); | ||
String DashPath = Path.Combine(Software.Oculus.Oculus_Dash_Directory, DashFileName); | ||
Boolean Active_NeedUpdateTo = false; | ||
Boolean ShouldUpdate = true; | ||
|
||
if (_DashActive) | ||
{ | ||
try | ||
{ | ||
// try and remove live version of this dash (we always have our backup incase) | ||
File.Delete(Software.Oculus.Oculus_Dash_File); | ||
Active_NeedUpdateTo = true; | ||
} | ||
catch (Exception) | ||
{ | ||
ShouldUpdate = false; | ||
} | ||
} | ||
|
||
if (ShouldUpdate) | ||
{ | ||
Github Repo = new Github(); | ||
try | ||
{ | ||
Repo.Download(RepoName, ProjectName, AssetName, Temp_DashPath); | ||
} | ||
catch (Exception) | ||
{ | ||
} | ||
|
||
if (File.Exists(Temp_DashPath)) | ||
{ | ||
try | ||
{ | ||
File.Move(Temp_DashPath, DashPath); | ||
_Installed = true; | ||
|
||
if (Active_NeedUpdateTo) | ||
File.Copy(DashPath, Software.Oculus.Oculus_Dash_File, true); | ||
} | ||
catch (Exception ex) | ||
{ | ||
// try and update unless its already running, but just checked that .. hmm | ||
Debug.WriteLine(ex.Message); | ||
} | ||
} | ||
} | ||
|
||
if (_DashActive) | ||
{ | ||
if (!File.Exists(Software.Oculus.Oculus_Dash_File)) | ||
File.Copy(DashPath, Software.Oculus.Oculus_Dash_File, true); // Copy backup file back incase something failed above | ||
} | ||
} | ||
|
||
public bool Activate_Dash() | ||
{ | ||
Boolean Activated = false; | ||
|
||
if (Installed) | ||
{ | ||
|
||
try | ||
{ | ||
if (!String.IsNullOrEmpty(ProcessToStop)) | ||
{ | ||
Debug.WriteLine("Attempting to kill: " + ProcessToStop); | ||
CloseProcessBeforeIfRequired(); | ||
} | ||
} | ||
catch (Exception) | ||
{ | ||
Debug.WriteLine("Unable to kill required process: " + ProcessToStop); | ||
throw; | ||
} | ||
|
||
String DashPath = Path.Combine(Software.Oculus.Oculus_Dash_Directory, DashFileName); | ||
|
||
try | ||
{ | ||
Activated = SwitchFiles(DashPath, Software.Oculus.Oculus_Dash_File); | ||
} | ||
catch (Exception ex) | ||
{ | ||
if (ex.Message.Contains("because it is being used by another process")) | ||
Activated = false; | ||
else | ||
throw; | ||
} | ||
} | ||
|
||
return Activated; | ||
} | ||
|
||
public bool Activate_Dash_Fast() | ||
{ | ||
Boolean Activated = false; | ||
|
||
if (Installed) | ||
{ | ||
Process[] Dashes = Process.GetProcessesByName("OculusDash"); | ||
if (Dashes.Length > 0) | ||
{ | ||
Process RunningDash = Dashes[0]; | ||
if (!RunningDash.HasExited) | ||
{ | ||
Debug.WriteLine("Killing: " + RunningDash.Id); | ||
RunningDash.Kill(); | ||
} | ||
} | ||
|
||
String DashPath = Path.Combine(Software.Oculus.Oculus_Dash_Directory, DashFileName); | ||
|
||
try | ||
{ | ||
Activated = SwitchFiles(DashPath, Software.Oculus.Oculus_Dash_File); | ||
} | ||
catch (Exception ex) | ||
{ | ||
if (ex.Message.Contains("because it is being used by another process")) | ||
Activated = false; | ||
else | ||
throw; | ||
} | ||
|
||
try | ||
{ | ||
if (!String.IsNullOrEmpty(ProcessToStop)) | ||
{ | ||
Debug.WriteLine("Attempting to kill: " + ProcessToStop); | ||
CloseProcessBeforeIfRequired(); | ||
} | ||
} | ||
catch (Exception) | ||
{ | ||
Debug.WriteLine("Unable to kill required process: " + ProcessToStop); | ||
throw; | ||
} | ||
} | ||
|
||
return Activated; | ||
} | ||
|
||
public bool Activate_Dash_Fast_v2() | ||
{ | ||
Boolean Activated = false; | ||
|
||
if (Installed) | ||
{ | ||
String DashPath = Path.Combine(Software.Oculus.Oculus_Dash_Directory, DashFileName); | ||
|
||
try | ||
{ | ||
if (File.Exists(Software.Oculus.Oculus_Dash_File)) | ||
{ | ||
Debug.WriteLine("Moving Active Dash"); | ||
|
||
File.Move(Software.Oculus.Oculus_Dash_File, $"{Software.Oculus.Oculus_Dash_File}.delete"); | ||
} | ||
|
||
Debug.WriteLine("Switching in New Dash"); | ||
Activated = SwitchFiles(DashPath, Software.Oculus.Oculus_Dash_File); | ||
} | ||
catch (Exception ex) | ||
{ | ||
if (ex.Message.Contains("because it is being used by another process")) | ||
Activated = false; | ||
else | ||
throw; | ||
} | ||
|
||
Process[] Dashes = Process.GetProcessesByName("OculusDash"); | ||
if (Dashes.Length > 0) | ||
{ | ||
Process RunningDash = Dashes[0]; | ||
if (!RunningDash.HasExited) | ||
{ | ||
Debug.WriteLine("Killing Dash: " + RunningDash.Id); | ||
RunningDash.Kill(); | ||
|
||
if (File.Exists($"{Software.Oculus.Oculus_Dash_File}.delete")) | ||
{ | ||
RunningDash.WaitForExit(); | ||
File.Delete($"{Software.Oculus.Oculus_Dash_File}.delete"); | ||
Debug.WriteLine("Removed Old Dash File"); | ||
} | ||
} | ||
} | ||
|
||
try | ||
{ | ||
if (File.Exists($"{Software.Oculus.Oculus_Dash_File}.delete")) | ||
{ | ||
File.Delete($"{Software.Oculus.Oculus_Dash_File}.delete"); | ||
Debug.WriteLine("Removed Old Dash File"); | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
Debug.WriteLine("Failed removing old file: " + ex.Message); | ||
} | ||
|
||
try | ||
{ | ||
if (!String.IsNullOrEmpty(ProcessToStop)) | ||
{ | ||
Debug.WriteLine("Attempting to kill: " + ProcessToStop); | ||
CloseProcessBeforeIfRequired(); | ||
} | ||
} | ||
catch (Exception) | ||
{ | ||
Debug.WriteLine("Unable to kill required process: " + ProcessToStop); | ||
throw; | ||
} | ||
} | ||
|
||
return Activated; | ||
} | ||
|
||
private bool SwitchFiles(String NewFile, String OldFile) | ||
{ | ||
bool Activated = false; | ||
|
||
String DashPath = Path.Combine(Software.Oculus.Oculus_Dash_Directory, DashFileName); | ||
if (File.Exists(NewFile)) | ||
{ | ||
File.Copy(NewFile, OldFile, true); | ||
|
||
FileInfo Source = new FileInfo(NewFile); | ||
FileInfo Target = new FileInfo(OldFile); | ||
|
||
if (Source.Length == Target.Length) | ||
Activated = true; | ||
} | ||
|
||
return Activated; | ||
} | ||
|
||
private void CloseProcessBeforeIfRequired() | ||
{ | ||
if (!String.IsNullOrEmpty(ProcessToStop)) | ||
{ | ||
Process[] SteamVR = Process.GetProcessesByName(ProcessToStop); | ||
foreach (Process VR in SteamVR) | ||
VR.CloseMainWindow(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace OVR_Dash_Manager.Dashes | ||
{ | ||
public enum Dash_Type | ||
{ | ||
Exit = -1, | ||
Unknown = 0, | ||
Normal = 1, | ||
OculusKiller = 2 | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
Oculus VR Dash Manager - Copy/Forms/Settings/frm_Settings_v2.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<Window x:Class="OVR_Dash_Manager.Forms.Settings.frm_Settings_v2" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:OVR_Dash_Manager.Forms.Settings" | ||
mc:Ignorable="d" | ||
Title="Settings" Width="863" Height="547" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen"> | ||
|
||
<Window.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="../../Theme/MetroDark.MSControls.Core.Implicit.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Window.Resources> | ||
|
||
<Grid x:Name="gd_Settings" Background="#FF212121"> | ||
<GroupBox Header="Dash Manager Settings" Margin="10,10,10,0" Height="136" VerticalAlignment="Top"> | ||
<Grid Margin="0"> | ||
<local:uc_Setting Setting="AlwaysOnTop" Margin="10,3,0,0" HorizontalAlignment="Left" Width="150" Height="30" VerticalAlignment="Top" /> | ||
<Label Content="Keep Dash Manager On Top" Margin="166,3,10,0" VerticalAlignment="Top" Height="30" /> | ||
<local:uc_Setting Setting="FastSwitch" Margin="10,41,0,0" HorizontalAlignment="Left" Width="150" Height="30" VerticalAlignment="Top" /> | ||
<Label Content="Switch Dashes with out Stopping Link (Cable & Air Link Supported)" HorizontalAlignment="Left" Margin="166,41,0,0" VerticalAlignment="Top" Height="30" /> | ||
</Grid> | ||
</GroupBox> | ||
<GroupBox Header="Oculus Settings" Margin="10,151,10,0" Height="210" VerticalAlignment="Top"> | ||
<Grid Margin="0"> | ||
<local:uc_Setting Setting="RunOculusClientOnStartup" Margin="10,8,0,0" HorizontalAlignment="Left" Width="150" Height="30" VerticalAlignment="Top" /> | ||
<Label Content="Start Oculus Client Software - When Dash Manager Launches" Margin="165,8,10,0" VerticalAlignment="Top" Height="30" /> | ||
<local:uc_Setting Setting="Minimize_Oculus_Client_OnClientStart" Margin="10,46,0,0" HorizontalAlignment="Left" Width="150" Height="30" VerticalAlignment="Top" /> | ||
<Label Content="Minimize Oculus Client - When Oculus Client Starts & Launched by Dash Manager" Margin="165,46,10,0" VerticalAlignment="Top" Height="30" /> | ||
<local:uc_Setting Setting="CloseOculusClientOnExit" Margin="10,84,0,0" HorizontalAlignment="Left" Width="150" Height="30" VerticalAlignment="Top" /> | ||
<Label Content="Close Oculus Client - When Dash Manager Exits" Margin="165,84,10,0" VerticalAlignment="Top" Height="30" /> | ||
<local:uc_Setting Setting="CloseOculusServicesOnExit" Margin="10,122,0,0" HorizontalAlignment="Left" Width="150" Height="30" VerticalAlignment="Top" /> | ||
<Label Content="Stop Oculus Services - When Manager Exits (When Oculus Services set to Manual Startup)" Margin="165,122,10,0" VerticalAlignment="Top" Height="30" /> | ||
</Grid> | ||
</GroupBox> | ||
<GroupBox Header="Steam / SteamVR Settings" Margin="10,366,10,0" Height="135" VerticalAlignment="Top"> | ||
<Grid Margin="0"> | ||
<local:uc_Setting Setting="SteamVRFocusFix" Margin="10,3,0,0" HorizontalAlignment="Left" Width="150" Height="30" VerticalAlignment="Top" /> | ||
<Label Content="Fix SteamVR Admin Program Focus Issue When it Occurs (Task View Glitch)" Margin="166,3,10,0" VerticalAlignment="Top" Height="30" /> | ||
<local:uc_Setting Setting="ExitLinkOn_UserExit_SteamVR" Margin="10,41,0,0" HorizontalAlignment="Left" Width="150" Height="30" VerticalAlignment="Top" /> | ||
<Label Content="Exit Oculus Link when User Closes Steam VR (Stable Link Connection Recommended)" HorizontalAlignment="Left" Margin="166,41,0,0" VerticalAlignment="Top" Height="30" /> | ||
</Grid> | ||
</GroupBox> | ||
</Grid> | ||
</Window> |
15 changes: 15 additions & 0 deletions
15
Oculus VR Dash Manager - Copy/Forms/Settings/frm_Settings_v2.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Windows; | ||
|
||
namespace OVR_Dash_Manager.Forms.Settings | ||
{ | ||
/// <summary> | ||
/// Interaction logic for frm_Settings_v2.xaml | ||
/// </summary> | ||
public partial class frm_Settings_v2 : Window | ||
{ | ||
public frm_Settings_v2() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
Oculus VR Dash Manager - Copy/Forms/Settings/uc_Setting.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<UserControl x:Class="OVR_Dash_Manager.Forms.Settings.uc_Setting" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:OVR_Dash_Manager.Forms.Settings" | ||
mc:Ignorable="d" d:Height="40" d:Width="200" Loaded="UserControl_Loaded"> | ||
|
||
<UserControl.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="../../Theme/MetroDark.MSControls.Core.Implicit.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</UserControl.Resources> | ||
|
||
<Grid x:Name="gd_Settings" Background="#FF212121"> | ||
<UniformGrid Rows="1" Margin="0"> | ||
<UniformGrid.Resources> | ||
<Style TargetType="RadioButton" BasedOn="{StaticResource {x:Type ToggleButton}}"/> | ||
</UniformGrid.Resources> | ||
<RadioButton x:Name="btn_Disabled" Content="Disabled" Checked="btn_Disabled_Checked" VerticalContentAlignment="Center" FontSize="13" HorizontalContentAlignment="Center" /> | ||
<RadioButton x:Name="btn_Enabled" Content="Enabled" Checked="btn_Enabled_Checked" VerticalContentAlignment="Center" FontSize="13" HorizontalContentAlignment="Center" /> | ||
</UniformGrid> | ||
</Grid> | ||
</UserControl> |
80 changes: 80 additions & 0 deletions
80
Oculus VR Dash Manager - Copy/Forms/Settings/uc_Setting.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using System; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
|
||
namespace OVR_Dash_Manager.Forms.Settings | ||
{ | ||
/// <summary> | ||
/// Interaction logic for uc_Setting.xaml | ||
/// </summary> | ||
public partial class uc_Setting : UserControl | ||
{ | ||
public uc_Setting() | ||
{ | ||
InitializeComponent(); | ||
this.DataContext = this; | ||
} | ||
|
||
public string Setting { get; set; } | ||
|
||
private void UserControl_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Buttons(); | ||
} | ||
|
||
private void btn_Disabled_Checked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(false); | ||
} | ||
|
||
private void btn_Enabled_Checked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(true); | ||
} | ||
|
||
private void Update_Buttons() | ||
{ | ||
bool Current = Get_Properties_Setting(Setting); | ||
|
||
btn_Enabled.IsChecked = Current; | ||
btn_Disabled.IsChecked = !Current; | ||
} | ||
|
||
private void Update_Properties_Setting(bool Value) | ||
{ | ||
bool Current; | ||
|
||
try | ||
{ | ||
Current = Get_Properties_Setting(Setting); | ||
} | ||
catch (Exception) | ||
{ | ||
return; | ||
} | ||
|
||
if (Current != Value) | ||
{ | ||
Properties.Settings.Default[Setting] = Value; | ||
Properties.Settings.Default.Save(); | ||
Update_Buttons(); | ||
} | ||
} | ||
|
||
private bool Get_Properties_Setting(String SettingName) | ||
{ | ||
bool Setting = false; | ||
|
||
try | ||
{ | ||
Setting = (bool)Properties.Settings.Default[SettingName]; | ||
} | ||
catch (Exception) | ||
{ | ||
return false; | ||
} | ||
|
||
return Setting; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<Window x:Class="OVR_Dash_Manager.Forms.frm_Diagnostics" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Title="Diagnostics" Height="644" Width="430" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize" Loaded="Window_Loaded" Closing="Window_Closing"> | ||
|
||
<Window.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="../Theme/MetroDark.MSControls.Core.Implicit.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Window.Resources> | ||
|
||
<Grid Background="#FF212121"> | ||
<Label Content="Oculus Software" HorizontalAlignment="Left" Margin="10,40,0,0" VerticalAlignment="Top" /> | ||
<Label Content="Oculus Client" HorizontalAlignment="Left" Margin="10,73,0,0" VerticalAlignment="Top" /> | ||
<Label Content="Oculus Libary Service" HorizontalAlignment="Left" Margin="10,106,0,0" VerticalAlignment="Top" /> | ||
<Label Content="Oculus Runtime Service" HorizontalAlignment="Left" Margin="10,139,0,0" VerticalAlignment="Top" /> | ||
<Label Content="Steam" HorizontalAlignment="Left" Margin="10,172,0,0" VerticalAlignment="Top" Height="28" Width="46" /> | ||
<Label Content="Steam VR" HorizontalAlignment="Left" Margin="10,205,0,0" VerticalAlignment="Top" /> | ||
<Label Content="Current Dash" HorizontalAlignment="Left" Margin="10,238,0,0" VerticalAlignment="Top" /> | ||
<Label Content="Offical Dash" HorizontalAlignment="Left" Margin="10,271,0,0" VerticalAlignment="Top" /> | ||
<Label Content="ItsKaitlyn03 / OculusKiller" HorizontalAlignment="Left" Margin="10,304,0,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_OculusSoftware" Content="Label" Margin="174,40,10,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_OculussClient" Content="Label" Margin="174,73,10,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_OculusLibaryService" Content="Label" Margin="174,106,10,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_OculusRuntimeService" Content="Label" Margin="174,139,10,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_Steam" Content="Label" Margin="174,172,10,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_SteamVR" Content="Label" Margin="174,205,10,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_CurrentDash" Content="Label" Margin="174,238,10,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_OfficalDash" Content="Label" Margin="174,271,10,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_OculusKiller" Content="Label" Margin="174,304,10,0" VerticalAlignment="Top" /> | ||
<Label Content="Last Check" HorizontalAlignment="Left" Margin="10,7,0,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_DiagnosticsCheckTime" Content="Label" Margin="174,7,10,0" VerticalAlignment="Top" /> | ||
<ListView x:Name="lv_OculusDevices" Margin="10,0,10,10" Height="135" VerticalAlignment="Bottom"> | ||
<ListView.View> | ||
<GridView> | ||
<GridViewColumn Header="Device Type" Width="250" DisplayMemberBinding="{Binding Type}" /> | ||
<GridViewColumn Header="Serial" Width="125" DisplayMemberBinding="{Binding Serial}" /> | ||
</GridView> | ||
</ListView.View> | ||
</ListView> | ||
<Label Content="Devices Detected" HorizontalAlignment="Left" Margin="10,0,0,157" VerticalAlignment="Bottom" /> | ||
<Button x:Name="btn_OculusDebugTool" Content="Oculus Debug Tool" HorizontalAlignment="Right" Margin="0,0,10,156" VerticalAlignment="Bottom" Width="170" Click="btn_OculusDebugTool_Click"/> | ||
<Label Content="OpenXR Runtime:" HorizontalAlignment="Left" Margin="10,337,0,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_OpenXR_RunTime" Content="Label" Margin="174,337,10,0" VerticalAlignment="Top" /> | ||
</Grid> | ||
</Window> |
84 changes: 84 additions & 0 deletions
84
Oculus VR Dash Manager - Copy/Forms/frm_Diagnostics.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Timers; | ||
using System.Windows; | ||
|
||
namespace OVR_Dash_Manager.Forms | ||
{ | ||
/// <summary> | ||
/// Interaction logic for frm_Diagnostics.xaml | ||
/// </summary> | ||
public partial class frm_Diagnostics : Window | ||
{ | ||
public frm_Diagnostics() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void Window_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
DiagnosticsChecker(); | ||
|
||
Timer_Functions.CreateTimer("Diagnostics Checker", TimeSpan.FromSeconds(10), CallDiagnosticsChecker); | ||
Timer_Functions.StartTimer("Diagnostics Checker"); | ||
} | ||
|
||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) | ||
{ | ||
Timer_Functions.StopTimer("Diagnostics Checker"); | ||
Timer_Functions.DisposeTimer("Diagnostics Checker"); | ||
} | ||
|
||
private void CallDiagnosticsChecker(object sender, ElapsedEventArgs args) | ||
{ | ||
Functions_Old.DoAction(this, new Action(delegate () { DiagnosticsChecker(); })); | ||
} | ||
|
||
private void DiagnosticsChecker() | ||
{ | ||
lbl_OculusSoftware.Content = Software.Oculus.Oculus_Is_Installed ? "Installed" : "Not Found"; | ||
|
||
if (!String.IsNullOrEmpty(Software.Oculus.Oculus_Client_EXE)) | ||
{ | ||
if (File.Exists(Software.Oculus.Oculus_Client_EXE)) | ||
lbl_OculussClient.Content = "Installed"; | ||
else | ||
lbl_OculussClient.Content = "Not Found"; | ||
} | ||
else | ||
lbl_OculussClient.Content = "Not Found"; | ||
|
||
lbl_OfficalDash.Content = Dashes.Dash_Manager.IsInstalled(Dashes.Dash_Type.Normal) ? "Installed" : "Not Found"; | ||
lbl_OculusKiller.Content = Dashes.Dash_Manager.IsInstalled(Dashes.Dash_Type.Normal) ? "Installed" : "Not Found"; | ||
|
||
FileVersionInfo Info = FileVersionInfo.GetVersionInfo(Software.Oculus.Oculus_Dash_File); | ||
Dashes.Dash_Type Current = Dashes.Dash_Manager.CheckWhosDash(Info.ProductName); | ||
lbl_CurrentDash.Content = Dashes.Dash_Manager.GetDashName(Current); | ||
|
||
lbl_OculusLibaryService.Content = $"State: {Service_Manager.GetState("OVRService")} - Startup: {Service_Manager.GetStartup("OVRService")}"; | ||
lbl_OculusRuntimeService.Content = $"State: {Service_Manager.GetState("OVRService")} - Startup: {Service_Manager.GetStartup("OVRService")}"; | ||
|
||
lbl_Steam.Content = $"{(Software.Steam.Steam_Installed ? "Installed" : "Not Found")}"; | ||
lbl_SteamVR.Content = $"{(Software.Steam.Steam_VR_Installed ? "Installed" : "Not Found")} - {(Software.Steam.Steam_VR_Server_Running ? "Running" : "Not Started")}"; | ||
|
||
lbl_DiagnosticsCheckTime.Content = DateTime.Now.ToString(); | ||
|
||
lv_OculusDevices.ItemsSource = USB_Devices_Functions.GetUSBDevices(); | ||
|
||
Software.Steam_VR_Settings.OpenXR_Runtime CurrentRuntime = Software.Steam_VR_Settings.Read_Runtime(); | ||
|
||
if (CurrentRuntime == Software.Steam_VR_Settings.OpenXR_Runtime.Oculus) | ||
lbl_OpenXR_RunTime.Content = "Oculus Runtime"; | ||
|
||
if (CurrentRuntime == Software.Steam_VR_Settings.OpenXR_Runtime.SteamVR) | ||
lbl_OpenXR_RunTime.Content = "SteamVR Runtime"; | ||
} | ||
|
||
private void btn_OculusDebugTool_Click(object sender, RoutedEventArgs e) | ||
{ | ||
if (File.Exists(Software.Oculus.Oculus_DebugTool_EXE)) | ||
Process.Start(Software.Oculus.Oculus_DebugTool_EXE); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<Window x:Class="OVR_Dash_Manager.Forms.frm_Help" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:OVR_Dash_Manager.Forms" | ||
mc:Ignorable="d" | ||
Title="Help" Height="250" Width="300" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize"> | ||
|
||
<Window.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="../Theme/MetroDark.MSControls.Core.Implicit.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Window.Resources> | ||
|
||
<Grid Background="#FF212121"> | ||
<Label Content="Visit Github Page" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2" /> | ||
<Button x:Name="btn_GitHub" Content="GitHub" HorizontalAlignment="Left" Margin="141,10,0,0" VerticalAlignment="Top" Height="28" Width="110" Click="btn_GitHub_Click" /> | ||
<Label Content="Visit Discord Server" HorizontalAlignment="Left" Margin="10,56,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2" /> | ||
<Button x:Name="btn_Discord" Content="Discord" HorizontalAlignment="Left" Margin="141,56,0,0" VerticalAlignment="Top" Height="28" Width="110" Click="btn_Discord_Click" /> | ||
<TextBlock Text="Please do not post for help on the OpenOculus discord when the issue about the Dash Manager. Oculus VR Dash Manager is not associated/affiliated with that server." Margin="10,100,10,10" TextWrapping="Wrap" Foreground="White" Grid.ColumnSpan="2" /> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Windows; | ||
|
||
namespace OVR_Dash_Manager.Forms | ||
{ | ||
/// <summary> | ||
/// Interaction logic for frm_Help.xaml | ||
/// </summary> | ||
public partial class frm_Help : Window | ||
{ | ||
public frm_Help() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void btn_GitHub_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Functions_Old.OpenURL("https://github.com/KrisIsBackAU/Oculus-VR-Dash-Manager"); | ||
} | ||
|
||
private void btn_Discord_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Functions_Old.OpenURL("https://discord.gg/ANeSUXRwgC"); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
Oculus VR Dash Manager - Copy/Forms/frm_Oculus_Service_Control.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<Window x:Class="OVR_Dash_Manager.Forms.frm_Oculus_Service_Control" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:OVR_Dash_Manager.Forms" | ||
mc:Ignorable="d" | ||
Title="Oculus Service Control" Height="360" Width="410" ResizeMode="CanMinimize" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" Closing="Window_Closing"> | ||
<Window.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="../Theme/MetroDark.MSControls.Core.Implicit.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Window.Resources> | ||
|
||
<Grid Background="#FF212121"> | ||
<Label Content="Oculus VR Libary Service" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="168" /> | ||
<Label x:Name="lbl_LibaryServer_State" Content="Automatic" HorizontalAlignment="Left" Margin="10,38,0,0" VerticalAlignment="Top" Width="168" HorizontalContentAlignment="Center" /> | ||
<Label Content="Oculus VR Runtime Service" HorizontalAlignment="Left" Margin="206,10,0,0" VerticalAlignment="Top" /> | ||
<Button x:Name="btn_Libary_Server_Manual" Content="Set Manual" HorizontalAlignment="Left" Margin="10,106,0,0" VerticalAlignment="Top" Width="168" Click="btn_Libary_Server_Manual_Click" /> | ||
<Button x:Name="btn_Libary_Server_Automatic" Content="Set Automatic" HorizontalAlignment="Left" Margin="10,141,0,0" VerticalAlignment="Top" Width="168" Click="btn_Libary_Server_Automatic_Click" /> | ||
<Button x:Name="btn_Runtime_Server_Manual" Content="Set Manual" HorizontalAlignment="Left" Margin="206,106,0,0" VerticalAlignment="Top" Width="168" Click="btn_Runtime_Server_Manual_Click" /> | ||
<Button x:Name="btn_Runtime_Server_Automatic" Content="Set Automatic" HorizontalAlignment="Left" Margin="206,141,0,0" VerticalAlignment="Top" Width="168" Click="btn_Runtime_Server_Automatic_Click" /> | ||
<Label x:Name="lbl_LibaryServer_Startup" Content="Automatic" HorizontalAlignment="Left" Margin="10,71,0,0" VerticalAlignment="Top" Width="168" HorizontalContentAlignment="Center" /> | ||
<Label x:Name="lbl_RuntimeServer_State" Content="Automatic" HorizontalAlignment="Left" Margin="206,38,0,0" VerticalAlignment="Top" Width="168" HorizontalContentAlignment="Center" /> | ||
<Label x:Name="lbl_RuntimeServer_Startup" Content="Automatic" HorizontalAlignment="Left" Margin="206,71,0,0" VerticalAlignment="Top" Width="168" HorizontalContentAlignment="Center" /> | ||
<TextBlock Text="Setting Services to Manual will stop them running all time. This will save on computer resources when VR has not been used yet. Oculus will start services automaticlly when you run the Oculus Client. " Margin="10,0,10,10" TextWrapping="Wrap" Foreground="White" Height="52" VerticalAlignment="Bottom" /> | ||
<Button x:Name="btn_Libary_Server_Stop" Content="Stop" HorizontalAlignment="Left" Margin="10,187,0,0" VerticalAlignment="Top" Width="168" Click="btn_Libary_Server_Stop_Click" /> | ||
<Button x:Name="btn_Libary_Server_Start" Content="Start" HorizontalAlignment="Left" Margin="10,222,0,0" VerticalAlignment="Top" Width="168" Click="btn_Libary_Server_Start_Click" /> | ||
<Button x:Name="btn_Runtime_Server_Stop" Content="Stop" HorizontalAlignment="Left" Margin="206,187,0,0" VerticalAlignment="Top" Width="168" Click="btn_Runtime_Server_Stop_Click" /> | ||
<Button x:Name="btn_Runtime_Server_Start" Content="Start" HorizontalAlignment="Left" Margin="206,222,0,0" VerticalAlignment="Top" Width="168" Click="btn_Runtime_Server_Start_Click" /> | ||
</Grid> | ||
</Window> |
130 changes: 130 additions & 0 deletions
130
Oculus VR Dash Manager - Copy/Forms/frm_Oculus_Service_Control.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
using System; | ||
using System.ServiceProcess; | ||
using System.Timers; | ||
using System.Windows; | ||
|
||
namespace OVR_Dash_Manager.Forms | ||
{ | ||
/// <summary> | ||
/// Interaction logic for frm_Oculus_Service_Control.xaml | ||
/// </summary> | ||
public partial class frm_Oculus_Service_Control : Window | ||
{ | ||
// OVRLibraryService | ||
// OVRService | ||
|
||
public frm_Oculus_Service_Control() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void Window_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
ClearLabels(); | ||
|
||
Timer_Functions.CreateTimer("Oculus Service Checker", TimeSpan.FromSeconds(5), CallCheckServices); | ||
Timer_Functions.StartTimer("Oculus Service Checker"); | ||
|
||
CheckServices(); | ||
} | ||
|
||
private void ClearLabels() | ||
{ | ||
lbl_LibaryServer_Startup.Content = ""; | ||
lbl_LibaryServer_State.Content = ""; | ||
lbl_RuntimeServer_Startup.Content = ""; | ||
lbl_RuntimeServer_State.Content = ""; | ||
} | ||
|
||
private void CallCheckServices(object sender, ElapsedEventArgs args) | ||
{ | ||
Functions_Old.DoAction(this, new Action(delegate () { CheckServices(); })); | ||
} | ||
|
||
private void CheckServices() | ||
{ | ||
lbl_LibaryServer_Startup.Content = Service_Manager.GetStartup("OVRLibraryService"); | ||
lbl_LibaryServer_State.Content = Service_Manager.GetState("OVRLibraryService"); | ||
lbl_RuntimeServer_Startup.Content = Service_Manager.GetStartup("OVRService"); | ||
lbl_RuntimeServer_State.Content = Service_Manager.GetState("OVRService"); | ||
} | ||
|
||
private void btn_Libary_Server_Manual_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Service_Manager.Set_Manual_Startup("OVRLibraryService"); | ||
CheckServices(); | ||
} | ||
|
||
private void btn_Libary_Server_Automatic_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Service_Manager.Set_Automatic_Startup("OVRLibraryService"); | ||
CheckServices(); | ||
} | ||
|
||
private void btn_Runtime_Server_Manual_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Service_Manager.Set_Manual_Startup("OVRService"); | ||
CheckServices(); | ||
} | ||
|
||
private void btn_Runtime_Server_Automatic_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Service_Manager.Set_Automatic_Startup("OVRService"); | ||
CheckServices(); | ||
} | ||
|
||
private Boolean Running(ServiceControllerStatus Status) | ||
{ | ||
switch (Status) | ||
{ | ||
case ServiceControllerStatus.Running: | ||
return true; | ||
|
||
case ServiceControllerStatus.Stopped: | ||
return false; | ||
|
||
case ServiceControllerStatus.Paused: | ||
return true; | ||
|
||
case ServiceControllerStatus.StopPending: | ||
return true; | ||
|
||
case ServiceControllerStatus.StartPending: | ||
return true; | ||
|
||
default: | ||
return false; | ||
} | ||
} | ||
|
||
private void btn_Libary_Server_Stop_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Service_Manager.StopService("OVRLibraryService"); | ||
CheckServices(); | ||
} | ||
|
||
private void btn_Libary_Server_Start_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Service_Manager.StartService("OVRLibraryService"); | ||
CheckServices(); | ||
} | ||
|
||
private void btn_Runtime_Server_Stop_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Service_Manager.StopService("OVRService"); | ||
CheckServices(); | ||
} | ||
|
||
private void btn_Runtime_Server_Start_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Service_Manager.StartService("OVRService"); | ||
CheckServices(); | ||
} | ||
|
||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) | ||
{ | ||
Timer_Functions.StopTimer("Oculus Service Checker"); | ||
Timer_Functions.DisposeTimer("Oculus Service Checker"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<Window x:Class="OVR_Dash_Manager.Forms.frm_Settings" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Title="Settings" Height="370" Width="905" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded"> | ||
|
||
<Window.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="../Theme/MetroDark.MSControls.Core.Implicit.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Window.Resources> | ||
|
||
<Grid x:Name="gd_Settings" Background="#FF212121"> | ||
<CheckBox x:Name="chkbx_AlwaysOnTop" Content="Always On Top" HorizontalAlignment="Left" Margin="10,14,0,0" Width="140" Checked="chkbx_AlwaysOnTop_Checked" Unchecked="chkbx_AlwaysOnTop_Unchecked" Height="16" VerticalAlignment="Top" Tag="AlwaysOnTop" /> | ||
<CheckBox x:Name="chkbx_FastSwitch" Content="Fast Switch (Beta)" HorizontalAlignment="Left" Margin="10,49,0,0" Width="151" Checked="chkbx_FastSwitch_Checked" Unchecked="chkbx_FastSwitch_Unchecked" Height="16" VerticalAlignment="Top" Tag="FastSwitch" /> | ||
<Label Content="Keeps Dash Manager On Top (Patches (Partially) SteamVR Access Issue)" HorizontalAlignment="Left" Margin="279,14,0,0" VerticalAlignment="Top" Height="30" /> | ||
<Label Content="Switches Dashes with out Stopping Link (AirLink Supported)" HorizontalAlignment="Left" Margin="279,49,0,0" VerticalAlignment="Top" Height="30" /> | ||
<CheckBox x:Name="chkbx_ShutdownServices" Content="Close Oculus Services on Manager Close" HorizontalAlignment="Left" Margin="10,84,0,0" Width="300" Checked="chkbx_ShutdownServices_Checked" Unchecked="chkbx_ShutdownServices_Unchecked" Height="16" VerticalAlignment="Top" Tag="CloseOculusServicesOnExit" /> | ||
<Label Content="Close Oculus Services when Manager Exits (Only when Services set to Manual Startup)" HorizontalAlignment="Left" Margin="340,84,0,0" VerticalAlignment="Top" Height="30" /> | ||
<CheckBox x:Name="chkbx_StartOculusClientOnLaunch" Content="Start Oculus Client on Manager Launch" HorizontalAlignment="Left" Margin="10,119,0,0" Width="300" Checked="chkbx_StartOculusClientOnLaunch_Checked" Unchecked="chkbx_StartOculusClientOnLaunch_Unchecked" Height="16" VerticalAlignment="Top" Tag="RunOculusClientOnStartup" /> | ||
<Label Content="Start Oculus Client when Manager Starts" HorizontalAlignment="Left" Margin="336,119,0,0" VerticalAlignment="Top" Height="30" /> | ||
<CheckBox x:Name="chkbx_SteamVRFocusFix" Content="Check for SteamVR Admin Program Focus Issue" HorizontalAlignment="Left" Margin="10,224,0,0" Width="350" Checked="chkbx_SteamVRFocusFix_Checked" Unchecked="chkbx_SteamVRFocusFix_Unchecked" Height="16" VerticalAlignment="Top" Tag="SteamVRFocusFix" /> | ||
<Label Content="Lets the Manager Fix SteamVR Admin Program Focus Issue When it Occurs" HorizontalAlignment="Left" Margin="379,224,0,0" VerticalAlignment="Top" Height="30" Width="464" /> | ||
<CheckBox x:Name="chkbx_ExitLink_OnUserClose_Steam" Content="Exit Link on User Exit Steam VR" HorizontalAlignment="Left" Margin="9,259,0,0" Width="267" Checked="chkbx_ExitLink_OnUserClose_Steam_Checked" Unchecked="chkbx_ExitLink_OnUserClose_Steam_Unchecked" Height="16" VerticalAlignment="Top" Tag="ExitLinkOn_UserExit_SteamVR" /> | ||
<Label Content="Exit Oculus Link when User Closes Steam VR (Stable Link Connection Recommended)" HorizontalAlignment="Left" Margin="299,259,0,0" VerticalAlignment="Top" Height="30" Width="514" /> | ||
<CheckBox x:Name="chkbx_CloseOculusClientOnLaunch" Content="Close Oculus Client on Manager Exit" HorizontalAlignment="Left" Margin="10,154,0,0" Width="300" Checked="chkbx_CloseOculusClientOnLaunch_Checked" Unchecked="chkbx_CloseOculusClientOnLaunch_Unchecked" Height="16" VerticalAlignment="Top" Tag="CloseOculusClientOnExit" /> | ||
<Label Content="Close Oculus Client when Manager Exits" HorizontalAlignment="Left" Margin="336,154,0,0" VerticalAlignment="Top" Height="30" /> | ||
<CheckBox x:Name="chkbx_MinimizeOculusClientOnClientLaunch" Content="Minimize Oculus Client on Client Launch" HorizontalAlignment="Left" Margin="10,189,0,0" Width="300" Checked="chkbx_MinimizeOculusClientOnClientLaunch_Checked" Unchecked="chkbx_MinimizeOculusClientOnClientLaunch_Unchecked" Height="16" VerticalAlignment="Top" Tag="Minimize_Oculus_Client_OnClientStart" /> | ||
<Label Content="Minimize Oculus Client when Oculus Client Starts" HorizontalAlignment="Left" Margin="336,189,0,0" VerticalAlignment="Top" Height="30" /> | ||
</Grid> | ||
</Window> |
154 changes: 154 additions & 0 deletions
154
Oculus VR Dash Manager - Copy/Forms/frm_Settings.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
using System; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
|
||
namespace OVR_Dash_Manager.Forms | ||
{ | ||
/// <summary> | ||
/// Interaction logic for frm_Settings.xaml | ||
/// </summary> | ||
public partial class frm_Settings : Window | ||
{ | ||
public frm_Settings() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void Window_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
UpdateCheckBoxes(); | ||
} | ||
|
||
private void UpdateCheckBoxes() | ||
{ | ||
foreach (UIElement item in gd_Settings.Children) | ||
{ | ||
if (item is CheckBox box) | ||
{ | ||
if (box.Tag != null) | ||
box.IsChecked = Get_Properties_Setting(box.Tag.ToString()); | ||
} | ||
} | ||
} | ||
|
||
private void Update_Properties_Setting(String SettingName, bool Value, CheckBox DisplayBox = null) | ||
{ | ||
bool Setting = false; | ||
|
||
try | ||
{ | ||
Setting = (bool)Properties.Settings.Default[SettingName]; | ||
} | ||
catch (Exception) | ||
{ | ||
return; | ||
} | ||
|
||
if (Setting != Value) | ||
{ | ||
Properties.Settings.Default[SettingName] = Value; | ||
|
||
if (DisplayBox != null) | ||
DisplayBox.IsChecked = Value; | ||
|
||
Properties.Settings.Default.Save(); | ||
} | ||
} | ||
|
||
private bool Get_Properties_Setting(String SettingName) | ||
{ | ||
bool Setting = false; | ||
|
||
try | ||
{ | ||
Setting = (bool)Properties.Settings.Default[SettingName]; | ||
} | ||
catch (Exception) | ||
{ | ||
return false; | ||
} | ||
|
||
return Setting; | ||
} | ||
|
||
private void chkbx_AlwaysOnTop_Checked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_AlwaysOnTop.Tag.ToString(), true, chkbx_AlwaysOnTop); | ||
} | ||
|
||
private void chkbx_AlwaysOnTop_Unchecked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_AlwaysOnTop.Tag.ToString(), false, chkbx_AlwaysOnTop); | ||
} | ||
|
||
private void chkbx_FastSwitch_Checked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_FastSwitch.Tag.ToString(), true, chkbx_FastSwitch); | ||
} | ||
|
||
private void chkbx_FastSwitch_Unchecked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_FastSwitch.Tag.ToString(), false, chkbx_FastSwitch); | ||
} | ||
|
||
private void chkbx_ShutdownServices_Checked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_ShutdownServices.Tag.ToString(), true, chkbx_ShutdownServices); | ||
} | ||
|
||
private void chkbx_ShutdownServices_Unchecked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_ShutdownServices.Tag.ToString(), false, chkbx_ShutdownServices); | ||
} | ||
|
||
private void chkbx_StartOculusClientOnLaunch_Checked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_StartOculusClientOnLaunch.Tag.ToString(), true, chkbx_StartOculusClientOnLaunch); | ||
} | ||
|
||
private void chkbx_StartOculusClientOnLaunch_Unchecked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_StartOculusClientOnLaunch.Tag.ToString(), false, chkbx_StartOculusClientOnLaunch); | ||
} | ||
|
||
private void chkbx_SteamVRFocusFix_Checked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_SteamVRFocusFix.Tag.ToString(), true, chkbx_SteamVRFocusFix); | ||
} | ||
|
||
private void chkbx_SteamVRFocusFix_Unchecked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_SteamVRFocusFix.Tag.ToString(), false, chkbx_SteamVRFocusFix); | ||
} | ||
|
||
private void chkbx_ExitLink_OnUserClose_Steam_Checked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_ExitLink_OnUserClose_Steam.Tag.ToString(), true, chkbx_ExitLink_OnUserClose_Steam); | ||
} | ||
|
||
private void chkbx_ExitLink_OnUserClose_Steam_Unchecked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_ExitLink_OnUserClose_Steam.Tag.ToString(), false, chkbx_ExitLink_OnUserClose_Steam); | ||
} | ||
|
||
private void chkbx_CloseOculusClientOnLaunch_Checked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_CloseOculusClientOnLaunch.Tag.ToString(), true, chkbx_CloseOculusClientOnLaunch); | ||
} | ||
|
||
private void chkbx_CloseOculusClientOnLaunch_Unchecked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_CloseOculusClientOnLaunch.Tag.ToString(), false, chkbx_CloseOculusClientOnLaunch); | ||
} | ||
|
||
private void chkbx_MinimizeOculusClientOnClientLaunch_Checked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_MinimizeOculusClientOnClientLaunch.Tag.ToString(), true, chkbx_MinimizeOculusClientOnClientLaunch); | ||
} | ||
|
||
private void chkbx_MinimizeOculusClientOnClientLaunch_Unchecked(object sender, RoutedEventArgs e) | ||
{ | ||
Update_Properties_Setting(chkbx_MinimizeOculusClientOnClientLaunch.Tag.ToString(), false, chkbx_MinimizeOculusClientOnClientLaunch); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
Oculus VR Dash Manager - Copy/Forms/frm_SteamVR_Settings.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<Window x:Class="OVR_Dash_Manager.Forms.frm_SteamVR_Settings" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:OVR_Dash_Manager.Forms" | ||
mc:Ignorable="d" | ||
Title="Steam VR Settings" Height="450" Width="800" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize"> | ||
|
||
<Window.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="../Theme/MetroDark.MSControls.Core.Implicit.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Window.Resources> | ||
|
||
<Grid Background="#FF212121"> | ||
|
||
</Grid> | ||
</Window> |
27 changes: 27 additions & 0 deletions
27
Oculus VR Dash Manager - Copy/Forms/frm_SteamVR_Settings.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Shapes; | ||
|
||
namespace OVR_Dash_Manager.Forms | ||
{ | ||
/// <summary> | ||
/// Interaction logic for frm_SteamVR_Settings.xaml | ||
/// </summary> | ||
public partial class frm_SteamVR_Settings : Window | ||
{ | ||
public frm_SteamVR_Settings() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<Window x:Class="OVR_Dash_Manager.Forms.frm_TestWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:OVR_Dash_Manager.Forms" | ||
mc:Ignorable="d" | ||
Title="Test Window" Height="450" Width="800" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize" Loaded="Window_Loaded" Closing="Window_Closed"> | ||
|
||
<Window.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="../Theme/MetroDark.MSControls.Core.Implicit.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Window.Resources> | ||
|
||
<Grid Background="#FF212121"> | ||
<TextBox x:Name="txtbx_ReadOut" Text="Start Test UI" TextWrapping="Wrap" Margin="10,10,10,50"/> | ||
<Button x:Name="btn_ChangeSteamRunTime" Content="Swtich SteamVR Runtime" Margin="10,0,0,10" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="195" Click="btn_ChangeSteamRunTime_Click"/> | ||
<Button x:Name="btn_ChangeOculusRunTime" Content="Swtich Oculus Runtime" Margin="224,0,0,10" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="195" Click="btn_ChangeOculusRunTime_Click"/> | ||
</Grid> | ||
</Window> |
54 changes: 54 additions & 0 deletions
54
Oculus VR Dash Manager - Copy/Forms/frm_TestWindow.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
using System.Timers; | ||
using System.Windows; | ||
using WindowsInput; | ||
using WindowsInput.Native; | ||
|
||
namespace OVR_Dash_Manager.Forms | ||
{ | ||
/// <summary> | ||
/// Interaction logic for frm_TestWindow.xaml | ||
/// </summary> | ||
public partial class frm_TestWindow : Window | ||
{ | ||
public frm_TestWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void AddToReadOut(String Text) | ||
{ | ||
Functions_Old.DoAction(this, new Action(delegate () { txtbx_ReadOut.AppendText(Text + "\r\n"); txtbx_ReadOut.ScrollToEnd(); })); | ||
} | ||
|
||
private void Window_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
Timer_Functions.CreateTimer("Test_Function", TimeSpan.FromSeconds(1), Test_Function); | ||
Timer_Functions.StartTimer("Test_Function"); | ||
} | ||
|
||
private void Window_Closed(object sender, EventArgs e) | ||
{ | ||
Timer_Functions.StopTimer("Test_Function"); | ||
Timer_Functions.DisposeTimer("Test_Function"); | ||
} | ||
|
||
private void Test_Function(object sender, ElapsedEventArgs args) | ||
{ | ||
|
||
} | ||
|
||
private void btn_ChangeSteamRunTime_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Software.Steam_VR_Settings.Set_SteamVR_Runtime(); | ||
} | ||
|
||
private void btn_ChangeOculusRunTime_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Software.Oculus_Link.SetToOculusRunTime(); | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
Oculus VR Dash Manager - Copy/Forms/frm_UpdateChecker.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<Window x:Class="OVR_Dash_Manager.Forms.frm_UpdateChecker" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Title="Update Checker" Height="410" Width="481" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize"> | ||
|
||
<Window.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="../Theme/MetroDark.MSControls.Core.Implicit.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Window.Resources> | ||
|
||
<Grid Background="#FF212121"> | ||
<GroupBox Header="Dash Manager" Margin="10,0,0,10" HorizontalAlignment="Left" Width="218"> | ||
<Grid Margin="0"> | ||
<Label Content="Last Check" Margin="10,7,10,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_DashManager_LastCheck" Content="Label" Margin="10,35,10,0" VerticalAlignment="Top" /> | ||
<Label Content="Current Version" Margin="10,79,10,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_DashManager_CurrentVersion" Content="Label" Margin="10,107,10,0" VerticalAlignment="Top" /> | ||
<Label Content="Avaliable Version" Margin="10,160,10,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_DashManager_AvaliableVersion" Content="Label" Margin="10,188,10,0" VerticalAlignment="Top" /> | ||
<Button x:Name="btn_DashManager_OpenWebsite" Content="Open Website" Margin="10,229,10,0" VerticalAlignment="Top" Click="btn_DashManager_OpenWebsite_Click" /> | ||
</Grid> | ||
</GroupBox> | ||
<GroupBox Header="ItsKaitlyn03 / OculusKiller" Margin="233,0,0,10" HorizontalAlignment="Left" Width="218"> | ||
<Grid Margin="0"> | ||
<Label Content="Last Check" Margin="10,7,10,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_ItsKaitlyn03_LastCheck" Content="Label" Margin="10,35,10,0" VerticalAlignment="Top" /> | ||
<Label Content="Current Version" Margin="10,79,10,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_ItsKaitlyn03_CurrentVersion" Content="Label" Margin="10,107,10,0" VerticalAlignment="Top" /> | ||
<Label Content="Avaliable Version" Margin="10,160,10,0" VerticalAlignment="Top" /> | ||
<Label x:Name="lbl_ItsKaitlyn03_AvaliableVersion" Content="Label" Margin="10,188,10,0" VerticalAlignment="Top" /> | ||
<Button x:Name="btn_ItsKaitlyn03_OpenWebsite" Content="Open Website" Margin="10,269,10,0" VerticalAlignment="Top" Click="btn_ItsKaitlyn03_OpenWebsite_Click" /> | ||
<Button x:Name="btn_ItsKaitlyn03_Download" Content="Download Latest" Margin="10,229,10,0" VerticalAlignment="Top" IsEnabled="False" Click="btn_ItsKaitlyn03_Download_Click" /> | ||
</Grid> | ||
</GroupBox> | ||
</Grid> | ||
</Window> |
90 changes: 90 additions & 0 deletions
90
Oculus VR Dash Manager - Copy/Forms/frm_UpdateChecker.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Threading; | ||
using System.Windows; | ||
|
||
namespace OVR_Dash_Manager.Forms | ||
{ | ||
/// <summary> | ||
/// Interaction logic for frm_UpdateChecker.xaml | ||
/// </summary> | ||
public partial class frm_UpdateChecker : Window | ||
{ | ||
private GitHub_Reply ItsKaitlyn03_GitHub; | ||
|
||
public frm_UpdateChecker() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void btn_DashManager_OpenWebsite_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Functions_Old.OpenURL("https://github.com/KrisIsBackAU/Oculus-VR-Dash-Manager"); | ||
} | ||
|
||
private void btn_ItsKaitlyn03_OpenWebsite_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Functions_Old.OpenURL("https://github.com/ItsKaitlyn03/OculusKiller"); | ||
} | ||
|
||
private void Thread_CheckUpdates() | ||
{ | ||
Check_DashManager_Update(); | ||
Check_ItsKaitlyn03_Update(); | ||
} | ||
|
||
private void Check_DashManager_Update() | ||
{ | ||
Github Check = new Github(); | ||
String Version = Check.GetLatestReleaseName("KrisIsBackAU", "Oculus-VR-Dash-Manager"); | ||
String CurrentVersion = typeof(MainWindow).Assembly.GetName().Version.ToString(); | ||
Functions_Old.DoAction(this, new Action(delegate () { lbl_DashManager_LastCheck.Content = DateTime.Now.ToString(); lbl_DashManager_CurrentVersion.Content = CurrentVersion; lbl_DashManager_AvaliableVersion.Content = Version; })); | ||
} | ||
|
||
private void Check_ItsKaitlyn03_Update() | ||
{ | ||
Dashes.OVR_Dash ItsKaitlyn03 = Dashes.Dash_Manager.GetDash(Dashes.Dash_Type.OculusKiller); | ||
|
||
if (ItsKaitlyn03 == null) | ||
Functions_Old.DoAction(this, new Action(delegate () { lbl_ItsKaitlyn03_CurrentVersion.Content = "Not Loaded"; })); | ||
else if (!ItsKaitlyn03.Installed) | ||
Functions_Old.DoAction(this, new Action(delegate () { lbl_ItsKaitlyn03_CurrentVersion.Content = "Not Downloaded"; })); | ||
else | ||
{ | ||
FileVersionInfo Info = FileVersionInfo.GetVersionInfo(Path.Combine(Software.Oculus.Oculus_Dash_Directory, ItsKaitlyn03.DashFileName)); | ||
Functions_Old.DoAction(this, new Action(delegate () { lbl_ItsKaitlyn03_CurrentVersion.Content = Info.FileVersion; })); | ||
} | ||
|
||
Github Check = new Github(); | ||
ItsKaitlyn03_GitHub = Check.GetLatestReleaseInfo("ItsKaitlyn03", "OculusKiller"); | ||
Functions_Old.DoAction(this, new Action(delegate () { lbl_ItsKaitlyn03_LastCheck.Content = DateTime.Now.ToString(); lbl_ItsKaitlyn03_AvaliableVersion.Content = ItsKaitlyn03_GitHub.Release_Version; })); | ||
|
||
if (ItsKaitlyn03_GitHub.AssetURLs.ContainsKey("OculusDash.exe")) | ||
Functions_Old.DoAction(this, new Action(delegate () { btn_ItsKaitlyn03_Download.IsEnabled = true; })); | ||
} | ||
|
||
private void Window_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
lbl_DashManager_LastCheck.Content = "Checking"; | ||
lbl_ItsKaitlyn03_LastCheck.Content = "Checking"; | ||
|
||
lbl_DashManager_CurrentVersion.Content = ""; | ||
lbl_DashManager_AvaliableVersion.Content = ""; | ||
|
||
lbl_ItsKaitlyn03_CurrentVersion.Content = ""; | ||
lbl_ItsKaitlyn03_AvaliableVersion.Content = ""; | ||
|
||
Thread CheckUpdate = new Thread(Thread_CheckUpdates); | ||
CheckUpdate.IsBackground = true; | ||
CheckUpdate.Start(); | ||
} | ||
|
||
private void btn_ItsKaitlyn03_Download_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Dashes.OVR_Dash ItsKaitlyn03 = Dashes.Dash_Manager.GetDash(Dashes.Dash_Type.OculusKiller); | ||
ItsKaitlyn03.Download(); | ||
Check_ItsKaitlyn03_Update(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,331 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Net; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
using System.Text.RegularExpressions; | ||
using System.Timers; | ||
using System.Windows; | ||
using System.Windows.Threading; | ||
|
||
namespace OVR_Dash_Manager | ||
{ | ||
public static class Functions_Old | ||
{ | ||
public static void ShowFileInDirectory(String FullPath) | ||
{ | ||
Process.Start("explorer.exe", $@"/select,""{FullPath}"""); | ||
} | ||
public static String GetPageHTML(String pURL, String Method = "GET", CookieContainer Cookies = null, String FormParams = "", String ContentType = "") | ||
{ | ||
if (pURL.Contains("&")) | ||
pURL = pURL.Replace("&", "&"); | ||
|
||
string result = ""; | ||
if (Uri.IsWellFormedUriString(pURL, UriKind.Absolute)) | ||
{ | ||
HttpWebRequest pWebRequest = (HttpWebRequest)WebRequest.Create(pURL); | ||
pWebRequest.Method = Method; | ||
pWebRequest.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0"; | ||
pWebRequest.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"; | ||
if (ContentType != "") | ||
pWebRequest.ContentType = ContentType; | ||
pWebRequest.AllowAutoRedirect = true; | ||
pWebRequest.MaximumAutomaticRedirections = 3; | ||
pWebRequest.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; | ||
|
||
if (Cookies != null) | ||
pWebRequest.CookieContainer = Cookies; | ||
|
||
if (FormParams != "") | ||
{ | ||
byte[] bytes = System.Text.Encoding.ASCII.GetBytes(FormParams); | ||
pWebRequest.ContentLength = bytes.Length; | ||
using (Stream os = pWebRequest.GetRequestStream()) | ||
os.Write(bytes, 0, bytes.Length); | ||
} | ||
|
||
WebResponse pWebResponce = null; | ||
StreamReader pStreamRead = null; | ||
|
||
try | ||
{ | ||
pWebResponce = pWebRequest.GetResponse(); | ||
pStreamRead = new StreamReader(pWebResponce.GetResponseStream(), Encoding.UTF8); | ||
result = pStreamRead.ReadToEnd(); | ||
} | ||
catch (Exception ex) | ||
{ | ||
if (ex.Message.Contains("an error")) | ||
{ | ||
if (Regex.IsMatch(ex.Message, @"\(\d{3}\)")) | ||
{ | ||
result = Regex.Match(ex.Message, @"\(\d{3}\)").Value; | ||
result = result.Substring(1, 3); | ||
} | ||
} | ||
else if (ex.Message == "Unable to connect to the remote server") | ||
{ | ||
result = "Offline"; | ||
} | ||
else | ||
{ | ||
result = "404"; | ||
} | ||
} | ||
|
||
if (pStreamRead != null) | ||
{ | ||
pStreamRead.Close(); | ||
pStreamRead.Dispose(); | ||
} | ||
|
||
if (pWebResponce != null) | ||
{ | ||
pWebResponce.Close(); | ||
pWebResponce.Dispose(); | ||
} | ||
} | ||
|
||
if (result.Contains("error")) | ||
{ | ||
if (!result.StartsWith("<html") && !result.ToLower().StartsWith("<!doctype") && !result.StartsWith("{") && !result.StartsWith("[")) | ||
{ | ||
result = "500"; | ||
} | ||
} | ||
return result; | ||
} | ||
|
||
public static Boolean Get_File(String pFullURL, String pSaveTo) | ||
{ | ||
try | ||
{ | ||
WebClient myWebClient = new WebClient | ||
{ | ||
CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore) | ||
}; | ||
myWebClient.DownloadFile(pFullURL, pSaveTo); | ||
return true; | ||
} | ||
catch (Exception) | ||
{ | ||
return false; | ||
} | ||
} | ||
|
||
public static void OpenURL(String URL) | ||
{ | ||
ProcessStartInfo ps = new ProcessStartInfo(URL) | ||
{ | ||
UseShellExecute = true, | ||
Verb = "open" | ||
}; | ||
Process.Start(ps); | ||
} | ||
|
||
public static void DoAction(Window Form, Action DoAction) | ||
{ | ||
Form.Dispatcher.Invoke(DoAction, DispatcherPriority.Normal); | ||
} | ||
|
||
[DllImport("User32.dll")] | ||
private static extern bool SetCursorPos(int X, int Y); | ||
|
||
public static void MoveCursor(int X, int Y) | ||
{ | ||
SetCursorPos(X, Y); | ||
} | ||
|
||
public static String RemoveStringFromEnd(String Text, String Remove) | ||
{ | ||
if (Text.EndsWith(Remove)) | ||
Text = Text.Substring(0, Text.Length - Remove.Length); | ||
|
||
return Text; | ||
} | ||
|
||
public static String RemoveStringFromStart(String Text, String Remove) | ||
{ | ||
if (Text.StartsWith(Remove)) | ||
Text = Text.Substring(Remove.Length, Text.Length - Remove.Length); | ||
|
||
return Text; | ||
} | ||
|
||
[DllImport("user32.dll")] | ||
private static extern IntPtr GetForegroundWindow(); | ||
|
||
[DllImport("user32.dll")] | ||
private static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count); | ||
|
||
public static string GetActiveWindowTitle() | ||
{ | ||
const int nChars = 256; | ||
StringBuilder Buff = new StringBuilder(nChars); | ||
IntPtr handle = GetForegroundWindow(); | ||
|
||
if (GetWindowText(handle, Buff, nChars) > 0) | ||
{ | ||
return Buff.ToString(); | ||
} | ||
return null; | ||
} | ||
|
||
[DllImport("user32.dll")] | ||
[return: MarshalAs(UnmanagedType.Bool)] | ||
public static extern bool SetForegroundWindow(IntPtr hWnd); | ||
|
||
[DllImport("user32.dll", SetLastError = true)] | ||
public static extern bool BringWindowToTop(IntPtr hWnd); | ||
|
||
[DllImport("user32.dll")] | ||
public static extern IntPtr SetFocus(IntPtr hWnd); | ||
} | ||
|
||
public enum RegistryKey_Type | ||
{ | ||
ClassRoot = 0, | ||
CurrentUser = 1, | ||
LocalMachine = 2, | ||
Users = 3, | ||
CurrentConfig = 4 | ||
} | ||
|
||
public static class Timer_Functions | ||
{ | ||
private static Dictionary<String, Timer> Timers = null; | ||
private static Boolean BeenSetup = false; | ||
|
||
private static void Setup() | ||
{ | ||
if (Timers == null) | ||
{ | ||
Timers = new Dictionary<string, Timer>(); | ||
BeenSetup = true; | ||
} | ||
} | ||
|
||
public static Boolean SetNewInterval(String pTimerID, TimeSpan pInterval) | ||
{ | ||
if (!BeenSetup) | ||
return false; | ||
|
||
Boolean pReturn = false; | ||
|
||
if (Timers.ContainsKey(pTimerID)) | ||
{ | ||
Timer vTimer = Timers[pTimerID]; | ||
vTimer.Interval = pInterval.TotalMilliseconds; | ||
pReturn = true; | ||
} | ||
|
||
return pReturn; | ||
} | ||
|
||
public static Boolean CreateTimer(String pTimerID, TimeSpan pInterval, ElapsedEventHandler pTickHandler, Boolean pRepeat = true) | ||
{ | ||
if (!BeenSetup) | ||
Setup(); | ||
|
||
Boolean pReturn = false; | ||
|
||
if (!Timers.ContainsKey(pTimerID)) | ||
{ | ||
Timer vTimer = new Timer | ||
{ | ||
Interval = pInterval.TotalMilliseconds, | ||
AutoReset = pRepeat, | ||
Enabled = false | ||
}; | ||
|
||
vTimer.Elapsed += pTickHandler; | ||
vTimer.Start(); | ||
|
||
Timers.Add(pTimerID, vTimer); | ||
|
||
pReturn = true; | ||
} | ||
|
||
return pReturn; | ||
} | ||
|
||
public static Boolean StartTimer(String pTimerID) | ||
{ | ||
if (!BeenSetup) | ||
return false; | ||
|
||
Boolean pReturn = false; | ||
|
||
if (Timers.ContainsKey(pTimerID)) | ||
{ | ||
Timer vTimer = Timers[pTimerID]; | ||
vTimer.Enabled = true; | ||
pReturn = true; | ||
} | ||
|
||
return pReturn; | ||
} | ||
|
||
public static Boolean StopTimer(String pTimerID) | ||
{ | ||
if (!BeenSetup) | ||
return false; | ||
|
||
Boolean pReturn = false; | ||
|
||
if (Timers.ContainsKey(pTimerID)) | ||
{ | ||
Timer vTimer = Timers[pTimerID]; | ||
vTimer.Enabled = false; | ||
pReturn = true; | ||
} | ||
|
||
return pReturn; | ||
} | ||
|
||
public static Boolean TimerExists(String pTimerID) | ||
{ | ||
if (!BeenSetup) | ||
return false; | ||
|
||
Boolean pReturn = false; | ||
|
||
if (Timers.ContainsKey(pTimerID)) | ||
pReturn = true; | ||
|
||
return pReturn; | ||
} | ||
|
||
public static void DisposeTimer(String pTimerID) | ||
{ | ||
if (!BeenSetup) | ||
return; | ||
|
||
if (Timers.ContainsKey(pTimerID)) | ||
{ | ||
Timer vTimer = Timers[pTimerID]; | ||
Timers.Remove(pTimerID); | ||
|
||
vTimer.Stop(); | ||
} | ||
} | ||
|
||
public static void DisposeAllTimers() | ||
{ | ||
if (!BeenSetup) | ||
return; | ||
|
||
foreach (KeyValuePair<String, Timer> oTimer in Timers) | ||
{ | ||
oTimer.Value.Stop(); | ||
oTimer.Value.Dispose(); | ||
} | ||
|
||
Timers.Clear(); | ||
} | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
Oculus VR Dash Manager - Copy/Functions/Native Functions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
|
||
namespace OVR_Dash_Manager.Functions | ||
{ | ||
public static class Native_Functions | ||
{ | ||
|
||
private const int SW_HIDE = 0; | ||
private const int SW_SHOWNORMAL = 1; | ||
private const int SW_SHOWMINIMIZED = 2; | ||
private const int SW_SHOWMAXIMIZED = 3; | ||
private const int SW_SHOW = 5; | ||
|
||
[DllImport("User32")] | ||
private static extern int ShowWindow(IntPtr hwnd, int nCmdShow); | ||
|
||
public static void ShowExternalWindow(IntPtr hwnd) | ||
{ | ||
if (hwnd != IntPtr.Zero) | ||
ShowWindow(hwnd, SW_SHOW); | ||
} | ||
|
||
public static void HideExternalWindow(IntPtr hwnd) | ||
{ | ||
if (hwnd != IntPtr.Zero) | ||
ShowWindow(hwnd, SW_HIDE); | ||
} | ||
|
||
public static void MinimizeExternalWindow(IntPtr hwnd) | ||
{ | ||
if (hwnd != IntPtr.Zero) | ||
ShowWindow(hwnd, SW_SHOWMINIMIZED); | ||
} | ||
|
||
[DllImport("user32.dll")] | ||
internal static extern IntPtr GetWindowRect(IntPtr hWnd, ref Rect rect); | ||
|
||
public static String GetWindowText(IntPtr pHandle) | ||
{ | ||
String pReturn = String.Empty; | ||
Int32 pDataLength = GetWindowTextLength(pHandle); | ||
pDataLength++; // Increase 1 for saftey | ||
StringBuilder Buff = new StringBuilder(pDataLength); | ||
|
||
if (GetWindowText(pHandle, Buff, pDataLength) > 0) | ||
pReturn = Buff.ToString(); | ||
|
||
Buff.Clear(); | ||
return pReturn; | ||
} | ||
|
||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] | ||
internal static extern Int32 GetWindowTextLength(IntPtr hWnd); | ||
|
||
[DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static extern Int32 GetWindowText(IntPtr hWnd, StringBuilder lpString, Int32 nMaxCount); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
Oculus VR Dash Manager - Copy/Functions/Process Functions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Security.Principal; | ||
|
||
namespace OVR_Dash_Manager.Functions | ||
{ | ||
public static class Process_Functions | ||
{ | ||
public static Boolean IsCurrentProcess_Elevated() | ||
{ | ||
WindowsIdentity vIdentity = GetWindowsIdentity(); | ||
WindowsPrincipal vPrincipal = GetWindowsPrincipal(vIdentity); | ||
|
||
bool pReturn = vPrincipal.IsInRole(WindowsBuiltInRole.Administrator); | ||
vIdentity.Dispose(); | ||
return pReturn; | ||
} | ||
|
||
private static WindowsIdentity GetWindowsIdentity() | ||
{ | ||
return WindowsIdentity.GetCurrent(); | ||
} | ||
|
||
private static WindowsPrincipal GetWindowsPrincipal(WindowsIdentity pIdentity) | ||
{ | ||
return new WindowsPrincipal(pIdentity); | ||
} | ||
} | ||
} |
163 changes: 163 additions & 0 deletions
163
Oculus VR Dash Manager - Copy/Functions/Process Monitor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Management; | ||
|
||
namespace OVR_Dash_Manager.Functions | ||
{ | ||
public static class Process_Watcher | ||
{ | ||
public delegate void NewProcess(String pProcessName, Int32 pProcessID); | ||
|
||
public static event NewProcess ProcessStarted; | ||
|
||
public delegate void ClosedProcess(String pProcessName, Int32 pProcessID); | ||
|
||
public static event ClosedProcess ProcessExited; | ||
|
||
private static ManagementEventWatcher Process_StartEvent = null; | ||
private static ManagementEventWatcher Process_StopEvent = null; | ||
|
||
private static Boolean Running = false; | ||
private static Boolean _Is_Setup = false; | ||
|
||
private static HashSet<String> IgnoredEXE_Names; | ||
|
||
public static void Setup() | ||
{ | ||
if (_Is_Setup) | ||
return; | ||
|
||
try | ||
{ | ||
_Is_Setup = true; | ||
|
||
if (Process_StartEvent == null) | ||
{ | ||
IgnoredEXE_Names = new HashSet<string>(); | ||
|
||
// Stop Truncated ? known bug .. whyyyyyy | ||
//Process_StartEvent = new ManagementEventWatcher("SELECT * FROM Win32_ProcessStartTrace"); | ||
//Process_StopEvent = new ManagementEventWatcher("SELECT * FROM Win32_ProcessStopTrace"); | ||
|
||
Process_StartEvent = new ManagementEventWatcher("SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_Process'"); | ||
Process_StopEvent = new ManagementEventWatcher("SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_Process'"); | ||
|
||
Process_StartEvent.EventArrived += Process_StartEvent_EventArrived; | ||
Process_StopEvent.EventArrived += Process_StopEvent_EventArrived; | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
Debug.WriteLine(ex.Message); | ||
Debug.WriteLine("Error during creation of ManagementEventWatcher for __InstanceCreationEvent / __InstanceDeletionEvent"); | ||
} | ||
} | ||
|
||
public static void IngoreEXEName(String EXEName) | ||
{ | ||
IgnoredEXE_Names?.Add(EXEName); | ||
} | ||
|
||
public static void Remove_IgnoreEXEName(String EXEName) | ||
{ | ||
IgnoredEXE_Names?.Remove(EXEName); | ||
} | ||
|
||
public static Boolean Start() | ||
{ | ||
Boolean pReturn = false; | ||
|
||
Setup(); | ||
|
||
if (Process_StartEvent != null) | ||
{ | ||
if (!Running) | ||
{ | ||
try | ||
{ | ||
Process_StartEvent.Start(); | ||
Process_StopEvent.Start(); | ||
pReturn = true; | ||
|
||
Running = true; | ||
} | ||
catch (Exception ex) | ||
{ | ||
Debug.WriteLine(ex.Message); | ||
} | ||
} | ||
} | ||
|
||
return pReturn; | ||
} | ||
|
||
public static Boolean Stop() | ||
{ | ||
Boolean pReturn = false; | ||
if (Process_StartEvent != null) | ||
{ | ||
if (Running) | ||
{ | ||
try | ||
{ | ||
Process_StartEvent.Stop(); | ||
Process_StopEvent.Stop(); | ||
pReturn = true; | ||
|
||
Running = false; | ||
} | ||
catch (Exception ex) | ||
{ | ||
Debug.WriteLine(ex.Message); | ||
} | ||
} | ||
} | ||
return pReturn; | ||
} | ||
|
||
public static void Dispose() | ||
{ | ||
if (Process_StartEvent != null) | ||
{ | ||
Stop(); | ||
|
||
IgnoredEXE_Names?.Clear(); | ||
Process_StartEvent.Dispose(); | ||
Process_StopEvent.Dispose(); | ||
|
||
_Is_Setup = false; | ||
} | ||
} | ||
|
||
private static void Process_StartEvent_EventArrived(object sender, EventArrivedEventArgs e) | ||
{ | ||
if (ProcessStarted == null) return; | ||
|
||
//string Name = (string)e.NewEvent.Properties["ProcessName"].Value; | ||
//int ID = Convert.ToInt32(e.NewEvent.Properties["ProcessID"].Value); | ||
|
||
var targetInstance = (ManagementBaseObject)e.NewEvent["TargetInstance"]; | ||
var Name = targetInstance["Name"]?.ToString(); | ||
var ID = Convert.ToInt32(targetInstance["Handle"]?.ToString()); | ||
|
||
if (!IgnoredEXE_Names.Contains(Name)) | ||
ProcessStarted(Name, ID); | ||
} | ||
|
||
private static void Process_StopEvent_EventArrived(object sender, EventArrivedEventArgs e) | ||
{ | ||
if (ProcessExited == null) return; | ||
|
||
//string Name = (string)e.NewEvent.Properties["ProcessName"].Value; | ||
//int ID = Convert.ToInt32(e.NewEvent.Properties["ProcessID"].Value); | ||
|
||
var targetInstance = (ManagementBaseObject)e.NewEvent["TargetInstance"]; | ||
var Name = targetInstance["Name"]?.ToString(); | ||
var ID = Convert.ToInt32(targetInstance["Handle"]?.ToString()); | ||
|
||
if (!IgnoredEXE_Names.Contains(Name)) | ||
ProcessExited(Name, ID); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
using Microsoft.Win32; | ||
using System; | ||
|
||
namespace OVR_Dash_Manager.Functions | ||
{ | ||
public static class Registry_Functions | ||
{ | ||
public static RegistryKey GetRegistryKey(RegistryKey_Type Type, String KeyLocation) | ||
{ | ||
RegistryKey pReturn = null; | ||
|
||
switch (Type) | ||
{ | ||
case RegistryKey_Type.ClassRoot: | ||
pReturn = Registry.ClassesRoot.OpenSubKey(KeyLocation, true); | ||
break; | ||
|
||
case RegistryKey_Type.CurrentUser: | ||
pReturn = Registry.CurrentUser.OpenSubKey(KeyLocation, true); | ||
break; | ||
|
||
case RegistryKey_Type.LocalMachine: | ||
pReturn = Registry.LocalMachine.OpenSubKey(KeyLocation, true); | ||
break; | ||
|
||
case RegistryKey_Type.Users: | ||
pReturn = Registry.Users.OpenSubKey(KeyLocation, true); | ||
break; | ||
|
||
case RegistryKey_Type.CurrentConfig: | ||
pReturn = Registry.CurrentConfig.OpenSubKey(KeyLocation, true); | ||
break; | ||
|
||
default: | ||
break; | ||
} | ||
|
||
return pReturn; | ||
} | ||
|
||
public static Boolean SetKeyValue(RegistryKey Key, String KeyName, String Value) | ||
{ | ||
Boolean pReturn = false; | ||
|
||
if (Key != null) | ||
{ | ||
Boolean pSetValue = false; | ||
|
||
try | ||
{ | ||
string Old_Info = Key.GetValue(KeyName).ToString(); | ||
if (Old_Info != Value) | ||
pSetValue = true; | ||
} | ||
catch (Exception ex) | ||
{ | ||
if (ex.Message == "Object reference not set to an instance of an object.") | ||
pSetValue = true; | ||
} | ||
|
||
if (pSetValue) | ||
{ | ||
Key.SetValue(KeyName, Value); | ||
pReturn = true; | ||
} | ||
} | ||
|
||
return pReturn; | ||
} | ||
|
||
public static String GetKeyValue_String(RegistryKey Key, String KeyName) | ||
{ | ||
String pReturn = null; | ||
|
||
if (Key != null) | ||
{ | ||
try | ||
{ | ||
pReturn = Key.GetValue(KeyName).ToString(); | ||
} | ||
catch (NullReferenceException) | ||
{ | ||
pReturn = null; | ||
} | ||
catch (Exception) | ||
{ | ||
} | ||
} | ||
|
||
return pReturn; | ||
} | ||
|
||
public static String GetKeyValue_String(RegistryKey_Type Type, String KeyLocation, String KeyName) | ||
{ | ||
String pReturn = null; | ||
|
||
RegistryKey Key = Functions.Registry_Functions.GetRegistryKey(RegistryKey_Type.LocalMachine, KeyLocation); | ||
|
||
if (Key != null) | ||
{ | ||
try | ||
{ | ||
pReturn = Key.GetValue(KeyName).ToString(); | ||
} | ||
catch (NullReferenceException) | ||
{ | ||
pReturn = null; | ||
} | ||
catch (Exception) | ||
{ | ||
} | ||
|
||
CloseKey(Key); | ||
} | ||
|
||
return pReturn; | ||
} | ||
|
||
public static void CloseKey(RegistryKey Key) | ||
{ | ||
if (Key != null) | ||
{ | ||
Key.Close(); | ||
Key.Dispose(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,213 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace OVR_Dash_Manager | ||
{ | ||
public class Github | ||
{ | ||
public long GetLatestSize(String Repo, String Project, String AssetName) | ||
{ | ||
long Size = 0; | ||
|
||
String JSON = Functions_Old.GetPageHTML($"https://api.github.com/repos/{Repo}/{Project}/releases/latest"); | ||
if (JSON.Contains("browser_download_url")) | ||
{ | ||
GitResponse Git = JsonConvert.DeserializeObject<GitResponse>(JSON); | ||
if (Git.assets?.Count > 0) | ||
{ | ||
foreach (Asset item in Git.assets) | ||
{ | ||
if (item.name == AssetName) | ||
{ | ||
Size = item.size; | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
|
||
return Size; | ||
} | ||
|
||
public string GetLatestReleaseName(String Repo, String Project) | ||
{ | ||
String Name = ""; | ||
|
||
String JSON = Functions_Old.GetPageHTML($"https://api.github.com/repos/{Repo}/{Project}/releases/latest"); | ||
if (JSON.Contains("browser_download_url")) | ||
{ | ||
GitResponse Git = JsonConvert.DeserializeObject<GitResponse>(JSON); | ||
Name = Git.name; | ||
} | ||
|
||
return Name; | ||
} | ||
|
||
public long Download(String Repo, String Project, String AssetName, String FilePath) | ||
{ | ||
long Size = 0; | ||
|
||
String JSON = Functions_Old.GetPageHTML($"https://api.github.com/repos/{Repo}/{Project}/releases/latest"); | ||
if (JSON.Contains("browser_download_url")) | ||
{ | ||
GitResponse Git = JsonConvert.DeserializeObject<GitResponse>(JSON); | ||
if (Git.assets?.Count > 0) | ||
{ | ||
foreach (Asset item in Git.assets) | ||
{ | ||
if (item.name == AssetName) | ||
{ | ||
Functions_Old.Get_File(item.browser_download_url, FilePath); | ||
} | ||
} | ||
} | ||
} | ||
|
||
return Size; | ||
} | ||
|
||
public GitHub_Reply GetLatestReleaseInfo(String Repo, String Project) | ||
{ | ||
GitHub_Reply Reply = null; | ||
|
||
String JSON = Functions_Old.GetPageHTML($"https://api.github.com/repos/{Repo}/{Project}/releases/latest"); | ||
if (JSON.Contains("browser_download_url")) | ||
{ | ||
GitResponse Git = JsonConvert.DeserializeObject<GitResponse>(JSON); | ||
if (Git.assets?.Count > 0) | ||
{ | ||
Dictionary<String, String> AssetURLs = new Dictionary<string, string>(); | ||
|
||
foreach (Asset item in Git.assets) | ||
{ | ||
if (!AssetURLs.ContainsKey(item.name)) | ||
AssetURLs.Add(item.name, item.browser_download_url); | ||
} | ||
|
||
Reply = new GitHub_Reply(Git.name, Git.html_url, AssetURLs); | ||
} | ||
} | ||
|
||
return Reply; | ||
} | ||
} | ||
|
||
public class GitHub_Reply | ||
{ | ||
public GitHub_Reply(String Release_Version, String Release_URL, Dictionary<String, String> AssetURLs) | ||
{ | ||
_Release_Version = Release_Version; | ||
_Release_URL = Release_URL; | ||
_AssetURLs = AssetURLs; | ||
} | ||
|
||
private string _Release_URL; | ||
|
||
public string Release_URL | ||
{ | ||
get { return _Release_URL; } | ||
private set { _Release_URL = value; } | ||
} | ||
|
||
private string _Release_Version; | ||
|
||
public string Release_Version | ||
{ | ||
get { return _Release_Version; } | ||
private set { _Release_Version = value; } | ||
} | ||
|
||
private Dictionary<String, String> _AssetURLs; | ||
|
||
public Dictionary<String, String> AssetURLs | ||
{ | ||
get { return _AssetURLs; } | ||
private set { _AssetURLs = value; } | ||
} | ||
} | ||
|
||
internal class Asset | ||
{ | ||
public string url { get; set; } | ||
public int id { get; set; } | ||
public string node_id { get; set; } | ||
public string name { get; set; } | ||
public object label { get; set; } | ||
public Uploader uploader { get; set; } | ||
public string content_type { get; set; } | ||
public string state { get; set; } | ||
public long size { get; set; } | ||
public int download_count { get; set; } | ||
public DateTime created_at { get; set; } | ||
public DateTime updated_at { get; set; } | ||
public string browser_download_url { get; set; } | ||
} | ||
|
||
internal class Author | ||
{ | ||
public string login { get; set; } | ||
public int id { get; set; } | ||
public string node_id { get; set; } | ||
public string avatar_url { get; set; } | ||
public string gravatar_id { get; set; } | ||
public string url { get; set; } | ||
public string html_url { get; set; } | ||
public string followers_url { get; set; } | ||
public string following_url { get; set; } | ||
public string gists_url { get; set; } | ||
public string starred_url { get; set; } | ||
public string subscriptions_url { get; set; } | ||
public string organizations_url { get; set; } | ||
public string repos_url { get; set; } | ||
public string events_url { get; set; } | ||
public string received_events_url { get; set; } | ||
public string type { get; set; } | ||
public bool site_admin { get; set; } | ||
} | ||
|
||
internal class GitResponse | ||
{ | ||
public string url { get; set; } | ||
public string assets_url { get; set; } | ||
public string upload_url { get; set; } | ||
public string html_url { get; set; } | ||
public int id { get; set; } | ||
public Author author { get; set; } | ||
public string node_id { get; set; } | ||
public string tag_name { get; set; } | ||
public string target_commitish { get; set; } | ||
public string name { get; set; } | ||
public bool draft { get; set; } | ||
public bool prerelease { get; set; } | ||
public DateTime created_at { get; set; } | ||
public DateTime published_at { get; set; } | ||
public List<Asset> assets { get; set; } | ||
public string tarball_url { get; set; } | ||
public string zipball_url { get; set; } | ||
public string body { get; set; } | ||
public int mentions_count { get; set; } | ||
} | ||
|
||
public class Uploader | ||
{ | ||
public string login { get; set; } | ||
public int id { get; set; } | ||
public string node_id { get; set; } | ||
public string avatar_url { get; set; } | ||
public string gravatar_id { get; set; } | ||
public string url { get; set; } | ||
public string html_url { get; set; } | ||
public string followers_url { get; set; } | ||
public string following_url { get; set; } | ||
public string gists_url { get; set; } | ||
public string starred_url { get; set; } | ||
public string subscriptions_url { get; set; } | ||
public string organizations_url { get; set; } | ||
public string repos_url { get; set; } | ||
public string events_url { get; set; } | ||
public string received_events_url { get; set; } | ||
public string type { get; set; } | ||
public bool site_admin { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Windows.Controls; | ||
|
||
namespace OVR_Dash_Manager | ||
{ | ||
internal class Hover_Button | ||
{ | ||
public bool Enabled { get; set; } = false; | ||
public bool Hovering { get; private set; } = false; | ||
public DateTime Hover_Started { get; private set; } = DateTime.Now; | ||
public Int32 Hovered_Seconds_To_Activate { get; set; } = 5; | ||
public Action Hover_Complete_Action { get; set; } | ||
public ProgressBar Bar { get; set; } | ||
public bool Check_SteamVR { get; set; } | ||
|
||
public void Reset() | ||
{ | ||
Hovering = false; | ||
Hover_Started = DateTime.Now; | ||
Bar.Value = 0; | ||
} | ||
|
||
public void SetHovering() | ||
{ | ||
Hovering = true; | ||
Hover_Started = DateTime.Now; | ||
Bar.Value = 0; | ||
} | ||
|
||
public void StopHovering() | ||
{ | ||
Reset(); | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<Window x:Class="OVR_Dash_Manager.MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Title="Oculus VR Dash Manager" Height="454" Width="657" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded" Closing="Window_Closing" WindowStyle="ToolWindow"> | ||
|
||
<Window.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="Theme/MetroDark.MSControls.Core.Implicit.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Window.Resources> | ||
|
||
<Grid Background="#FF212121"> | ||
<Label x:Name="lbl_Title" Content="Oculus VR Dash Manager - KrisIsBack (AU)" Margin="10,5,10,0" VerticalAlignment="Top" Height="41" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="20" FontWeight="Bold" Cursor="Hand" PreviewMouseDown="lbl_Title_PreviewMouseDown" /> | ||
<Label Content="Current Dash" Margin="10,213,10,0" VerticalAlignment="Top" Height="41" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="20" FontWeight="Bold" /> | ||
<Label x:Name="lbl_CurrentSetting" Content="Unknown" Margin="10,254,10,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="20" Height="45" VerticalAlignment="Top" /> | ||
<GroupBox Header="Dashes" Margin="10,42,10,0" Height="171" VerticalAlignment="Top"> | ||
<Grid x:Name="gd_DashButtons"> | ||
<Button x:Name="btn_Normal" Content="Offical Dash (SteamVR) Hover to activate" HorizontalAlignment="Left" Width="200" Margin="0,0,0,23" Click="btn_ActivateDash_Click" MouseEnter="btn_Normal_MouseEnter" MouseLeave="btn_Normal_MouseLeave" BorderBrush="#FF515151" /> | ||
<ProgressBar x:Name="pb_Normal" HorizontalAlignment="Left" Width="200" Maximum="5000" SmallChange="10" Height="23" VerticalAlignment="Bottom" /> | ||
<Label x:Name="lbl_ItsKaitlyn03" Content="Visit ItsKaitlyn03 (Github)" HorizontalAlignment="Left" Width="200" Height="32" VerticalAlignment="Bottom" FontSize="12" HorizontalContentAlignment="Right" Cursor="Hand" PreviewMouseDown="lbl_ItsKaitlyn03_PreviewMouseDown" VerticalContentAlignment="Bottom" Margin="225,0,0,0" /> | ||
<Button x:Name="btn_SteamVR" Content="ItsKaitlyn03 / OculusKiller (SteamVR Mode Only)" HorizontalAlignment="Left" Width="200" Click="btn_ActivateDash_Click" Margin="225,0,0,23" /> | ||
<Button x:Name="btn_ExitOculusLink" HorizontalAlignment="Right" Width="143" Click="btn_ActivateDash_Click" Margin="0,0,0,23" Content="Exit Link (SteamVR) Hover to activate" MouseEnter="btn_ExitOculusLink_MouseEnter" MouseLeave="btn_ExitOculusLink_MouseLeave" /> | ||
<ProgressBar x:Name="pb_Exit" HorizontalAlignment="Right" Width="143" Maximum="5000" SmallChange="10" Height="23" VerticalAlignment="Bottom" /> | ||
</Grid> | ||
</GroupBox> | ||
<Button x:Name="btn_OpenDashLocation" Content="Open Dash Location" HorizontalAlignment="Left" Margin="284,0,0,10" VerticalAlignment="Bottom" Click="btn_OpenDashLocation_Click" Height="30" Width="190" /> | ||
<Button x:Name="btn_OculusServiceManager" Content="Oculus Service Manager" HorizontalAlignment="Left" Margin="284,0,0,48" VerticalAlignment="Bottom" Click="btn_OculusServiceManager_Click" Height="30" Width="190" /> | ||
<Button x:Name="btn_OpenSettings" Content="Settings" HorizontalAlignment="Left" Margin="10,0,0,48" VerticalAlignment="Bottom" Click="btn_OpenSettings_Click" Height="22" Width="110" /> | ||
<Label x:Name="lbl_TestAccess" Content="Cable Link & Air Link Supported" HorizontalAlignment="Right" Margin="0,39,0,0" FontStyle="Italic" Width="170" HorizontalContentAlignment="Center" PreviewMouseRightButtonDown="lbl_TestAccess_PreviewMouseRightButtonDown" Height="28" VerticalAlignment="Top" FontSize="11" /> | ||
<Button x:Name="btn_Diagnostics" Content="Diagnostics" HorizontalAlignment="Left" Margin="125,0,0,48" VerticalAlignment="Bottom" Click="btn_Diagnostics_Click" Height="30" Width="154" /> | ||
<Button x:Name="btn_CheckForUpdates" Content="Update Checker" HorizontalAlignment="Left" Margin="125,0,0,10" VerticalAlignment="Bottom" Click="btn_CheckForUpdates_Click" Height="30" Width="154" /> | ||
<Button x:Name="btn_Help" Content="Help" HorizontalAlignment="Left" Margin="10,0,0,10" VerticalAlignment="Bottom" Click="btn_Help_Click" Height="30" Width="110" /> | ||
|
||
<UniformGrid Rows="1" Margin="479,0,10,11" Height="30" VerticalAlignment="Bottom"> | ||
<UniformGrid.Resources> | ||
<Style TargetType="RadioButton" BasedOn="{StaticResource {x:Type ToggleButton}}"/> | ||
</UniformGrid.Resources> | ||
<RadioButton x:Name="btn_RunTime_SteamVR" Content="SteamVR" Checked="btn_RunTime_SteamVR_Checked" VerticalContentAlignment="Center" FontSize="13"/> | ||
<RadioButton x:Name="btn_RunTime_Oculus" Content="Oculus" Checked="btn_RunTime_Oculus_Checked" VerticalContentAlignment="Center" FontSize="13" /> | ||
</UniformGrid> | ||
<Label Content="OpenXR Runtime:" HorizontalAlignment="Left" Margin="479,0,0,48" VerticalAlignment="Bottom" Height="30" Width="168" HorizontalContentAlignment="Center"/> | ||
<Button x:Name="btn_OpenSteamVRSettings" Content="SteamVR Settings" HorizontalAlignment="Left" Margin="10,0,0,85" VerticalAlignment="Bottom" Click="btn_OpenSteamVRSettings_Click" Height="22" Width="150" IsEnabled="False" /> | ||
</Grid> | ||
</Window> |
Oops, something went wrong.