public static IKernelLink Link { get; set; }
Public Shared Property Link As IKernelLink
Get
Set
public:
static property IKernelLink^ Link {
IKernelLink^ get ();
void set (IKernelLink^ value);
}
static member Link : IKernelLink with get, set
Here is an example of how it might be used in a method that wants to return a result to the Wolfram Language manually, instead of having its normal return value sent back.
IKernelLink ml = StdLink.Link;
if (ml != null) {
ml.BeginManual();
// Here we put a result to the Wolfram Language manually:
ml.Put(42);
}
You might want to set this property yourself in a .NET program that launches and controls the kernel (that is, not a program that is itself called from the Wolfram Language, as then the property will be set automatically). One reason to set Link yourself is if you have classes that call the Wolfram Language that you want to use in both a standalone program and scripted from the Wolfram Language. For scripted uses, they need to use the Link property to get the link back to the Wolfram Language. If you set this property to be the link you have created in your standalone program, then your classes will automatically acquire the correct link in both cases. In other words, .NET/Link lets you assign the "StdLink" yourself, so that you don't have to modify all the code that calls StdLink.Link just to use that code in a program that is not being called from the Wolfram Language.