当前位置: 首页>>代码示例>>C#>>正文


C# ServiceClient.MessageRead方法代码示例

本文整理汇总了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();

            }

        }

    }
开发者ID:afrog33k,项目名称:eAd,代码行数:45,代码来源:PageSwitcher.xaml.cs

示例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();

            }

        }

    }
开发者ID:afrog33k,项目名称:eAd,代码行数:64,代码来源:PageSwitcher.xaml.cs

示例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();

            }

        });

    }
开发者ID:afrog33k,项目名称:eAd,代码行数:67,代码来源:PageSwitcher.xaml.cs

示例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);

        }

    }
开发者ID:afrog33k,项目名称:eAd,代码行数:38,代码来源:PageSwitcher.xaml.cs


注:本文中的ServiceClient.MessageRead方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。