如何创建自定义操作并将其链接到我的 WiX 设置项目?
我有:
我有一个名为“Data”的类,它有“名称”、“日期”和“值”。“日期”属性是日期时间值。
现在我有一个List<Data>名为“DataList”的文件,我在它上面使用 JsonConvert 函数,如下所示:
Newtonsoft.Json.JsonConvert.SerializeObject(DataList)
Run Code Online (Sandbox Code Playgroud)
但现在日期显示为 YYYY-MM-DDTHH-mm-SS。我可以在 JsonConvert 完成之前以某种方式更改此格式吗?
我有一个这样的课:
public class TestClass
{
public int A { get; set; }
public int B { get; set; }
//Other stuff...
public static static int TestFunction(int c, int d)
{
//Other stuff...
return c + d;
}
}
Run Code Online (Sandbox Code Playgroud)
我有很多不同的类,有不同的属性,但总是带有不同内容的"TestFunction"函数(如+/*/:/ - ).
现在我想构建另一个调用此函数的函数,而不知道函数的类型,但我知道"Testfunction"总是在那里.
这是我的尝试:
public static int AnotherFunction<T>(T inClass, int c, int d)
{
//Other stuff...
return inClass.TestFunction(c, d);
}
Run Code Online (Sandbox Code Playgroud)
这些函数仅用于显示目的(不要只是说"直接调用函数,因为它没有做太多").
问题是Visual Studio说"TestFunction"是未知的.
我怎么能不知道上课得到什么呢?