小编Ngo*_*ham的帖子

获取通用抽象类的所有继承类

我正在寻找一些方法来获取所有继承通用抽象类的类,并对每个类执行一个方法.

在实现抽象方法以获得我想要的类实现时,我一直在遵循这个Change参数类型,类似于:

public abstract class AbstractRequest<TResponseData>
                where TResponseData : IResponseData
{
    public abstract void Search();
    public abstract GoodData BindData(TResponseData data);
}

public interface IResponseData
{
}

public class AResponse : IResponseData
{
}

public class BResponse : IResponseData
{
}

public class A : AbstractRequest<AResponse>
{
    public override void Search()
    {
        // get AResponse
        // Call to BindData() with AResponse
    }
    public override GoodData BindData(AResponse data)
    {
        // Bind the data from AResponse to GoodData …
Run Code Online (Sandbox Code Playgroud)

c# inheritance abstract

7
推荐指数
1
解决办法
3699
查看次数

在VSCode中使用目标/参数运行grunt任务

我有VSCode版本1.18.1,这在我的 Gruntfile.js

grunt.registerTask('release', 'Release process', function(target) {
    ...
}
Run Code Online (Sandbox Code Playgroud)

target是我可以运行grunt release:onegrunt release:two.但是,我无法弄清楚如何使VSCode与one|two目标一起运行任务.

这是tasks.json使用自动检测到的Grunt任务创建的文件VSCode.

{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
    {
        "type": "grunt",
        "task": "release",
        "problemMatcher": [],
        "label": "Release Process",
        "group": {
            "kind": "build",
            "isDefault": true
        }
    }
]
}
Run Code Online (Sandbox Code Playgroud)

如果我把文件release:onetask属性tasks.json,VSCode会抱怨类似的东西

Error: The grunt task detection didn't contribute a task for the following configuration:
Run Code Online (Sandbox Code Playgroud)

有人做过类似的事吗?你能指导我怎么做吗? …

gruntjs visual-studio-code

6
推荐指数
1
解决办法
670
查看次数

iTerm2 "Cmd + Click" 打开文件在 Tmux 会话下不起作用

我将 iTerm2 与连接到本地主机 Tmux 服务器的 Tmux 会话一起使用。在普通的 iTerm2 窗口/选项卡上,我可以使用Cmd + Click其默认应用程序打开文件。但是,它在 Tmux 会话中不起作用。iTerm2 始终在默认浏览器中以 URL 形式打开文件,而不是在其默认应用程序中打开文件。

有谁知道解决这个问题?或者我的 Tmux 配置有问题?

macos tmux iterm2

5
推荐指数
1
解决办法
1291
查看次数

标签 统计

abstract ×1

c# ×1

gruntjs ×1

inheritance ×1

iterm2 ×1

macos ×1

tmux ×1

visual-studio-code ×1