Export (0) Print
Expand All

Resource Sharing in Lync

[This is preliminary documentation and is subject to change.]

This topic introduces the resource sharing features of the Microsoft Lync 2013 Preview API.

The Microsoft Lync 2013 Preview SDK lets you start system resource sharing and manage user control of a shared resource on the sharing stage of a Microsoft Lync 2013 Preview conversation window. The only way for a user to see shared resources in a conversation is to open a Lync 2013 Preview conversation window on the desktop. The Lync 2013 Preview API does not provide a control that you can drop into your application UI. However, you can use the API to build programmatic control over the sharing stage of the conversation window.

The Microsoft.Lync.Model.Conversation.Sharing namespace contains the classes and enumerations that you use in resource sharing. Figure 1 shows a running process shared on the Lync 2013 Preview sharing stage and visible to all conversation participants.

Caution note Caution

A shared resource is visible on the sharing stage for all conversation participants to view. A user must be aware that sensitive information can be seen by other participants when a resource such as a desktop, running process, or display is shared. When another user is granted control of a locally shared resource, the controlling user has the same access to the content within the resource that the owner does.

Figure 1. Lync client sharing stage with running process

Lync Client sharing stage with shared process

In general, you program by using the following kinds of Lync 2013 Preview API objects:

  • Shareable resource objects such as a running process or desktop.

  • Sharing conversation modality objects

  • Conversation participant objects.

Each of these objects expose methods, events and properties that you use to manage the resource sharing process. Most of the code that you write for resource sharing handles events on the sharing modalities.

Important note Important

The Lync 2013 Preview API does not support resource sharing when Lync 2013 Preview is running in UI suppression mode.

A shareable resource can be the local desktop, any display attached to the local workstation, or a running process such as Notepad.exe. Although a computer may have any number of shareable resources, only one of these resources can be shared in a conversation at a time. In addition, only one conversation participant can share a resource at a time. A shared resource that is under the control of the resource owner is not considered controlled. It is only when the control of the resource is given to another user that the resource is considered controlled. The shared conversation resource can be controlled by one user at a time. Resource control amounts to giving the controlling user access to the local mouse and keyboard in the context of the shared resource. For example, if a running process has a UI with a Close button, the controlling user can click the button with the controlled mouse and close the process.

Tip Tip

A resource sharer is a conversation presenter who is sharing a local resource with other conversation participants. A resource viewer is a presenter or attender who is viewing a resource shared by a different conversation participant.

Maintaining a list of locally shareable resources

A locally shareable collection of resources includes the desktop, monitors, and any UI-based processes that are running when a conversation is started and the conversation application sharing modality is connected. You are not notified when new processes are started after the application sharing modality is connected. To refresh a shareable resource list, you must read the ApplicationSharingModality.ShareableResources property.

When a resource control action is available, the methods that you invoke to take an available action are exposed on the Microsoft.Lync.Model.Conversation.Sharing.ApplicationSharingModality object. The conversation and each conversation participant own an application sharing modality. There are restrictions on which actions that you can invoke on a given application sharing modality. Similarly, application sharing modality events are exposed on the conversation and participant application sharing modalities but not all modality events are raised on all of these modalities. In addition, not all application sharing modality operations are valid for all of the application sharing modality objects in a conversation.
This section tells you which modality events you should register for on which application sharing modality objects in the conversation and which operations are valid for each application sharing modality object.

This modality event handling code is invoked for the following kinds of modality state changes:

  • The availability of a resource control action is changed.

  • The user who controls a shared resource is changed.

  • A user is requesting control of a resource that is shared locally.

  • The locally shared resource is swapped for a different local shareable resource or a local resource is no longer shared.

  • The sharing modality connection state changes as a conversation starts or ends.

  • The local user shares, grants, or revokes control of a locally shared resource.

Application sharing modality methods

The following tables show all of the methods that can be called on the Microsoft.Lync.Model.Conversation.Sharing.ApplicationSharingModality object. The first table shows methods that start resource sharing. The second and third tables show methods that are related to controlling a shared resource.

Tip Tip

Pay attention to the third column of the following tables. You must invoke the methods on the correct Microsoft.Lync.Model.Conversation.Sharing.ApplicationSharingModality object.

The methods in the following table let you share resources. Control of locally shared resources can be managed by using the control-related application sharing methods.

Sharing initiation methods

Method

Purpose

Valid for which modality?

ApplicationSharingModality.BeginShareDesktop

Shares the user’s desktop and replaces the currently shared resource on the shared content stage regardless of the intent of the owner of the current resource.

Conversation modality

ApplicationSharingModality.BeginShareMonitor

Shares a display and replaces the currently shared resource on the shared content stage regardless of the intent of the owner of the current resource.

Conversation modality

ApplicationSharingModality.BeginShareResources

Shares a resource and replaces the currently shared resource on the shared content stage regardless of the intent of the owner of the current resource.

Conversation modality

ApplicationSharingModality.CanShare

Checks to see whether the specified resource type can be shared before you try to share resources of the specified type.

Conversation modality

The following table shows the control actions that a resource sharer may take. A resource viewer cannot take these actions.

Resource control sharer operations

Method

Purpose

Valid for which modality?

ApplicationSharingModality.BeginAcceptControlRequest

Accepts another user’s request to control a locally shared resource.

Requesting participant modality

ApplicationSharingModality.BeginDeclineControlRequest

Declines another user’s request to control a locally shared resource.

Requesting participant modality

ApplicationSharingModality.BeginGrantControl

Grants the control of a locally shared resource to another user.

Important noteImportant
Granting control to another user does not create an offer that the user can decline. Once you have granted control, the other user is automatically in control and must release the control back to you. You may also revoke the control.

Modality of participant to be granted control

ApplicationSharingModality.BeginRevokeControl

Revokes control of a resource that was granted or requested by another user.

Resource controlling participant modality

The following table shows the control actions that a resource viewer may take. A resource sharer cannot take these actions.

Shared resource control viewer operations

Method

Purpose

Valid for which modality?

ApplicationSharingModality.BeginRequestControl

Requests control of a resource that is owned by another user.

Local participant modality

ApplicationSharingModality.BeginReleaseControl

Releases control of a resource that a user has either been granted control of or requested control of. This method cannot be called on an application sharing modality by the owner of a shared resource.

Local participant modality

Event callback method registration

The events that are raised on the application sharing modalities in the conversation must be handled in order to make your application responsive to changes in state of sharing objects in a conversation. The following table describes the purpose of each of these modality events and which objects (local participant, other participants, the conversation) to register event callback methods on.

Event

Purpose

Which object to register on

Modality.ModalityStateChanged

Raised when an application sharing modality has connected or disconnected in the conversation. You cannot share resources when the modality is disconnected.

Application sharing modality of all participants, the conversation modality.

Modality.ActionAvailabilityChanged

Raised when an action such as granting control of a locally shared resource becomes available or is no longer available. This event is typically used to enable or disable resource control action-related buttons on a UI.

Application sharing modality of all participants, the conversation modality.

ApplicationSharingModality.ControlRequestReceived

Raised when another user wants to control a resource shared locally by the local user.

Conversation modality

ApplicationSharingModality.ControllerChanged

Raised when the control of the shared resource changes from one user to another.

Conversation modality

ApplicationSharingModality.ParticipationStateChanged

Raised when the local participant requests or releases control of a resource, or grants or revokes control of a locally shared resource.

Conversation modality

ApplicationSharingModality.LocalSharedResourcesChanged

Raised when the local user begins to share a resource or switches from one shared resource to another shared resource.

Conversation modality

Community Additions

Show:
© 2014 Microsoft