本文整理汇总了C#中SteamClient.PostCallback方法的典型用法代码示例。如果您正苦于以下问题:C# SteamClient.PostCallback方法的具体用法?C# SteamClient.PostCallback怎么用?C# SteamClient.PostCallback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SteamClient
的用法示例。
在下文中一共展示了SteamClient.PostCallback方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AsyncJobClearsOnCompletion
public void AsyncJobClearsOnCompletion()
{
SteamClient client = new SteamClient();
AsyncJob<Callback> asyncJob = new AsyncJob<Callback>( client, 123 );
client.PostCallback( new Callback { JobID = 123 } );
Assert.False( client.jobManager.asyncJobs.ContainsKey( asyncJob ), "Async job dictionary should no longer contain jobid key after callback is posted" );
Assert.False( client.jobManager.asyncJobs.ContainsKey( 123 ), "Async job dictionary should no longer contain jobid key (as value type) after callback is posted" );
}
示例2: AysncJobCompletesOnCallback
public void AysncJobCompletesOnCallback()
{
SteamClient client = new SteamClient();
AsyncJob<Callback> asyncJob = new AsyncJob<Callback>( client, 123 );
Task<Callback> asyncTask = asyncJob.ToTask();
client.PostCallback( new Callback { JobID = 123 } );
Assert.True( asyncTask.IsCompleted, "Async job should be completed after callback is posted" );
Assert.False( asyncTask.IsCanceled, "Async job should not be canceled after callback is posted" );
Assert.False( asyncTask.IsFaulted, "Async job should not be faulted after callback is posted" );
}
示例3: AsyncJobGivesBackCallback
public void AsyncJobGivesBackCallback()
{
SteamClient client = new SteamClient();
AsyncJob<Callback> asyncJob = new AsyncJob<Callback>( client, 123 );
Task<Callback> jobTask = asyncJob.ToTask();
Callback ourCallback = new Callback { JobID = 123 };
client.PostCallback( ourCallback );
Assert.Same( jobTask.Result, ourCallback );
}
示例4: AsyncJobMultipleClearsOnCompletion
public void AsyncJobMultipleClearsOnCompletion()
{
SteamClient client = new SteamClient();
AsyncJobMultiple<Callback> asyncJob = new AsyncJobMultiple<Callback>( client, 123, call => call.IsFinished );
client.PostCallback( new Callback { JobID = 123, IsFinished = true } );
Assert.False( client.jobManager.asyncJobs.ContainsKey( asyncJob ), "Async job dictionary should not contain jobid key for AsyncJobMultiple on completion" );
Assert.False( client.jobManager.asyncJobs.ContainsKey( 123 ), "Async job dictionary should not contain jobid key (as value type) for AsyncJobMultiple on completion" );
}