Skip to content

Commit

Permalink
Core Update
Browse files Browse the repository at this point in the history
  • Loading branch information
JWLMT88 committed Jul 9, 2023
1 parent c9fa986 commit 24f5203
Show file tree
Hide file tree
Showing 1,571 changed files with 2,599 additions and 250,971 deletions.
55 changes: 55 additions & 0 deletions LABLibary/Assistant/DirectoryIconSetter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;

namespace LABLibary.Assistant
{
public class DirectoryIconSetter
{
[DllImport("shell32.dll", CharSet = CharSet.Unicode)]
private static extern int SHGetSetFolderCustomSettings(ref SHFOLDERCUSTOMSETTINGS pfcs, string pszPath, uint dwReadWrite);

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
private struct SHFOLDERCUSTOMSETTINGS
{
public uint dwSize;
public uint dwMask;
public IntPtr pvid;
public string pszWebViewTemplate;
public uint cchWebViewTemplate;
public string pszWebViewTemplateVersion;
public string pszInfoTip;
public uint cchInfoTip;
public IntPtr pclsid;
public uint dwFlags;
public string pszIconFile;
public uint cchIconFile;
public int iIconIndex;
public string pszLogo;
public uint cchLogo;
}

public static void SetDirectoryIcon(string directoryPath, string iconFilePath, int iconIndex)
{
var settings = new SHFOLDERCUSTOMSETTINGS
{
dwSize = (uint)Marshal.SizeOf(typeof(SHFOLDERCUSTOMSETTINGS)),
dwMask = 0x10,
pszIconFile = iconFilePath,
cchIconFile = (uint)iconFilePath.Length,
iIconIndex = iconIndex,
pszLogo = null,
cchLogo = 0
};

int result = SHGetSetFolderCustomSettings(ref settings, directoryPath, 0x02);
if (result != 0)
{
throw new ApplicationException("Failed to set the directory icon.");
}
}
}

}
Binary file modified LABLibary/bin/Debug/LABLibary.1.0.0.nupkg
Binary file not shown.
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.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
685915e4a739142490e9cc5ac3d939afffc0c313
81e68d054c2716faed6a3b2b02f1c4ebd38277e1
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.
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
@@ -1,9 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------

