public void UpdateAll() { Families = GetFamilies(); if (Families.Count() > 0) { var currentFamily = Families.FirstOrDefault(); CurrentFamilyId = currentFamily.Id; Symbols = GetSymbols(currentFamily); if (Symbols.Count() > 0) { CurrentSymbolId = Symbols.FirstOrDefault().Id; } windowBasedExternalEventHandler.MinWindowWidth = _minWindowWidth; windowBasedExternalEventHandler.MinWindowHeight = _minWindowHeight; } else { var td = new TaskDialog("Warning"); td.MainInstruction = "Families is required"; td.MainContent = "There are no families in the project. Do you want to load it?"; td.MainIcon = TaskDialogIcon.TaskDialogIconInformation; td.AddCommandLink(TaskDialogCommandLinkId.CommandLink1, "Yes, load families into the project"); td.AddCommandLink(TaskDialogCommandLinkId.CommandLink2, "No, don't load it"); TaskDialogResult tdres = td.Show(); switch (tdres) { case TaskDialogResult.CommandLink1: FamilyLoader.LoadFamilies(doc); UpdateAll(); break; case TaskDialogResult.CommandLink2: break; default: break; } } }