public static void NewWindow(Window owner, HttpUrl httpUrl, DataSource dataSource)
        {
            var window = new HttpUrlView(httpUrl, dataSource);

            window.Owner = owner;
            window.ShowDialog();
        }
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            var dataItem = HistoryList.SelectedItem as HistoryDetailItem;

            switch (dataItem.MonitorType)
            {
            case MonitorType.Process:
                var processWindow = new ProcessView(dataSource.GetProcessItem(dataItem.ItemID), dataSource);
                processWindow.Owner = this;
                processWindow.ShowDialog();
                break;

            case MonitorType.MySql:
                var mySqlWindow = new MySqlView(dataSource.GetMySqlItem(dataItem.ItemID), dataSource);
                mySqlWindow.Owner = this;
                mySqlWindow.ShowDialog();
                break;

            case MonitorType.HttpUrl:
                var urlWindow = new HttpUrlView(dataSource.GetUrlItem(dataItem.ItemID), dataSource);
                urlWindow.Owner = this;
                urlWindow.ShowDialog();
                break;

            default:
                MsgBox.Alert("未知监控类型");
                break;
            }
        }
Esempio n. 3
0
        private void HttpUrlList_SelectionChanged(object sender, MouseButtonEventArgs e)
        {
            var dataItem = HttpUrlList.SelectedItem as HttpUrl;

            if (dataItem == null)
            {
                return;
            }
            HttpUrlView.NewWindow(this, dataItem, dataSource);
        }