public void Populate(ref CefMenuModel model, CefContextMenuParams context) { if (ShouldPopulate(context)) { if (ChildItems != null && ChildItems.Count > 0) { var childMenu = model.AddSubMenu(Id, Title); AddChildItems(ref childMenu, context); } else { switch (Type) { case "radio": model.AddRadioItem(Id, Title, GroupId <= 0 ? 1 : GroupId); if (Checked) { model.SetChecked(Id, true); } break; case "checkbox": model.AddCheckItem(Id, Title); if (Checked) { model.SetChecked(Id, true); } break; case "separator": model.AddSeparator(); break; default: model.AddItem(Id, Title); break; } } } }