本文整理汇总了C#中ServiceClient.MessageRead方法的典型用法代码示例。如果您正苦于以下问题:C# ServiceClient.MessageRead方法的具体用法?C# ServiceClient.MessageRead怎么用?C# ServiceClient.MessageRead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServiceClient
的用法示例。
在下文中一共展示了ServiceClient.MessageRead方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessInformationMessage
private void ProcessInformationMessage(MessageViewModel message)
{
MessageBox.Show(this, message.Text, message.Type, MessageBoxButton.OKCancel, MessageBoxImage.Exclamation);
ServiceClient client = new ServiceClient();
try
{
client.MessageRead(message.ID);
}
catch (TimeoutException exception)
{
Console.WriteLine("Got {0}", exception.GetType());
client.Abort();
}
catch (CommunicationException exception2)
{
Console.WriteLine("Got {0}", exception2.GetType());
client.Abort();
}
finally
{
if (client != null)
{
// client.Dispose();
}
}
}
示例2: GetMedia
private void GetMedia(MessageViewModel message = null)
{
ServiceClient client = new ServiceClient("BasicHttpBinding_IService", Constants.ServerAddress);
try
{
MediaListModel[] mediaList = client.GetMyMedia(Constants.MyStationID);
if (message != null)
{
client.MessageRead(message.ID);
}
ThreadPool.QueueUserWorkItem(delegate(object e4)
{
MediaListModel[] modelArray1 = mediaList;
for (int j = 0; j < modelArray1.Length; j++)
{
MediaListModel model1 = modelArray1[j];
}
});
}
catch (TimeoutException exception)
{
Console.WriteLine("Got {0}", exception.GetType());
client.Abort();
}
catch (CommunicationException exception2)
{
Console.WriteLine("Got {0}", exception2.GetType());
client.Abort();
}
finally
{
if (client != null)
{
// client.Dispose();
}
}
}
示例3: LoadMosaic
private static void LoadMosaic(MessageViewModel message)
{
ThreadPool.QueueUserWorkItem(delegate(object state)
{
try
{
ServiceClient client = new ServiceClient("BasicHttpBinding_IService", Constants.ServerAddress);
long mosaicID = client.GetMosaicIDForStation(Constants.MyStationID);
Constants.CurrentClientConfiguration.CurrentMosaic=mosaicID;
Constants.SaveDefaults();
Positions = client.GetPositionsForMosaic(mosaicID);
SavePositions(new List<PositionViewModel>(Positions));
MainWindow.Instance.LoadPositions(null);
client.SetStationStatus(Constants.MyStationID, "Positions Loaded, Now Playing");
}
catch (Exception)
{
}
ServiceClient client2 = new ServiceClient();
try
{
if (message != null)
{
client2.MessageRead(message.ID);
}
}
catch (TimeoutException exception)
{
Console.WriteLine("Got {0}", exception.GetType());
client2.Abort();
}
catch (CommunicationException exception2)
{
Console.WriteLine("Got {0}", exception2.GetType());
client2.Abort();
}
});
}
示例4: SendMessageReceipt
private static void SendMessageReceipt(MessageViewModel message, bool updateList = true)
{
ServiceClient client = new ServiceClient();
try
{
client.MessageRead(message.ID);
}
catch (TimeoutException exception)
{
Console.WriteLine("Got {0}", exception.GetType());
client.Abort();
}
catch (CommunicationException exception2)
{
Console.WriteLine("Got {0}", exception2.GetType());
client.Abort();
}
if (updateList)
{
UnProcessedMessages.Remove(message);
}
}