Skip to content

Commit

Permalink
Imporved Code
Browse files Browse the repository at this point in the history
  • Loading branch information
JWLMT88 committed May 6, 2023
1 parent a1d9325 commit 915b076
Show file tree
Hide file tree
Showing 418 changed files with 2,170 additions and 382,869 deletions.
Binary file modified Client/bin/Debug/Client.exe
Binary file not shown.
Binary file modified Client/bin/Debug/Client.pdb
Binary file not shown.
Binary file modified Client/obj/Debug/Client.csproj.AssemblyReference.cache
Binary file not shown.
Binary file modified Client/obj/Debug/Client.exe
Binary file not shown.
Binary file modified Client/obj/Debug/Client.pdb
Binary file not shown.
33 changes: 33 additions & 0 deletions LABLibary/Assistant/ProductRegistration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LABLibary.Assistant
{
public class ProductRegistration
{
public static void RegisterProduct(string productName, string productVersion, string productLocation)
{
using (RegistryKey key = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + productName))
{
key.SetValue("DisplayName", productName);
key.SetValue("DisplayVersion", productVersion);
key.SetValue("Publisher", "Your company name here");
key.SetValue("InstallLocation", Path.GetDirectoryName(productLocation));
key.SetValue("UninstallString", "\"" + productLocation + "\" /uninstall");
key.SetValue("QuietUninstallString", "\"" + productLocation + "\" /uninstall /quiet");
key.SetValue("SystemComponent", 0);
key.SetValue("EstimatedSize", new FileInfo(productLocation).Length / 1024);

string iconLocation = productLocation + ",0";
if (File.Exists(iconLocation))
{
key.SetValue("DisplayIcon", iconLocation);
}
}
}
}
}
59 changes: 59 additions & 0 deletions LABLibary/Assistant/SafeDelete.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LABLibary.Assistant
{
public class SafeDelete
{
public static void SafeDeleteFile(string filePath, Action<int> progressCallback = null, Action<string> errorCallback = null)
{
try
{
if (!File.Exists(filePath))
{
errorCallback?.Invoke($"File not found: {filePath}");
return;
}

long fileSize = new FileInfo(filePath).Length;
long bytesDeleted = 0;

using (FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Write))
{
byte[] buffer = new byte[1024];
Random rand = new Random();

while (stream.Position < fileSize)
{
rand.NextBytes(buffer);
stream.Write(buffer, 0, buffer.Length);
bytesDeleted += buffer.Length;

int progressPercentage = (int)((float)bytesDeleted / (float)fileSize * 100);
progressCallback?.Invoke(progressPercentage);
}
}


File.Delete(filePath);

if (File.Exists(filePath))
{
errorCallback?.Invoke($"Failed to delete File: {filePath}");
return;
}

progressCallback?.Invoke(100);
}
catch (Exception ex)
{
errorCallback?.Invoke($"Failed to delete File: {ex.Message}");
}
}


}
}
28 changes: 28 additions & 0 deletions LABLibary/Assistant/ShortcutCreator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using IWshRuntimeLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LABLibary.Assistant
{
public class ShortcutCreator
{
public static void CreateShortcut(string shortcutName, string targetFile)
{
string shortcutPath = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) + "\\" + shortcutName + ".lnk";

IWshShell wshShell = new WshShell();
IWshShortcut shortcut = (IWshShortcut)wshShell.CreateShortcut(shortcutPath);

shortcut.TargetPath = targetFile;
shortcut.WorkingDirectory = Path.GetDirectoryName(targetFile);
shortcut.WindowStyle = 1; // Normal window
shortcut.Description = "Shortcut created using C#"; // Optional
shortcut.IconLocation = targetFile + ",0"; // Optional

shortcut.Save();
}
}
}
35 changes: 19 additions & 16 deletions LABLibary/DesktopApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ namespace LABLibary.Connect
{
public class DesktopApi
{
private MessageQueue queue;
private MessageQueue queue = new MessageQueue(".\\private$\\Commands");
private Message test;
public string ApiKey;
public static string ApiKey;
private static DesktopApi _instance;
public static readonly object _lock = new object();

public static string Use(string message)
public static string Use(string message, string apikey = "liloDev420")
{
try
{
var api = new DesktopApi("liloDev420");
var api = new DesktopApi();
ApiKey = apikey;
api.Start();

var queue = new MessageQueue(".\\private$\\Chat");
Expand All @@ -34,19 +37,18 @@ public static string Use(string message)

}

public DesktopApi(string apikey)
private DesktopApi() {}
public static DesktopApi Instance()
{
try
lock (_lock)
{
queue = new MessageQueue(".\\private$\\Commands");
this.ApiKey = apikey;
queue.Authenticate = true;
if (_instance == null)
{
_instance = new DesktopApi();
}
}
catch (Exception ex)
{

}

return _instance;
}

public void Start()
Expand All @@ -57,7 +59,7 @@ public void Start()

public void RecevMessage()
{
/*

while (true)
{
try
Expand All @@ -66,10 +68,11 @@ public void RecevMessage()
{
Message message = queue.Receive();
message = message == null ? null : message;
System.Windows.Forms.MessageBox.Show(message.Body.ToString());
}
}
catch { }
}*/
catch(Exception ex) { System.Console.WriteLine(ex.Message); }
}

}

Expand Down
3 changes: 3 additions & 0 deletions LABLibary/LABLibary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
</ItemGroup>

<ItemGroup>
<Reference Include="Interop.IWshRuntimeLibrary">
<HintPath>..\srvlocal_gui\obj\Debug\net7.0-windows\Interop.IWshRuntimeLibrary.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Windows.Forms.dll</HintPath>
</Reference>
Expand Down
Binary file modified LABLibary/bin/Debug/LABLibary.1.0.0.nupkg
Binary file not shown.
Binary file not shown.
14 changes: 14 additions & 0 deletions LABLibary/bin/Debug/net7.0/LABLibary.deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"Newtonsoft.Json": "13.0.2",
"System.Configuration.ConfigurationManager": "8.0.0-preview.3.23174.8",
"System.Drawing.Common": "6.0.0",
"Interop.IWshRuntimeLibrary": "1.0.0.0",
"System.Windows.Forms": "4.0.0.0"
},
"runtime": {
Expand Down Expand Up @@ -117,6 +118,14 @@
}
}
},
"Interop.IWshRuntimeLibrary/1.0.0.0": {
"runtime": {
"Interop.IWshRuntimeLibrary.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
}
},
"System.Windows.Forms/4.0.0.0": {
"runtime": {
"System.Windows.Forms.dll": {
Expand Down Expand Up @@ -206,6 +215,11 @@
"path": "system.security.cryptography.protecteddata/8.0.0-preview.3.23174.8",
"hashPath": "system.security.cryptography.protecteddata.8.0.0-preview.3.23174.8.nupkg.sha512"
},
"Interop.IWshRuntimeLibrary/1.0.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"System.Windows.Forms/4.0.0.0": {
"type": "reference",
"serviceable": false,
Expand Down
Binary file modified LABLibary/bin/Debug/net7.0/LABLibary.dll
Binary file not shown.
Binary file modified LABLibary/bin/Debug/net7.0/LABLibary.pdb
Binary file not shown.
Binary file modified LABLibary/obj/Debug/net7.0/LABLibary.assets.cache
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ddff964fa4fdf5de7e5802fc0afb07ac031564bf
72c0e94d43073bdceb517e9980fb176894561dda
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ C:\Users\joeva\Documents\GitHub\LILO-LocalServer\LABLibary\obj\Debug\net7.0\refi
C:\Users\joeva\Documents\GitHub\LILO-LocalServer\LABLibary\obj\Debug\net7.0\LABLibary.pdb
C:\Users\joeva\Documents\GitHub\LILO-LocalServer\LABLibary\obj\Debug\net7.0\ref\LABLibary.dll
C:\Users\joeva\Documents\GitHub\LILO-LocalServer\LABLibary\bin\Debug\net7.0\LABLibary.dll.config
C:\Users\joeva\Documents\GitHub\LILO-LocalServer\LABLibary\bin\Debug\net7.0\Interop.IWshRuntimeLibrary.dll
Binary file modified LABLibary/obj/Debug/net7.0/LABLibary.dll
Binary file not shown.
Binary file modified LABLibary/obj/Debug/net7.0/LABLibary.pdb
Binary file not shown.
Binary file modified LABLibary/obj/Debug/net7.0/ref/LABLibary.dll
Binary file not shown.
Binary file modified LABLibary/obj/Debug/net7.0/refint/LABLibary.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions LABLibary/obj/LABLibary.csproj.nuget.dgspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
"outputPath": "C:\\Users\\joeva\\Documents\\GitHub\\LILO-LocalServer\\LABLibary\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Users\\joeva\\AppData\\Roaming\\Godot\\mono\\GodotNuGetFallbackFolder",
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\joeva\\Documents\\GitHub\\LILO-LocalServer\\srvlocal\\NuGet.Config",
"C:\\Users\\joeva\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Users\\joeva\\AppData\\Roaming\\NuGet\\config\\Godot.Offline.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
Expand All @@ -27,7 +28,6 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files (x86)\\Progress\\Telerik UI for WinForms R1 2023\\Bin70\\NuGet": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
Expand Down
3 changes: 2 additions & 1 deletion LABLibary/obj/LABLibary.csproj.nuget.g.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\joeva\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\joeva\.nuget\packages\;C:\Users\joeva\AppData\Roaming\Godot\mono\GodotNuGetFallbackFolder;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.6.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\joeva\.nuget\packages\" />
<SourceRoot Include="C:\Users\joeva\AppData\Roaming\Godot\mono\GodotNuGetFallbackFolder\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
</Project>
5 changes: 3 additions & 2 deletions LABLibary/obj/project.assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@
},
"packageFolders": {
"C:\\Users\\joeva\\.nuget\\packages\\": {},
"C:\\Users\\joeva\\AppData\\Roaming\\Godot\\mono\\GodotNuGetFallbackFolder": {},
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
},
"project": {
Expand All @@ -382,11 +383,12 @@
"outputPath": "C:\\Users\\joeva\\Documents\\GitHub\\LILO-LocalServer\\LABLibary\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Users\\joeva\\AppData\\Roaming\\Godot\\mono\\GodotNuGetFallbackFolder",
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\joeva\\Documents\\GitHub\\LILO-LocalServer\\srvlocal\\NuGet.Config",
"C:\\Users\\joeva\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Users\\joeva\\AppData\\Roaming\\NuGet\\config\\Godot.Offline.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
Expand All @@ -395,7 +397,6 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files (x86)\\Progress\\Telerik UI for WinForms R1 2023\\Bin70\\NuGet": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
Expand Down
2 changes: 1 addition & 1 deletion LABLibary/obj/project.nuget.cache
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "vcaVRFcxRsSJLS3T0QcAtrHvmIv7zbgbH+7qnV1L940ERYlqY0mKEHphboRLPj2MQsMr4AVgdSd5i/K4EX51jQ==",
"dgSpecHash": "t6OFauxNpPDAfiYj2jQR5OcrqzkpSpvxzNpmVUJPKj6dOqDZEmGMMEBskb4O0cQeRvHBpZqoTdO1S/dkhHflVA==",
"success": true,
"projectFilePath": "C:\\Users\\joeva\\Documents\\GitHub\\LILO-LocalServer\\LABLibary\\LABLibary.csproj",
"expectedPackageFiles": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public class GapTextBufferStrategy : ITextBufferStrategy

void CheckThread()
{
if (System.Threading.Thread.CurrentThread.ManagedThreadId != creatorThread)
throw new InvalidOperationException("GapTextBufferStategy is not thread-safe!");
//if (System.Threading.Thread.CurrentThread.ManagedThreadId != creatorThread)
//throw new InvalidOperationException("GapTextBufferStategy is not thread-safe!");
}
#endif

Expand Down
Binary file modified Project/bin/Debug/net6.0-windows/ICSharpCode.TextEditor.dll
Binary file not shown.
Binary file modified Project/bin/Debug/net6.0-windows/ICSharpCode.TextEditor.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Stef Heyenrath, SharpDevelop, Qwertie and MysticBoy 2014-2022")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.2.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.2.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.2.0+a1d932530eb865da9d93a6a132e1769f1d48c8f8")]
[assembly: System.Reflection.AssemblyProductAttribute("ICSharpCode.TextEditor")]
[assembly: System.Reflection.AssemblyTitleAttribute("ICSharpCode.TextEditor")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.2.0.0")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
74cb95763fd3724fad3ec42d66daf25d36709278
40defa38826414244f4df0337e97e78aa4454e02
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Project/obj/Debug/net6.0-windows/ICSharpCode.TextEditor.dll
Binary file not shown.
Binary file modified Project/obj/Debug/net6.0-windows/ICSharpCode.TextEditor.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documents":{"C:\\Users\\joeva\\Documents\\GitHub\\LILO-LocalServer\\*":"https://raw.githubusercontent.com/JW-Limited/LILO-LocalServer/cf146f203283bc8a3a233ed95eaba240f9af71c8/*"}}
{"documents":{"C:\\Users\\joeva\\Documents\\GitHub\\LILO-LocalServer\\*":"https://raw.githubusercontent.com/JW-Limited/LILO-LocalServer/a1d932530eb865da9d93a6a132e1769f1d48c8f8/*"}}
Binary file modified Project/obj/Debug/net6.0-windows/ref/ICSharpCode.TextEditor.dll
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions Project/obj/ICSharpCode.TextEditor.csproj.nuget.dgspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
"projectStyle": "PackageReference",
"crossTargeting": true,
"fallbackFolders": [
"C:\\Users\\joeva\\AppData\\Roaming\\Godot\\mono\\GodotNuGetFallbackFolder",
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\joeva\\Documents\\GitHub\\LILO-LocalServer\\srvlocal\\NuGet.Config",
"C:\\Users\\joeva\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Users\\joeva\\AppData\\Roaming\\NuGet\\config\\Godot.Offline.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
Expand All @@ -28,7 +29,6 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files (x86)\\Progress\\Telerik UI for WinForms R1 2023\\Bin70\\NuGet": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
Expand Down
3 changes: 2 additions & 1 deletion Project/obj/ICSharpCode.TextEditor.csproj.nuget.g.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\joeva\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\joeva\.nuget\packages\;C:\Users\joeva\AppData\Roaming\Godot\mono\GodotNuGetFallbackFolder;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.6.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\joeva\.nuget\packages\" />
<SourceRoot Include="C:\Users\joeva\AppData\Roaming\Godot\mono\GodotNuGetFallbackFolder\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
<ImportGroup Condition=" '$(TargetFramework)' == '' AND '$(ExcludeRestorePackageImports)' != 'true' ">
Expand Down
Loading

0 comments on commit 915b076

Please sign in to comment.