KO CSharp Keyword global - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki
ะฃะบัะฐัะฝััะบะฐ ยท ะ ัััะบะธะน ยท English ยท Deutsch ยท Franรงais ยท Italiano ยท Espaรฑol ยท ็น้ซไธญๆ ยท ๆฅๆฌ่ช ยท ํ๊ตญ์ด
C#: global
ํธ๋๋ถ C# ยท ์ค์ฉ ๊ฐ์ด๋
global:: ํ์ ์๋ ๋ฃจํธ ๋ค์์คํ์ด์ค์์ ๊ฒ์์ ์์ํฉ๋๋ค. ์ ์ญ์ ์ฌ์ฉํ๋ฉด ์ด๋ฆ์ ๋ชจ๋ ํ๋ก์ ํธ ํ์ผ๋ก ๊ฐ์ ธ์ต๋๋ค.
๊ฐ๋จํ ์์ (Example.cs)
์ด ์์ ๋ฅผ Example.cs๋ก ๋ฐ๋ก ์ ์ฅํ๊ณ ์ด ํ์ด์ง์ ๋ค๋ฅธ ์์ ์ ๋
๋ฆฝ์ ์ผ๋ก ์คํํ์ธ์.
Example.cs:
// PROJECT-EXAMPLE
global::System.Console.WriteLine("Root namespace");
๊ฒฐ๊ณผ:
Root namespace
ํต์ฌ๋ก
global::System.Console / global using Namespace;
์์ 1: ๊ธฐ๋ณธ ํํ
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
public static class Program
{
public static async Task Main(string[] args)
{
global::System.Console.WriteLine("Root namespace");
}
}
์ 2: ๋ ๋ค๋ฅธ ์ค์ ํ์
global using System;
public static class Program { public static void Main() { Console.WriteLine("Shared import"); } }
๊ณต์ ์ถ์ฒ: Microsoft ํ์ต.