Skip to content

Instantly share code, notes, and snippets.

View tomorgan's full-sized avatar

Tom Morgan tomorgan

View GitHub Profile
@tomorgan
tomorgan / BusylightSDK-LightCustomColour
Last active December 17, 2015 15:39
Busylight SDK for Microsoft Lync - sample showing how to display a custom colour
using Plenom.Components.Busylight.Sdk;
using System.Threading;
namespace ThoughtStuff.BusylightSDK
{
class Program
{
static void Main(string[] args)
{
//Instantiate BusyLightController for either Lync or UC:
@tomorgan
tomorgan / UserEndpointEstablish
Last active January 2, 2016 17:08
Creating a user endpoint
UserEndpoint _endpoint;
UserEndpointSettings settings;
settings = new UserEndpointSettings(_sipaddress);
settings.Credential = new System.Net.NetworkCredential(Username, Password, Domain);
_endpoint = new UserEndpoint(_collabPlatform, settings);
_endpoint.EndEstablish(_endpoint.BeginEstablish(null,null));
@tomorgan
tomorgan / applicationEndpoint
Created January 9, 2014 14:08
Creating an Application Endpoint
CollaborationPlatform _collabPlatform;
var platformSettings = new ProvisionedApplicationPlatformSettings("UCMASampleApp", _appID);
_collabPlatform = new CollaborationPlatform(platformSettings);
_collabPlatform.RegisterForApplicationEndpointSettings(ApplicationEndpointSettingsDiscovered);
_collabPlatform.EndStartup(_collabPlatform.BeginStartup(null, null));
@tomorgan
tomorgan / clientcollabplatform
Created January 9, 2014 14:17
Client Collaboration Platform
CollaborationPlatform _collabPlatform;
var platformSettings = new ClientPlatformSettings(userAgent, Microsoft.Rtc.Signaling.SipTransportType.Tls);
_collabPlatform = new CollaborationPlatform(platformSettings);
_collabPlatform.AllowedAuthenticationProtocol = Microsoft.Rtc.Signaling.SipAuthenticationProtocols.Ntlm;
_collabPlatform.EndStartup(_collabPlatform.BeginStartup(null, null));
@tomorgan
tomorgan / applicationendpointestablish
Last active January 2, 2016 17:19
Establishing an Application Endpoint
void ApplicationEndpointSettingsDiscovered(object sender, ApplicationEndpointSettingsDiscoveredEventArgs e)
{
ApplicationEndpointSettings settings = e.ApplicationEndpointSettings;
_Endpoint = new ApplicationEndpoint(_collabPlatform, settings);
_Endpoint.EndEstablish(_Endpoint.BeginEstablish(null, null));
}
@tomorgan
tomorgan / azureStorageContainerVersion
Created January 13, 2014 16:08
Update Azure Storage Container version
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
namespace WAStorageMgr
{
class Program
@tomorgan
tomorgan / pchatEndpointConstructor
Created June 17, 2014 14:01
Persistent Chat Endpoint Constructor
public PersistentChatEndpoint(
Uri groupChatServerAddress,
LocalEndpoint ocs
)
@tomorgan
tomorgan / begin..endExample
Last active August 29, 2015 14:04
Async Begin..End example
private void MyMethod() {
//do some stuff
var flow = GetFlowFromSomewhere();
var message = GetMessageFromSomewhere();
flow.BeginSendInstantMessage(message, EndBeginSendInstanceMessage, flow);
//do some other things....
}
@tomorgan
tomorgan / Async lambda
Created July 29, 2014 12:40
Asynchronous Lambda Expression Example
private void MyMethod() {
//do some stuff
var flow = GetFlowFromSomewhere();
var message = GetMessageFromSomewhere();
flow.BeginSendInstantMessage(message, result =>
{
try
{
private void MyMethod()
{
await CallLongRunningTaskAsync();
//this code runs AFTER the task has completed;
}