Skip to content

Commit

Permalink
Uploaded Source Code
Browse files Browse the repository at this point in the history
  • Loading branch information
SLT-World committed Mar 13, 2022
1 parent d642cc5 commit cca1663
Show file tree
Hide file tree
Showing 58 changed files with 7,864 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SLBr/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.cs]

# CS0618: Type or member is obsolete
dotnet_diagnostic.CS0618.severity = silent
45 changes: 45 additions & 0 deletions SLBr/SLBr.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30907.101
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{497AA70B-948C-485D-9BDC-D4079761233F}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLBr", "SLBr\SLBr.csproj", "{7816736D-3C43-4D68-9A4D-9F0825372E97}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Debug|x64.ActiveCfg = Debug|x64
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Debug|x64.Build.0 = Debug|x64
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Debug|x86.ActiveCfg = Debug|Win32
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Debug|x86.Build.0 = Debug|Win32
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Release|Any CPU.Build.0 = Release|Any CPU
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Release|x64.ActiveCfg = Release|x64
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Release|x64.Build.0 = Release|x64
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Release|x86.ActiveCfg = Release|Win32
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{7816736D-3C43-4D68-9A4D-9F0825372E97} = {497AA70B-948C-485D-9BDC-D4079761233F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7AEF2092-FFC4-4819-97A3-CC8862806680}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions SLBr/SLBr/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
9 changes: 9 additions & 0 deletions SLBr/SLBr/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="SLBr.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SLBr"
StartupUri="MainWindow.xaml" Startup="Application_Startup">
<Application.Resources>

</Application.Resources>
</Application>
117 changes: 117 additions & 0 deletions SLBr/SLBr/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
// Copyright © 2022 SLT World. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Shell;

namespace SLBr
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
/*[DllImport("user32.dll")]
private static extern bool ShowWindow(IntPtr hWnd, int cmdShow);
private const int SW_MAXIMIZE = 3;
private const int SW_SHOWNORMAL = 1;*/

//private static Mutex SingleInstanceMutex;

private void Application_Startup(object sender, StartupEventArgs e)
{
/*if (e.Args.Count() > 0)
{
MessageBox.Show("You have the latest version.");
Shutdown();
}*/

JumpTask OpenTask = new JumpTask
{
Title = "Open",
Arguments = "",
//Description = "Open SLBr",
CustomCategory = "Actions",
ApplicationPath = Assembly.GetExecutingAssembly().Location,
IconResourcePath = Assembly.GetExecutingAssembly().Location
};
JumpTask PrivateOpenTask = new JumpTask
{
Title = "Open in private mode",
Arguments = "Private",
//Description = "No browsing history will be saved, in memory cache will be used (Incognito)",
CustomCategory = "Actions",
ApplicationPath = Assembly.GetExecutingAssembly().Location,
IconResourcePath = Assembly.GetExecutingAssembly().Location
};
JumpTask DeveloperOpenTask = new JumpTask
{
Title = "Open in developer mode",
Arguments = "Developer",
//Description = "Access to developer features of SLBr and bypass the i5 processor check",
CustomCategory = "Actions",
ApplicationPath = Assembly.GetExecutingAssembly().Location,
IconResourcePath = Assembly.GetExecutingAssembly().Location
};
JumpTask ChromiumOpenTask = new JumpTask
{
Title = "Open in chromium mode",
Arguments = "Chromium",
//Description = "Access to developer features of SLBr and bypass the i5 processor check",
CustomCategory = "Actions",
ApplicationPath = Assembly.GetExecutingAssembly().Location,
IconResourcePath = Assembly.GetExecutingAssembly().Location
};
JumpTask IEOpenTask = new JumpTask
{
Title = "Open in Internet Explorer mode",
Arguments = "IE",
//Description = "Access to developer features of SLBr and bypass the i5 processor check",
CustomCategory = "Actions",
ApplicationPath = Assembly.GetExecutingAssembly().Location,
IconResourcePath = Assembly.GetExecutingAssembly().Location
};

JumpList jumpList = new JumpList();
jumpList.JumpItems.Add(OpenTask);
jumpList.JumpItems.Add(PrivateOpenTask);
jumpList.JumpItems.Add(DeveloperOpenTask);
jumpList.JumpItems.Add(ChromiumOpenTask);
jumpList.JumpItems.Add(IEOpenTask);
jumpList.ShowFrequentCategory = false;
jumpList.ShowRecentCategory = false;

JumpList.SetJumpList(Current, jumpList);


Process _Process = Process.GetCurrentProcess();
List<Process> Processes = Process.GetProcesses().Where(p =>
p.ProcessName == _Process.ProcessName && !_Process.HasExited).ToList();

int count = Processes.Count();

if (count > 1)
{
//ShowWindow(Processes[0].MainWindowHandle, SW_MAXIMIZE);
MessageBox.Show("An instance is already running... Relaunch the application if you think something is wrong.");//BUG, Relaunching in SLBr shows this message
Current.Shutdown();
}
/*bool IsNewInstance = false;
SingleInstanceMutex = new Mutex(true, "SLBrSLTBrowser", out IsNewInstance);
if (!IsNewInstance)
{
MessageBox.Show("Already an instance is running...");
Current.Shutdown();
}*/
}
}
}
16 changes: 16 additions & 0 deletions SLBr/SLBr/Favourite.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright © 2022 SLT World. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SLBr
{
public class Favourite
{
public string Name { get; set; }
public string Arguments { get; set; }
}
}
Loading

0 comments on commit cca1663

Please sign in to comment.