コード例 #1
0
        /// <summary>
        /// Deletes the currently selected connection
        /// </summary>
        public void Delete()
        {
            int ndx = SqlConnections.IndexOf(CurrentConnection);

            if (MessageBox.Show(SqlConnectionInfoModelRx.warSCIMConfirmDeletion, SqlConnectionInfoModelRx.warTitle, MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
            {
                SqlConnections.Remove(CurrentConnection);
                if (SqlConnections.Count > ndx)
                {
                    CurrentConnection = SqlConnections[ndx];
                }
                else
                {
                    if (SqlConnections.Count > 0)
                    {
                        CurrentConnection = SqlConnections[SqlConnections.Count - 1];
                    }
                    else
                    {
                        CurrentConnection = null;
                    }
                }
                IsChanged = true;
            }
        }