Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TryDeleteValue()

bool System.Dynamic.ExpandoObject.TryDeleteValue ( object indexClass,
int index,
string name,
bool ignoreCase,
object deleteValue )
inlinepackage

Definition at line 585 of file ExpandoObject.cs.

586 {
587 ExpandoData data;
589 {
590 data = _data;
591 if (data.Class != indexClass || ignoreCase)
592 {
593 index = data.Class.GetValueIndex(name, ignoreCase, this);
594 if (index == -2)
595 {
597 }
598 }
599 if (index == -1)
600 {
601 return false;
602 }
603 object obj = data[index];
604 if (obj == Uninitialized)
605 {
606 return false;
607 }
608 if (deleteValue != Uninitialized && !object.Equals(obj, deleteValue))
609 {
610 return false;
611 }
612 data[index] = Uninitialized;
613 _count--;
614 }
615 _propertyChanged?.Invoke(this, new PropertyChangedEventArgs(data.Class.Keys[index]));
616 return true;
617 }
int GetValueIndex(string name, bool caseInsensitive, ExpandoObject obj)
PropertyChangedEventHandler _propertyChanged
static readonly object Uninitialized
static Exception AmbiguousMatchInExpandoObject(object p0)
Definition Error.cs:23

References System.Dynamic.ExpandoObject._count, System.Dynamic.ExpandoObject._data, System.Dynamic.ExpandoObject._propertyChanged, System.Linq.Expressions.Error.AmbiguousMatchInExpandoObject(), System.Dynamic.ExpandoObject.ExpandoData.Class, System.Dynamic.ExpandoClass.GetValueIndex(), System.index, System.Dynamic.ExpandoClass.Keys, System.Dynamic.ExpandoObject.LockObject, System.obj, and System.Dynamic.ExpandoObject.Uninitialized.

Referenced by System.Dynamic.ExpandoObject.Remove(), and System.Dynamic.ExpandoObject.Remove().