Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
})
mainWindow.on('blur', () => {
mainWindow.hide()
mainWindow.webContents.send("clear-input")
})
mainWindow.on('show', () => {
mainWindow.webContents.send("focus-input")
})
setupProtonHotkeys()
})
// C# function
var myFunction = edge.func({
source: function () {/*
using System;
using System.Threading.Tasks;
using System.Collections;
using System.IO;
using System.Collections.Generic;
public class Startup
{
public async Task Invoke(object input)
{
return Helper.getFileNames();
}
}
static class Helper
var isRemoteSession = data.isRemoteSession
stateChangedCallback(isSessionLocked, isRemoteSession)
}
}, function (err, unsubscribe) {
if (err) throw err
unsubscribeCsharpEvent = unsubscribe
})
}
sessionStateDetector.stopTracking = function () {
if (unsubscribeCsharpEvent) {
unsubscribeCsharpEvent()
}
}
var csharpEventSessionSwitch = edge.func(function () { /*
using System;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
class Startup
{
[DllImport("user32.dll")]
static extern int GetSystemMetrics(int smIndex);
public async Task Invoke (dynamic input)
{
var eventHandler = new Microsoft.Win32.SessionSwitchEventHandler((object sender, Microsoft.Win32.SessionSwitchEventArgs e) => {
// Used to detect if the user is logged in through a remote session
bool isRemoteSession = GetSystemMetrics(0x1000) != 0;
((Func>)input.event_handler)(new {
state = e.Reason.ToString(),
methodName: 'GetAppDomainDirectory'
});
var getCurrentTime = edge.func({
assemblyFile: baseDll,
typeName: localTypeName,
methodName: 'GetCurrentTime'
});
var useDynamicInput = edge.func({
assemblyFile: baseDll,
typeName: localTypeName,
methodName: 'UseDynamicInput'
});
var getPerson = edge.func({
assemblyFile: baseDll,
typeName: externalTypeName,
methodName: 'GetPersonInfo'
});
window.onload = function() {
getAppDomainDirectory('', function(error, result) {
if (error) throw error;
document.getElementById("GetAppDomainDirectory").innerHTML = result;
});
getCurrentTime('', function(error, result) {
if (error) throw error;
document.getElementById("GetCurrentTime").innerHTML = result;
if(version === 'core') version = 'coreapp';
const baseNetAppPath = path.join(__dirname, '/src/'+ namespace +'/bin/Debug/net'+ version +'2.0');
process.env.EDGE_USE_CORECLR = 1;
if(version !== 'standard')
process.env.EDGE_APP_ROOT = baseNetAppPath;
var edge = require('electron-edge-js');
var baseDll = path.join(baseNetAppPath, namespace + '.dll');
var localTypeName = namespace + '.LocalMethods';
var externalTypeName = namespace + '.ExternalMethods';
var getAppDomainDirectory = edge.func({
assemblyFile: baseDll,
typeName: localTypeName,
methodName: 'GetAppDomainDirectory'
});
var getCurrentTime = edge.func({
assemblyFile: baseDll,
typeName: localTypeName,
methodName: 'GetCurrentTime'
});
var useDynamicInput = edge.func({
assemblyFile: baseDll,
typeName: localTypeName,
methodName: 'UseDynamicInput'
});
var localTypeName = namespace + '.LocalMethods';
var externalTypeName = namespace + '.ExternalMethods';
var getAppDomainDirectory = edge.func({
assemblyFile: baseDll,
typeName: localTypeName,
methodName: 'GetAppDomainDirectory'
});
var getCurrentTime = edge.func({
assemblyFile: baseDll,
typeName: localTypeName,
methodName: 'GetCurrentTime'
});
var useDynamicInput = edge.func({
assemblyFile: baseDll,
typeName: localTypeName,
methodName: 'UseDynamicInput'
});
var getPerson = edge.func({
assemblyFile: baseDll,
typeName: externalTypeName,
methodName: 'GetPersonInfo'
});
window.onload = function() {
getAppDomainDirectory('', function(error, result) {
if (error) throw error;
process.env.EDGE_APP_ROOT = baseNetAppPath;
var edge = require('electron-edge-js');
var baseDll = path.join(baseNetAppPath, namespace + '.dll');
var localTypeName = namespace + '.LocalMethods';
var externalTypeName = namespace + '.ExternalMethods';
var getAppDomainDirectory = edge.func({
assemblyFile: baseDll,
typeName: localTypeName,
methodName: 'GetAppDomainDirectory'
});
var getCurrentTime = edge.func({
assemblyFile: baseDll,
typeName: localTypeName,
methodName: 'GetCurrentTime'
});
var useDynamicInput = edge.func({
assemblyFile: baseDll,
typeName: localTypeName,
methodName: 'UseDynamicInput'
});
var getPerson = edge.func({
assemblyFile: baseDll,
typeName: externalTypeName,
methodName: 'GetPersonInfo'
});