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);
        }
Exemple #2
0
        public static WebRobotItem Convert(WebRobotDashboardItem item)
        {
            WebRobotItem newItem = new WebRobotItem
            {
                DatabaseConnectionString = item.DatabaseConnectionString,
                Name   = item.Name,
                Status = item.Status
            };



            return(newItem);
        }