This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public PersistentChatEndpoint( | |
Uri groupChatServerAddress, | |
LocalEndpoint ocs | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void MyMethod() { | |
//do some stuff | |
var flow = GetFlowFromSomewhere(); | |
var message = GetMessageFromSomewhere(); | |
flow.BeginSendInstantMessage(message, EndBeginSendInstanceMessage, flow); | |
//do some other things.... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void MyMethod() { | |
//do some stuff | |
var flow = GetFlowFromSomewhere(); | |
var message = GetMessageFromSomewhere(); | |
flow.BeginSendInstantMessage(message, result => | |
{ | |
try | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void MyMethod() | |
{ | |
await CallLongRunningTaskAsync(); | |
//this code runs AFTER the task has completed; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Task SendMessageAsync(this InstantMessagingFlow flow, IMessage message) | |
{ | |
return Task.Factory.FromAsync(flow.BeginSendMessage, | |
flow.EndSendMessage, message, null); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void MyMethod() | |
{ | |
flow.EndSendMessage(flow.BeginSendMessage,null,null); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Microsoft.Lync.Model; | |
namespace DesktopDevDemo | |
{ | |
class Program | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Populate-UserObject($UserArg) | |
{ | |
$thisUser = new-Object($t + ".User") | |
$thisUser.Name = $UserArg.Name | |
$thisUser.Email = $UserArg.EmailAddress | |
$thisUser.ID = $UserArg.Guid | |
$innerObject = $UserArg.GetUnderlyingObject() | |
$thisUser.SIP = $innerObject."msRTCSIP-PrimaryUserAddress" | |
return $thisUser | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Request = New-Object System.DirectoryServices.Protocols.SearchRequest | |
$Request.DistinguishedName = $RootContainer | |
$Request.Filter = $SearchFilter | |
$Request.Scope = "Subtree" | |
$Request.Attributes.Add("distinguishedName") | Out-Null | |
$Request.Attributes.Add("objectclass") | Out-Null | |
$Request.Attributes.Add("mail") | Out-Null | |
$Request.Attributes.Add("objectguid") | Out-Null | |
$Request.Attributes.Add("msrtcsip-primaryhomeserver") | Out-Null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-UserPrincipal($userName) | |
{ | |
$dsam = "System.DirectoryServices.AccountManagement" | |
$rtn = [reflection.assembly]::LoadWithPartialName($dsam) | |
$cType = "domain" #context type | |
$iType = "DistinguishedName" | |
$dsamUserPrincipal = "$dsam.userPrincipal" -as [type] | |
$principalContext = new-object "$dsam.PrincipalContext"($cType,$RootDomain) | |
Write-Host Looking for DN $UserName in Container $principalContext.Name | |
OlderNewer