IT CSharp Directive Load - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
Collegamento delle uscite .csx
La direttiva script carica un altro file .csx. Per un progetto normale, usa Compila o ProjectReference.
Esempio semplice (Example.csx)
Salvare questo esempio separatamente come Example.csx. Eseguirlo indipendentemente dagli altri esempi di questa pagina.
Example.csx:
#load "helper.csx"
UO.Print(Double(4).ToString());
helper.csx:
int Double(int value) => value * 2;
Risultato:
8
Sintassi
#load "helper.csx"
Una funzione ausiliaria separata
#load "helper.csx"
UO.Print(Double(4).ToString());
File helper.csx:
int Double(int value) => value * 2;
File di configurazione
#load "settings.csx"
UO.Print($"{ProfileName}:{Limit}");
File settings.csx:
string ProfileName = "Archer";
int Limit = 3;
Fonte ufficiale: Microsoft Impara.