Outlook IM集成:聊天/呼叫/视频呼叫按钮启用/禁用管理

时间:2019-01-10 22:11:30

标签: outlook-addin instant-messaging lync-client-sdk

我正在将我们的IM提供程序集成到Outlook中,以显示演出并通过我们的IM应用程序从Outlook进行呼叫。当然,我读过很多篇文章https://docs.microsoft.com/en-us/office/client-developer/shared/integrating-im-applications-with-office

在主要集成方面效果很好。但是我在“聊天/通话/视频通话”按钮上遇到了一个问题:我无法管理其可用性。

我从Contact.GetContactInformation方法ucPresenceCapabilities,ucPresenceCapabilityDetails联系信息类型返回:

public dynamic GetContactInformation(ContactInformationType _contactInformationType)
{
    switch (_contactInformationType)
    {
    ....
    case ContactInformationType.ucPresenceCapabilities:
        return this.capabilities;
 case ContactInformationType.ucPresenceCapabilityDetails:
     return this.capabilityDetails;
 case ContactInformationType.ucPresenceCapabilityString:
     return null;
     default:
     throw new NotImplementedException();
    }
}

属性功能我以另一种方式构建的细节:

public MyOfficePresenceCapability[] BuildCapabilitiesDetails(bool canCall, bool canIM, bool canVideo)
{
    var capabilityDetails = new MyOfficePresenceCapability[3] {
            new OfficePresenceCapability((int)(canIM ? mAvailability : ContactAvailability.ucAvailabilityOffline), canIM, canIM, PresenceCapabilityType.ucPresenceCapabilityInstantMessaging),
            new OfficePresenceCapability((int)(canCall ? mAvailability : ContactAvailability.ucAvailabilityOffline), canCall, canCall, PresenceCapabilityType.ucPresenceCapabilityAudio),
            new OfficePresenceCapability((int)(canVideo ? mAvailability : ContactAvailability.ucAvailabilityOffline), canVideo, canVideo, PresenceCapabilityType.ucPresenceCapabilityVideo)
    };

    return capabilityDetails;
}

结果,我无法在需要时禁用任何按钮“聊天/通话/视频通话”。也许那不可能。如果有人对这个问题有经验,我会很高兴的。

0 个答案:

没有答案