示例#1
0
    static void Main(string[] args)
    {
        MyImApp imApp = new MyImApp();

        if (imApp == null)
        {
            return;
        }

        UCOfficeIntegration officeIntegration = (UCOfficeIntegration)imApp;

        if (officeIntegration == null)
        {
            return;
        }

        officeIntegration.OnShuttingDown += officeIntegration_OnShuttingDown;

        string    officeVersion     = "15.0.0.0";
        string    authInfo          = officeIntegration.GetAuthenticationInfo(officeVersion);
        OIFeature supportedFeatures = officeIntegration.GetSupportedFeatures(officeVersion);  //skype reports: -122

        LyncClient lyncClient = (LyncClient)officeIntegration.GetInterface(officeVersion, OIInterface.oiInterfaceILyncClient);

        if (lyncClient == null)
        {
            return;
        }

        string uri = lyncClient.Uri;

        IAutomation automation = (IAutomation)officeIntegration.GetInterface(officeVersion, OIInterface.oiInterfaceIAutomation);

        //LyncClientCapabilityTypes capabilities = lyncClient.Capabilities; //skype: Not implemented
        lyncClient.OnStateChanged += lyncClient_OnStateChanged;

        ContactManager contactManager = lyncClient.ContactManager;

        if (contactManager == null)
        {
            return;
        }


        AsynchronousOperation async = contactManager.Lookup("*****@*****.**", myContactsAndGroupsCallback, Type.Missing);

        Contact contact = contactManager.GetContactByUri("*****@*****.**");

        if (contact != null)
        {
            dynamic result = contact.GetContactInformation(ContactInformationType.ucPresenceInstantMessageAddresses);

            ContactSettingDictionary settings = contact.Settings;

            ContactSetting[] keys = settings.Keys;

            if (keys != null)
            {
                foreach (ContactSetting key in keys)
                {
                    object value = null;
                    settings.TryGetValue(key, out value);
                }
            }
        }

        Console.CancelKeyPress += Console_CancelKeyPress;

        Console.WriteLine("Press Ctrl-C for exit");

        do
        {
            System.Threading.Thread.Sleep(1000);
        } while (!cancelPressed);
    }
示例#2
0
 public void OnAddCustomGroup(ContactManager _source, AsynchronousOperation _asyncOperation)
 {
 }
示例#3
0
 public void OnSearch(ContactManager _source, SearchResults _searchResults, AsynchronousOperation _asyncOperation)
 {
 }
示例#4
0
 public void OnRemoveGroup(ContactManager _source, AsynchronousOperation _asyncOperation)
 {
 }
示例#5
0
 public void OnRemoveContactFromAllGroups(ContactManager _source, AsynchronousOperation _asyncOperation)
 {
 }
示例#6
0
 public void OnLookup(ContactManager _source, object _lookupResult, AsynchronousOperation _asyncOperation)
 {
 }
示例#7
0
 public void OnAddDistributionGroup(ContactManager _source, AsynchronousOperation _asyncOperation)
 {
 }