public void SafeCleanProperty(T key)
 {
     if (m_cachedListString.ContainsKey(key))
     {
         m_cachedListString.Remove(key);
         EventOnValueChanged?.Invoke(key, default);
     }
 }
 protected void SafeSet(T key, R value)
 {
     if (value == default)
     {
         m_cachedListString.Remove(key);
     }
     else
     {
         m_cachedListString[key] = value;
     }
     EventOnValueChanged?.Invoke(key, value);
 }
 public void SetData(List <T> items)
 {
     m_isLoading = true;
     for (var i = 0; i < m_parent.components.Count && i < items.Count; i++)
     {
         ((UICheckBox)m_parent.components[i]).isChecked      = items[i].IsChecked;
         ((UICheckBox)m_parent.components[i]).label.text     = items[i].ToString();
         ((UICheckBox)m_parent.components[i]).objectUserData = new IdAndWeight
         {
             id     = items[i],
             weight = i
         };
     }
     while (m_parent.components.Count > items.Count)
     {
         Destroy(m_parent.components[m_parent.components.Count - 1]);
         m_parent.components.RemoveAt(m_parent.components.Count - 1);
     }
     while (m_parent.components.Count < items.Count)
     {
         var        i     = m_parent.components.Count;
         UICheckBox check = AddCheckboxLocale(items[i].ToString(), items[i].IsChecked, new IdAndWeight
         {
             id     = items[i],
             weight = i
         }, (x, y) =>
         {
             (x.objectUserData as IdAndWeight).weight = m_parent.components.Where(z => (z as UICheckBox).isChecked).Count() - 1;
             Reordenate();
             EventOnValueChanged?.Invoke(GetSelectionOrder());
         });
         check.label.colorizeSprites = true;
         check.label.processMarkup   = true;
     }
     m_isLoading = false;
     Reordenate();
 }