mauede
Well-known member
Today I witnessed a weird behavior of Visual Studio debugger. For some reason, to me unknown, it refuses to set a break-point for some regular assignment
statements. They are inside an event handler. I do not know whether that matters at all.
In the following I am posting the code where that occurs:
Is this to be expected?
Thank you very much
statements. They are inside an event handler. I do not know whether that matters at all.
In the following I am posting the code where that occurs:
C#:
private void AutoMatchedStruct_Click(object sender, RoutedEventArgs e)
{
if(structures.Count <= 0) // CHECKS PROTOCOL STRUCTUREs HAVE BEEN LOADED
{
MessageBox.Show("Protocol structures must be loaded Before renaming can start.", "Warning ", MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
PTAccess pt = new PTAccess();
List<string> EditedList = new List<string>();
EditedList = pt.StructuresAutomaticRename(structures);
int j = 1;
foreach (string str in EditedList)
{
AutoNames.Add(new EditableStructures { StrName = str, IsAccepted = false, NamInd = j});
j++;
}
// string DbgList = "" ; // DEBUG PURPOSE
// DbgList = String.Join(" , ", AutoNames.Select(x => x.StrName)); // DEBUG PURPOSE
// MessageBox.Show($"AUTOMATICALLY RENAMED STRUCTURES: \n {DbgList}"); // DEBUG PURPOSE
//............................ Compare Number of Guessed Structure Names With Number Of Structure Names From Velocity DataBase
// ............................ Alert User If Less Than 50% Structures Could Not Be Guessed
int NumGuessed = 0;
int NumOriginal = 0;
var Guessed = AutoNames.Where(m => !string.IsNullOrWhiteSpace(m.StrName)).ToList();
NumGuessed = Guessed.Count;
NumOriginal = strucNames.Count;
if ((double) (NumGuessed / NumOriginal ) < 0.5)
{
MessageBox.Show("Less than 50% of structure automatically renamed! \n", "Is this patient belonging to this trial? ", MessageBoxButton.OK, MessageBoxImage.Information);
}
UpdateAutoStrucNames();
}
Is this to be expected?
Thank you very much