How to use electron-edge-js - 6 common examples

To help you get started, we’ve selected a few electron-edge-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oumad / proton-io / src / index.js View on Github external
})
  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
github Moustachauve / Timesheet-Hero / app / lib / windows / sessionStateDetector.js View on Github external
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(),
github agracio / electron-edge-js-quick-start / renderer.js View on Github external
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;
github agracio / electron-edge-js-quick-start / renderer.js View on Github external
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'
});
github agracio / electron-edge-js-quick-start / renderer.js View on Github external
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;
github agracio / electron-edge-js-quick-start / renderer.js View on Github external
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'
});

electron-edge-js

Edge.js: run .NET and Node.js in-process on Electron

MIT
Latest version published 6 days ago

Package Health Score

78 / 100
Full package analysis

Popular electron-edge-js functions