Code Monkey home page Code Monkey logo

csns---cs-not-source's Introduction

CSNS - CS Not Source

Walkthrough

First Steps

Add references in the main project to CSNS csproj.

Implementations

Set a string "path" with the path where your files will stay, or the file itself to be loaded, then we can call the below static methods:

var assembly = await CSNSMemory.LoadAssemblyAsync(path, "MyAssembly");

to load an path or a file and return the assembly at the same time we will store the result assembly in a "ram" schema to be available in another time.

var assembly = CSNSMemory.GetAssembly("MyAssembly");

with the next operations, we can load an static method from assembly who be loaded from the script folder (or the itself file)

var Soma = CSNSStaticLoader.LoadMethod(assembly, "Matematica.Mate.Soma");

then we execute the loaded method by calling the delegated loaded above

var result = Soma(2, 3);
Console.WriteLine($"Static method Soma result: {result.ToString()}");

So if we want to load and construct a class defined in the CS Scripts? Lets do this

var classe = CSNSStaticLoader.InstanceClass(assembly, "Matematica.Matema", new object[] { 2 });
var resultado = classe.Soma(4);
Console.WriteLine($"Method Soma from instanciated class result: {resultado.ToString()}");
await classe.SubtractAsync();

So we instantiate an object based on a class written in scripts folder, and manipulate the object using the own methods defined before.

We can insert a static void Task() method inside a class, so we can execute automation scripts after load the file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.