Example #1
0
        public async Task <IActionResult> Edit(PingControl model)
        {
            var result = await _pingControlRepository.SaveOrUpdateAsync(model);

            if (result.success)
            {
                return(RedirectToAction("PingManagement"));
            }

            return(View(model));
        }
Example #2
0
        private TabItem AddTabItem(Host host, bool AddOnRuntime = false)
        {
            tabControl.DataContext = null;
            int     count = _tabItems.Count;
            TabItem tab   = new TabItem
            {
                Header         = string.Format("Host: {0}", host.HostName),
                Name           = string.Format("tab{0}", count),
                HeaderTemplate = tabControl.FindResource("TabHeader") as DataTemplate,
                Uid            = host.Id.ToString()
            };

            tab.SetResourceReference(Control.TemplateProperty, "CloseButton");
            PingControl pingControl = new PingControl(host, AddOnRuntime);

            tab.Content = pingControl;
            _tabItems.Insert(count, tab);
            tabControl.DataContext = _tabItems;
            ToggleWindowSize();
            return(tab);
        }