Exemplo n.º 1
0
        public WebRobotItemCollection GetRobotItems()
        {
            WebRobotItemCollection displayItems = new WebRobotItemCollection();

            try
            {
                using (ChannelFactory <IWebRobotService> cf =
                           new ChannelFactory <IWebRobotService>(new WebHttpBinding(), url))
                {
                    cf.Endpoint.Behaviors.Add(new WebHttpBehavior());
                    var channel = cf.CreateChannel();
                    var items   = channel.ListWebRobots();

                    foreach (var item in items)
                    {
                        displayItems.Add(WebRobotItem.Convert(item));
                    }
                }
            }
            catch
            {
                // error
            }
            return(displayItems);
        }
Exemplo n.º 2
0
        private void LoadRobotManagement_Click(object sender, RoutedEventArgs e)
        {
            robots = client.GetRobotItems();

            this.WebRobotList.ItemsSource = robots;
            if (robots.Count < 1)
            {
                this.StreamLogOutput.Text +=
                    String.Format("[{0}] [{1}] - {2}", DateTime.Now, "Manager", "OsoFx Service is down");
            }
        }