diff --git a/samples/203_x509store.js b/samples/203_x509store.js index 74a6d9bb..c2969db5 100644 --- a/samples/203_x509store.js +++ b/samples/203_x509store.js @@ -2,34 +2,67 @@ var edge = require('../lib/edge'); -var listCertificates = edge.func(function() {/* - #r "System.dll" - - using System.Collections.Generic; - using System.Security.Cryptography.X509Certificates; - - async (dynamic data) => - { - X509Store store = new X509Store( - (string)data.storeName, - (StoreLocation)Enum.Parse(typeof(StoreLocation), (string)data.storeLocation)); - store.Open(OpenFlags.ReadOnly); - try +// var listCertificates = edge.func(function() {/* +// //#r "System.Security.Cryptography" + +// using System.Security.Cryptography; +// using System.Collections.Generic; +// using System.Security.Cryptography.X509Certificates; + +// async (dynamic data) => +// { +// X509Store store = new X509Store( +// (string)data.storeName, +// (StoreLocation)Enum.Parse(typeof(StoreLocation), (string)data.storeLocation)); +// store.Open(OpenFlags.ReadOnly); +// try +// { +// List result = new List(); +// foreach (X509Certificate2 certificate in store.Certificates) +// { +// result.Add(certificate.Subject); +// } + +// return result; +// } +// finally +// { +// store.Close(); +// } +// } +// */}); + +var listCertificates = edge.func({ + source: function() {/* + + using System.Security.Cryptography; + using System.Collections.Generic; + using System.Security.Cryptography.X509Certificates; + + async (dynamic data) => { - List result = new List(); - foreach (X509Certificate2 certificate in store.Certificates) + X509Store store = new X509Store( + (string)data.storeName, + (StoreLocation)Enum.Parse(typeof(StoreLocation), (string)data.storeLocation)); + store.Open(OpenFlags.ReadOnly); + try { - result.Add(certificate.Subject); - } + List result = new List(); + foreach (X509Certificate2 certificate in store.Certificates) + { + result.Add(certificate.Subject); + } - return result; - } - finally - { - store.Close(); + return result; + } + finally + { + store.Close(); + } } - } -*/}); + */}, + references: [ 'System.Security.Cryptography' ] +}); var result = listCertificates({ storeName: 'My', storeLocation: 'LocalMachine' }, true); console.log(result); diff --git a/test/104_csx.js b/test/104_csx.js index 2c3148b8..02ae6a6c 100644 --- a/test/104_csx.js +++ b/test/104_csx.js @@ -199,7 +199,7 @@ describe('edge-cs', function () { var func = edge.func({ source: process.env.EDGE_USE_CORECLR ? function () {/* - //#r "System.Data.Common" + #r "System.Data.Common" using System.Threading.Tasks; using System.Data; @@ -213,7 +213,7 @@ describe('edge-cs', function () { } */} : function () {/* - //#r "System.Data.dll" + #r "System.Data.dll" using System.Threading.Tasks; using System.Data; @@ -277,7 +277,7 @@ describe('edge-cs', function () { var func = edge.func({ source: process.env.EDGE_USE_CORECLR ? function () {/* - //#r "System.Data.Common" + #r "System.Data.Common" async (input) => { @@ -285,7 +285,7 @@ describe('edge-cs', function () { } */} : function () {/* - //#r "System.Data.dll" + #r "System.Data.dll" async (input) => {