Function genco::lang::csharp::import

source ·
pub fn import<P, N>(namespace: P, name: N) -> Import
where P: Into<ItemStr>, N: Into<ItemStr>,
Expand description

The import of a C# type using System.IO;.

Examples

use genco::prelude::*;

let a = csharp::import("Foo.Bar", "A");
let b = csharp::import("Foo.Bar", "B");
let ob = csharp::import("Foo.Baz", "B");

let toks: Tokens<Csharp> = quote! {
    $a
    $b
    $ob
};

assert_eq!(
    vec![
        "using Foo.Bar;",
        "",
        "A",
        "B",
        "Foo.Baz.B",
    ],
    toks.to_file_vec()?
);