Example #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);
    }
Example #2
0
 public void OnAddCustomGroup(ContactManager _source, AsynchronousOperation _asyncOperation)
 {
 }
Example #3
0
 public void OnSearch(ContactManager _source, SearchResults _searchResults, AsynchronousOperation _asyncOperation)
 {
 }
Example #4
0
 public void OnRemoveGroup(ContactManager _source, AsynchronousOperation _asyncOperation)
 {
 }
Example #5
0
 public void OnRemoveContactFromAllGroups(ContactManager _source, AsynchronousOperation _asyncOperation)
 {
 }
Example #6
0
 public void OnLookup(ContactManager _source, object _lookupResult, AsynchronousOperation _asyncOperation)
 {
 }
Example #7
0
 public void OnAddDistributionGroup(ContactManager _source, AsynchronousOperation _asyncOperation)
 {
 }