How to get current conversation in xbap hosted by lync cwe? - c#

I am implementing an extension of Lync conversation window(Lync cwe). Lync has an embedded browser, so I use xbap(WPF browser application) to display some information for this conversation. But I can't get the current conversation object in xbap code. Information about Lync CWE: http://msdn.microsoft.com/en-us/library/office/hh378589(v=office.14).aspx
I know that it is easy to achieve this in silverlight application by calling LyncClient.GetHostingConversation(). But for some reasons, I can't choose silverlight.
I found that Lync writes a key for every conversation in the browser. We can use javascript code to access the property: "external.Parameters". I also observe the method GetHostingConversation(), it uses HtmlPage.Window.Eval("external.Parameters") to get a key used to get the current conversation. But I don't know whether I can make use of this feature to get what I want in xbap.
I also tried to host an silverlight application in xbap. I hope that if I write the right information to the web browser control of xbap, then the silverlight application hosted in xbap can also get the current conversation object for me. But I failed to add external.Parameters. Information about hosting silverlight in xbap: http://msdn.microsoft.com/en-us/library/cc656722.aspx
Here is the steps I have made:
Create a WPF browser application
Add reference of Microsoft.Lync.Model and Microsoft.Lync.Utilities
Use the following code to get the current conversation object:
Conversation currentConversation = (Conversation)LyncClient.GetHostingConversation();
But visual studio told me LyncClient does not have a definition for GetHostingConversation.
So is it possible to get the current conversation object in xbap? And how?
Thanks.

The GetHostingConversation method is only available in Lync Silverlight applications. It looks like you're using WPF. If WPF is required, you need to find out how to get the conversation object in a Lync WPF app. My memory is it's a bit more work than in a Silverlight application. You might consider posting a question on the Lync SDK forum, here:
http://social.msdn.microsoft.com/Forums/lync/en-US/home?forum=communicatorsdk

Related

How can I request the user to open Desktop Application in React?

I couldn't find the exact answer I was looking for. I have two applications - web application built with react and desktop application built in C# Forms. What I want is if the user goes to a certain page in the Web Application, the browser should open (with or without a request) the windows application and send data, like the user's id. Could you guys give me an advice how this can be done?
For that, when installing your windows C# form in the user machine, you need to register a custom protocol in the registery.
See How do I register a custom URL protocol in Windows?

Can Chrome auto pick up a username and password from a database using C#

I am new to coding and I am currently working on a GUI for a database.
The problem I am running into is that I need to find a way to have the GUI log in to a database in chrome automatically using the username and password that they will provide to open the GUI.
Again, I am new to coding and I do not know if this is possible but I can't find a way to have chrome auto enter that information and open a link that will allow user to create a new transaction.
I am using C#.
I tried this:
System.Diagnostics.Process.Start("chrome.exe", "http://database.spinca.com/transaction/new/");
But that only gets me to the login page.
You add your code to the Web Server side. The browser (which hosts/renders the UI) communicates with the Server (which returns the UI code to the browser.) I suggest taking a quick training class on web based technologies and learn the relationship between Browser and web server. The browser cannot communicate directly with local resources (such as a database or disk). There are many blogs and books available on this subject - or use Pluralsight. Khan Academy has an intro to HTML/JS but is strictly Client side (browser) based.
I assume you are using a Microsoft based web server technology (IIS) since you are coding in C#. There are several hello-world examples, and many are in Visual Studio itself.
If you don't need a Browser (HTML) - you might consider a Windows application. In that case look into WPF apps which use XAML for UI definition. Look in Templates Visual C# WPF App in Visual Studio.

Can I use YoutubeAPI to create live events with different user

As far as I know, when I developed a console app using YoutubeAPI to create live events for streaming, youtube required me to choose the account which was enable live streaming to put live events on.
But when I developed a website app using that API, even though I opened icognito browser to create live events, it still used my first account in Chrome to create live event.
I wondered if there is some way to make this API to select user like what happened in console app.
I think it is because of the client_secrets.json but I don't know how to fix it.
I am using C# to develop
All of the Live Streaming endpoints require OAuth, you must be authenticated as the user you wish to stream live with. You cannot stream on another user's behalf unless they have logged in and provided a valid OAuth token to use for your requests.

Log in to desktop application by Windows Live ID

I want to create a login form for my desktop application that user can use Windows Live ID for that.
I create an application in manage.dev.live.com and use Desktop Implementation section.
I use a WebBrowser control and navigate to a given address. but I don't know how to receive the token for user.
If I have made a mistake please tell me how to fix that.
As of June 2011, Windows Live ID supports OAUTH 2.0 and should enable you to do that (read more about it). WPF code example can be found at https://github.com/liveservices/LiveSDK/tree/master/Samples/CSharpDesktop.

Making audio calls using Microsoft Lync from a third party application - Lync SDK

We have a chat application which works on ASP.Net web applications. We want to allow users to make calls to other users through our chat application. To provide that we want to make use of Microsoft Lync 2010 and use their SDK to leverage its capabilities and make calls. Any pointers on how to do that will be of great help.
You have a couple of options here - you could use the NameCtrl control to integrate presence and a pop-up menu into your aspx pages - see my answer here for more details, and an example.
Assuming you're not using Silverlight, you could create a .NET assembly that uses the SDK to initiate a call (see the walkthrough here), and then expose this to COM using .NET's COM Interop features - example here, if you haven't done this before
Also, Sevki's answer is a great way to get up and running quickly, although you won't be able to get the presence of the user that way.
All of this assumes that the users have Lync running on their machine, i.e. assumes you won't be opening chat up to users outside your organisation who may not have Lync installed.
Edit: Not having Lync installed changes things a lot. If Lync is installed, then Lync will handle setting up the audio call, and will handle the transfer of Audio between the participants in the conversation. Without Lync, you'd have to do that yourself, which won't be straightforward.
Your best bet might be to have your users use the Lync Web App. This is a web based client that allows external users to join conferences. You'd need to build a UCMA 3.0 application which would sit inside your Lync infrastructure. The app would:
Accept a request from your web app to start a new conference, inviting the desired user - see here and here
When the conference is created, get the id and return it to the web user
In the web client, use the returned id to build a URL that opens the Lync Web App.
I can't remember the syntax of the url off the top of my head, but to get it, you could create a new conference using the Lync Client, then select Invite By Email (from the icon of two "pawns") - this will generate an email containing a URL - clicking the URL take you to a page that gives you conference join options, including installing the web app (you'd need to try the URL on a machine that doesn't have Lync installed to get the option to install the web app)
Edit: My bad - the Lync Web App doesn't support Audio. You could actually use the same concept as above, but with the Lync Attendee Client instead. However, this forces the user to install some components client side, so may not be acceptable in your scenario.
Edit: See also the answer here for more details, this refers to getting video to the client, but is relevant for audio too
You could create a hyperlink like so
<a href=”tel:{blah phone number}″>{blah phone number}</a>
or
<a href=”sip:{blah sip blah}″>{blah sip blah}</a>
Which will launch lync from the browser, however if you want to do it inside the browser it seems that you will have to go in to Silverlight. You can find Silverlight samples in Lync Client Side API sdk.
There is an hour-long intro to integrating Lync recorded at Tech-Ed Europe at the end of last year. I've not watched it yet, but it looks quite good.
http://channel9.msdn.com/Events/TechEd/Europe/2010/UNC306

Categories