简体   繁体   English

通过DLL使用C#控制台应用程序生成3D表面?

[英]Generate 3D surface with C# console application via DLL?

I already have a 3D surface plot in C# WPF Application and I have all my code in C# console application. 我已经在C#WPF应用程序中拥有3D表面图,并且在C#控制台应用程序中拥有了所有代码。

Is it possible to save the WPF Application as a DLL and use it for my console application, so that when I run my console application, the 3D surface is generated automatically at the end of the program (taking into account the updates in the 3D surface) ? 是否可以将WPF应用程序另存为DLL并将其用于我的控制台应用程序,以便在我运行控制台应用程序时,在程序结束时会自动生成3D曲面(考虑到3D曲面中的更新) )?

If not, any ideas how I can do it? 如果没有,我该怎么办?

Change the compiler/build settings to switch from Windows Application to Class Library and provide a public type/interface to execute the logic in the DLL. 更改编译器/构建设置,以从Windows应用程序切换到类库,并提供公共类型/接口来执行DLL中的逻辑。 Solution | 解决方案 Properties | 属性| Application tab. 应用程序选项卡。

Or you could change the the WPF application by adding a socket, named pipe or other inter process communication mechanism and send information from the console application to the WPF Application. 或者,您可以通过添加套接字,命名管道或其他进程间通信机制来更改WPF应用程序,然后将信息从控制台应用程序发送到WPF应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM