LinkLauncher.Context Property
Gets or sets the context string that is formatted and passed as parameters into ShellExecute.
Namespace: Microsoft.WindowsServerSolutions.Common.Controls
Assembly: AdminCommon (in AdminCommon.dll)
Syntax
[BrowsableAttribute(true)]
public string Context { get; set; }
public:
[BrowsableAttribute(true)]
property String^ Context {
String^ get();
void set(String^ value);
}
<BrowsableAttribute(True)>
Public Property Context As String
Property Value
Type: System.String
Remarks
Feature teams who want to pass a context string for use with a third party's composite formatting string should set this property when initializing this control. The return value of a String.Format(link.ArgumentFormatString, this.Context) call is sent to ProcessLauncher.Start as the arguments for the item to launch based on the third-party request.
Here's an example: A third party sets ArgumentFormatString="/computer {0}" in the *.wizlink or *.proplink file for the executable %ProgramFiles%\MyApp\myapp.exe. The add-in wants to pass a computer, so it sets this.Context="mypc.redmond.corp.microsoft.com". ShellExecute now receives the command c:\program files\myapp\myapp.exe /computer mypc.redmond.corp.microsoft.com. The third party must put any escaping needed around their format string if it applies (such as /computer '{0}'), and the feature teams must send properly formatted strings, which might require escaping. (For example, a URL string might need to be declared using the Uri.EscapeUriString method.)
See Also
LinkLauncher Class
Microsoft.WindowsServerSolutions.Common.Controls Namespace
Return to top