mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-17 00:31:42 +02:00
Configuration
Core
Data
Plugins
Properties
Resources
Updates
bld
lib
subprocess
Properties
Program.cs
TweetDuck.Browser.csproj
tests
video
.gitattributes
.gitignore
LICENSE.md
Program.cs
README.md
Reporter.cs
TweetDuck.csproj
TweetDuck.sln
TweetDuck.sln.DotSettings
packages.config
39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
using CefSharp;
|
|
using CefSharp.BrowserSubprocess;
|
|
using TweetLib.Communication;
|
|
|
|
namespace TweetDuck.Browser{
|
|
static class Program{
|
|
internal const string Version = "1.2.0.0";
|
|
|
|
private static int Main(string[] args){
|
|
SubProcess.EnableHighDPISupport();
|
|
|
|
const string typePrefix = "--type=";
|
|
string type = Array.Find(args, arg => arg.StartsWith(typePrefix, StringComparison.OrdinalIgnoreCase)).Substring(typePrefix.Length);
|
|
|
|
if (type == "renderer"){
|
|
using(RendererProcess subProcess = new RendererProcess(args)){
|
|
return subProcess.Run();
|
|
}
|
|
}
|
|
else return SubProcess.ExecuteProcess();
|
|
}
|
|
|
|
private sealed class RendererProcess : SubProcess{
|
|
// ReSharper disable once ParameterTypeCanBeEnumerable.Local
|
|
public RendererProcess(string[] args) : base(args){}
|
|
|
|
public override void OnBrowserCreated(CefBrowserWrapper wrapper){
|
|
base.OnBrowserCreated(wrapper);
|
|
|
|
using(Process me = Process.GetCurrentProcess()){
|
|
Comms.BroadcastMessage(Comms.RegisterMessage("TweetDuckSubProcess"), (uint)me.Id, wrapper.BrowserId);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|