tModLoader v0.11.8.9
A mod to make and play Terraria mods
Terraria.ModLoader.Config.DefaultListValueAttribute Class Reference

Defines the default value to be added when using the ModConfig UI to add elements to a Collection (List, Set, or Dictionary value). Works the same as System.ComponentModel.DefaultValueAttribute, but can't inherit from it because it would break when deserializing any data structure annotated with it. More...

+ Inheritance diagram for Terraria.ModLoader.Config.DefaultListValueAttribute:
+ Collaboration diagram for Terraria.ModLoader.Config.DefaultListValueAttribute:

Public Member Functions

 DefaultListValueAttribute (bool value)
 
 DefaultListValueAttribute (byte value)
 
 DefaultListValueAttribute (char value)
 
 DefaultListValueAttribute (double value)
 
 DefaultListValueAttribute (float value)
 
 DefaultListValueAttribute (int value)
 
 DefaultListValueAttribute (long value)
 
 DefaultListValueAttribute (object value)
 
 DefaultListValueAttribute (short value)
 
 DefaultListValueAttribute (string value)
 
 DefaultListValueAttribute (Type type, string value)
 
override bool Equals (object obj)
 
override int GetHashCode ()
 

Protected Member Functions

void SetValue (object value)
 

Properties

virtual object Value [get]
 

Private Attributes

object value
 

Detailed Description

Defines the default value to be added when using the ModConfig UI to add elements to a Collection (List, Set, or Dictionary value). Works the same as System.ComponentModel.DefaultValueAttribute, but can't inherit from it because it would break when deserializing any data structure annotated with it.

Definition at line 108 of file ConfigAttributes.cs.

Constructor & Destructor Documentation

◆ DefaultListValueAttribute() [1/11]

Terraria.ModLoader.Config.DefaultListValueAttribute.DefaultListValueAttribute ( Type  type,
string  value 
)

Definition at line 111 of file ConfigAttributes.cs.

111 {
112 try {
113 this.value = TypeDescriptor.GetConverter(type).ConvertFromInvariantString(value);
114 }
115 catch {
116 Logging.tML.Error("Default value attribute of type " + type.FullName + " threw converting from the string '" + value + "'.");
117 }
118 }

References Terraria.ModLoader.Config.DefaultListValueAttribute.value.

Referenced by Terraria.ModLoader.Config.DefaultListValueAttribute.Equals().

+ Here is the caller graph for this function:

◆ DefaultListValueAttribute() [2/11]

Terraria.ModLoader.Config.DefaultListValueAttribute.DefaultListValueAttribute ( char  value)

◆ DefaultListValueAttribute() [3/11]

Terraria.ModLoader.Config.DefaultListValueAttribute.DefaultListValueAttribute ( byte  value)

◆ DefaultListValueAttribute() [4/11]

Terraria.ModLoader.Config.DefaultListValueAttribute.DefaultListValueAttribute ( short  value)

◆ DefaultListValueAttribute() [5/11]

Terraria.ModLoader.Config.DefaultListValueAttribute.DefaultListValueAttribute ( int  value)

◆ DefaultListValueAttribute() [6/11]

Terraria.ModLoader.Config.DefaultListValueAttribute.DefaultListValueAttribute ( long  value)

◆ DefaultListValueAttribute() [7/11]

Terraria.ModLoader.Config.DefaultListValueAttribute.DefaultListValueAttribute ( float  value)

◆ DefaultListValueAttribute() [8/11]

Terraria.ModLoader.Config.DefaultListValueAttribute.DefaultListValueAttribute ( double  value)

◆ DefaultListValueAttribute() [9/11]

Terraria.ModLoader.Config.DefaultListValueAttribute.DefaultListValueAttribute ( bool  value)

◆ DefaultListValueAttribute() [10/11]

Terraria.ModLoader.Config.DefaultListValueAttribute.DefaultListValueAttribute ( string  value)

◆ DefaultListValueAttribute() [11/11]

Terraria.ModLoader.Config.DefaultListValueAttribute.DefaultListValueAttribute ( object  value)

Member Function Documentation

◆ Equals()

override bool Terraria.ModLoader.Config.DefaultListValueAttribute.Equals ( object  obj)

Definition at line 133 of file ConfigAttributes.cs.

133 {
134 if (obj == this) {
135 return true;
136 }
137 var other = obj as DefaultListValueAttribute;
138 if (other != null) {
139 if (Value != null) {
140 return Value.Equals(other.Value);
141 }
142 else {
143 return (other.Value == null);
144 }
145 }
146 return false;
147 }

References Terraria.ModLoader.Config.DefaultListValueAttribute.DefaultListValueAttribute(), and Terraria.ModLoader.Config.DefaultListValueAttribute.Value.

+ Here is the call graph for this function:

◆ GetHashCode()

override int Terraria.ModLoader.Config.DefaultListValueAttribute.GetHashCode ( )

◆ SetValue()

void Terraria.ModLoader.Config.DefaultListValueAttribute.SetValue ( object  value)
protected

Definition at line 151 of file ConfigAttributes.cs.

151 {
152 this.value = value;
153 }

References Terraria.ModLoader.Config.DefaultListValueAttribute.value.

Member Data Documentation

◆ value

object Terraria.ModLoader.Config.DefaultListValueAttribute.value
private

Property Documentation

◆ Value

virtual object Terraria.ModLoader.Config.DefaultListValueAttribute.Value
get