This commit is contained in:
Sanchime 2022-05-02 17:10:35 +08:00
parent a8d8488db6
commit b92bffffb1
11 changed files with 97 additions and 10 deletions

View File

@ -0,0 +1,5 @@
namespace {{namespace}};
public class {{name}}
{
}

View File

@ -0,0 +1,3 @@
export class {{name}} {
}

View File

@ -0,0 +1,9 @@
Imports System
Namespace {{namespace}}
Public Class {{name}}
End Class
End Namespace

View File

@ -0,0 +1,3 @@
export default {{name}} {
}

View File

@ -0,0 +1,5 @@
namespace {{namespace}};
public enum {{name}}
{
}

View File

@ -0,0 +1,5 @@
namespace {{namespace}};
public interface {{name}}
{
}

View File

@ -0,0 +1,3 @@
export interface {{name}} {
}

View File

@ -0,0 +1,46 @@
{
"templates": [
{
"name": "Class",
"extension": "cs",
"file": "./class.cs-template",
"parameters": "./template-parameters.js"
},
{
"name": "Interface",
"extension": "cs",
"file": "./interface.cs-template",
"parameters": "./template-parameters.js"
},
{
"name": "Enum",
"extension": "cs",
"file": "./enum.cs-template",
"parameters": "./template-parameters.js"
},
{
"name": "Class",
"extension": "ts",
"file": "./class.ts-template",
"parameters": "./template-parameters.js"
},
{
"name": "Interface",
"extension": "ts",
"file": "./interface.ts-template",
"parameters": "./template-parameters.js"
},
{
"name": "Default",
"extension": "ts",
"file": "./default.ts-template",
"parameters": "./template-parameters.js"
},
{
"name": "Class",
"extension": "vb",
"file": "./class.vb-template",
"parameters": "./template-parameters.js"
}
]
}

View File

@ -0,0 +1,17 @@
var path = require("path");
module.exports = function(filename, projectPath, folderPath) {
var namespace = "Unknown";
if (projectPath) {
namespace = path.basename(projectPath, path.extname(projectPath));
if (folderPath) {
namespace += "." + folderPath.replace(path.dirname(projectPath), "").substring(1).replace(/[\\\/]/g, ".");
}
namespace = namespace.replace(/[\\\-]/g, "_");
}
return {
namespace: namespace,
name: path.basename(filename, path.extname(filename))
}
};

View File

@ -49,14 +49,6 @@ public static class OptionExtension
#region
/// <summary>
/// 幺
/// </summary>
/// <param name="option"></param>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static Option<T> Identity<T>(this Option<T> option) => option;
public static Option<R> Apply<T, R>(this Option<T> option, Func<Option<T>, R> apply, Option<T> value)
=> option.Match(
None: () => Option.None,

View File

@ -1,2 +1 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World of csharp!");