int AdvancedMathWrapper::Factorial(int x) { return AdvancedMath::Factorial(x); } 4)C#的Form调用CLI的wrapper using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;
namespace CsharpTest { enum Operation { Add, Multiply, Factorial, None } public partial class Form1 : Form { private Operation op = Operation.None;
public Form1() { InitializeComponent(); }
private void radioButtonMultiply_CheckedChanged(object sender, EventArgs e) { op = Operation.Multiply;
textBoxY.Enabled = true; }
private void radioButtonAdd_CheckedChanged(object sender, EventArgs e) { op = Operation.Add;
textBoxY.Enabled = true; }
private void radioButtonFactorial_CheckedChanged(object sender, EventArgs e) { op = Operation.Factorial;