internal void RemoveEntry(int index) { if (RefIList.IsFixedSize) { if (this.FallbackType.IsArray) { var array = Value as Array; Resize(ref array, RefIList.Count - 1, index); Value = array; RefIList = Value as IList; } else { SL.LogWarning("Cannot remove from this type: " + FallbackType.GetType()); return; } } else { RefIList.RemoveAt(index); } ApplyFromRefIList(); }
internal void AddEntry() { if (m_typeToAdd == null) { SL.LogWarning("No type selected!"); return; } if (RefIList == null) { SL.LogWarning("Cannot add to " + this.Value.GetType()); return; } object newValue = At.TryCreateDefault(m_typeToAdd); if (RefIList.IsFixedSize) { if (this.FallbackType.IsArray) { var array = Value as Array; Resize(ref array, RefIList.Count + 1, -1); Value = array; RefIList = Value as IList; RefIList[RefIList.Count - 1] = newValue; } else { SL.LogWarning("Cannot add to this type: " + FallbackType.GetType()); return; } } else { RefIList.Add(newValue); } ApplyFromRefIList(); }