WorkspaceBrokerAx.SetupWorkspace method
[SetupWorkspace is no longer available for use as of Windows 10 and Windows Server 2016 Technical Preview.]
Invokes the system-implemented new Windows UI that allows the user to enter the email address or URL to use for the RemoteApp and Desktop Connections.
This is an asynchronous method. The OnWorkspaceSetupCompleted event will be fired when the operation is complete or the user cancels the workspace setup.
Syntax
workspaceBrokerAx.setupWorkspace();
Parameters
This method has no parameters.
Return value
This method does not return a value.
Remarks
The following is a representation of the system-implemented new Windows UI RemoteApp and Desktop Connections user interface.
Examples
The following code example, from the RemoteApp and Desktop Connections workspace API sample, shows an example of instantiating and initializing the object, attaching the OnWorkspaceSetupCompleted event, and calling the SetupWorkspace method.
var page = WinJS.UI.Pages.define("/html/subscribe.html", {
ready: function (element, options) {
document.getElementById("subscribe").addEventListener("click", doSubscribe, false);
// Initialize the ActiveX control
try {
wkspActiveX = Microsoft.Sample.WorkspaceBrokerApi.WorkspaceActiveX.createInstance();
} catch (e) {
WinJS.log && WinJS.log("Error setting up the Workspace ActiveX control. Error: " + e.number + " " + e.description, "sample", "error");
return;
}
try {
wkspActiveX.InitializeWorkspaceConfiguration();
} catch (e) {
if (e.number === -2147024894) {
// This is equivalent to 0x80070002 (ERROR_FILE_NOT_FOUND), and is expected if you have never been subscribed to any workspaces on this machine
} else {
WinJS.log && WinJS.log("Error calling InitializeWorkspaceConfiguration: " + e.number + " " + e.description, "sample", "error");
return;
}
}
// Register for workspace subsciption results
wkspActiveX.attachEvent("OnWorkspaceSetupCompleted", onWorkspaceSetupCompletedHandler);
WinJS.log && WinJS.log("Workspace ActiveX control ready", "sample", "status");
}
});
function doSubscribe() {
try {
wkspActiveX.SetupWorkspace();
} catch (e) {
WinJS.log && WinJS.log("Error calling SetupWorkspace: " + e.number + " " + e.description, "sample", "error");
}
}
function onWorkspaceSetupCompletedHandler(statusCode) {
WinJS.log && WinJS.log("Workspace subscription succeeded, or a subscribed workspace was modified. Status code: " + statusCode, "sample", "status");
// This tells you it is now time to update your list of workspaces, workspace folders, and workspace items (see the other scenario in this sample for details)
}
Requirements
Minimum supported client |
Windows 8 [Windows Store apps only] |
Minimum supported server |
Windows Server 2012 [Windows Store apps only] |
End of client support |
Windows 8.1 |
End of server support |
Windows Server 2012 R2 |
IDL |
Wkspbkax.idl |