Expand Down
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/2d227acc39eaa4f88492a68bbc3eba4223da73f3/*"}}
{"documents":{"C:\\Users\\joeva\\Documents\\GitHub\\LILO-LocalServer\\*":"https://raw.githubusercontent.com/JW-Limited/LILO-LocalServer/c9fa9861ede324ee066611c9d9d4f0872993c84b/*"}}
Binary file modified Project/obj/Debug/net6.0-windows/ref/ICSharpCode.TextEditor.dll
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion srvlocal/auto_generator/GenerateLoginHtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public string v1()
sb.Append(" background-color: #3e8e41;");
sb.Append("}");
sb.Append("</style>");
sb.Append("<script>\r\nfunction verifyPassword() {\r\n var username = document.getElementById('username').value;\r\n var password = document.getElementById('password').value;\r\n \r\n // Check if password is correct\r\n if (username === 'admin' && password === 'lilodev420') {\r\n alert('Login successful!');\r\n window.location.href = '/api/home';\r\n } else {\r\n alert('Invalid username or password.');\r\n }\r\n}\r\n</script>");
sb.Append("<script>\r\nfunction verifyPassword() {\r\n var username = document.getElementById('username').value;\r\n var password = document.getElementById('password').value;\r\n \r\n // Check if password is correct\r\n if (username === 'admin' && password === 'lilodev420') {\r\n \r\n window.location.href = '/api/home';\r\n } else {\r\n alert('Invalid username or password.');\r\n }\r\n}\r\n</script>");

sb.Append("</head>");
sb.Append("<body>");
Expand Down
Binary file modified srvlocal/bin/Debug/net7.0-windows/LABLibary.dll
Binary file not shown.
Binary file modified srvlocal/bin/Debug/net7.0-windows/LABLibary.pdb
Binary file not shown.
Binary file modified srvlocal/bin/Debug/net7.0-windows/srvlocal.dll
Binary file not shown.
Binary file modified srvlocal/bin/Debug/net7.0-windows/srvlocal.pdb
Binary file not shown.
Binary file modified srvlocal/bin/Debug/srvlocal.1.0.0.nupkg
Binary file not shown.
Binary file not shown.
Binary file modified srvlocal/obj/Debug/net7.0-windows/srvlocal.dll
Binary file not shown.
Binary file modified srvlocal/obj/Debug/net7.0-windows/srvlocal.pdb
Binary file not shown.
3 changes: 3 additions & 0 deletions srvlocal_gui/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<setting name="lastLoggedInUser" serializeAs="String">
<value>admin</value>
</setting>
<setting name="srvlocal_path" serializeAs="String">
<value>C:\Users\joeva\Documents\GitHub\LILO-LocalServer\srvlocal_gui\bin\Debug\net7.0-windows\srvlocal.exe</value>
</setting>
</srvlocal_gui.LAB.SETTINGS.config>
<srvlocal_gui.DebugSettings>
<setting name="debug" serializeAs="String">
Expand Down
83 changes: 83 additions & 0 deletions srvlocal_gui/AppMananger/AppDomainWorker.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace srvlocal_gui.AppMananger
{
public class Worker
{
public class AppDomainWorker : MarshalByRefObject
{

private static object _lock = new object();
private static AppDomainWorker _instance = null;

public static AppDomainWorker Instance
{
get
{
lock (_lock)
{
if (_instance == null)
{
_instance = new AppDomainWorker();
}

return _instance;
}
}
}

public void PerformWorkInAppDomain(out string domainName)
{
AppDomain newDomain = AppDomain.CurrentDomain;
try
{

var worker = (AppDomainWorker)newDomain.CreateInstanceAndUnwrap(
typeof(AppDomainWorker).Assembly.FullName,
typeof(AppDomainWorker).FullName);

worker.DoWork(newDomain);

domainName = newDomain.BaseDirectory;
}
catch (Exception ex)
{
domainName = ex.Message;
}
}

public void DoWork(AppDomain appdomain)
{
try
{
Logger.Instance.Log("[SECOND DOMAIN] - Created a SubAppDomain...");

var process = new Process();
process.StartInfo.FileName = ".\\server.exe";
process.StartInfo.UseShellExecute = true;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.StartInfo.Domain = appdomain.FriendlyName;
process.EnableRaisingEvents = true;

Logger.Instance.Log("[SECOND DOMAIN] - Try to start Messaging Service...");

process.Start();

}
catch (Exception ex)
{
Logger.Instance.Log("[SECOND DOMAIN] - An exception occurred in the AppDomain: " + ex.Message);
}
}

}
}

}
2 changes: 1 addition & 1 deletion srvlocal_gui/AppMananger/SettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static SettingsManager Instance
}
}

private const string SettingsFileName = "settings.json";
private const string SettingsFileName = "C:\\LILO\\host\\settings.json";

private Settings _settings;

Expand Down
14 changes: 14 additions & 0 deletions srvlocal_gui/AppMananger/UpdatingModes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace srvlocal_gui.AppMananger
{
public enum UpdateMode
{
Manual = 1,
Automatic = 0
}
}
7 changes: 5 additions & 2 deletions srvlocal_gui/FileViewForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 27 additions & 1 deletion srvlocal_gui/FileViewForm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using ReactiveUI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
Expand All @@ -15,6 +16,8 @@ public partial class FileViewForm : Form
private static FileViewForm _instance;
private static object _instanceLock = new object();
private string? sourceURL;
private string changedSource;
private bool Success = false;

public static FileViewForm Instance(string source)
{
Expand Down Expand Up @@ -62,5 +65,28 @@ private void guna2Button1_Click(object sender, EventArgs e)
settings.IsWebMessageEnabled = false;
settings.IsZoomControlEnabled = false;
}

private void FileView_NavigationStarting(object sender, Microsoft.Web.WebView2.Core.CoreWebView2NavigationStartingEventArgs e)
{
changedSource = e.Uri;
}

private void FileView_NavigationCompleted(object sender, Microsoft.Web.WebView2.Core.CoreWebView2NavigationCompletedEventArgs e)
{
if (e.IsSuccess)
{
if (changedSource.EndsWith("api/home"))
{
Success = true;
Form1.Instance.APILoginHandler(true);
}
}
}

private void FileViewForm_FormClosing(object sender, FormClosingEventArgs e)
{
Form1.Instance.APILoginHandler_Closing(Success);
_instance = null;
}
}
}
Loading

0 comments on commit 24f5203

Please sign in to comment.