コード例 #1
0
        /// <summary>Hit when the user wants to add a new Application Server.</summary>
        /// <param name="sender">btnAddApp</param>
        /// <param name="e"></param>
        private void btnAddApp_Click(object sender, RoutedEventArgs e)
        {
            Details_ApplicationServer win = new Details_ApplicationServer();
            bool?resp = win.ShowDialog();

            if (resp.HasValue && resp.Value)
            {
                //Save the application server!
                this.AddOrUpdateApplicationSystem(win.AppSystem);
            }
        }
コード例 #2
0
        /// <summary>Hit when the user wants to edit an existing application.</summary>
        /// <param name="sender">lstApplicationServers.Item</param>
        /// <param name="e"></param>
        private void lstApplicationServersItem_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 2)
            {
                //Get the data item..
                if (sender is Grid)
                {
                    if (((Grid)sender).DataContext is ApplicationSystem)
                    {
                        ApplicationSystem appSys = (ApplicationSystem)((Grid)sender).DataContext;

                        //Display the form..
                        Details_ApplicationServer win = new Details_ApplicationServer(appSys);
                        bool?resp = win.ShowDialog();
                        if (resp.HasValue && resp.Value)
                        {
                            //Add or update the list..
                            this.AddOrUpdateApplicationSystem(appSys);
                        }
                    }
                }
            }
        }