Chronos Plugins 5.11.0
This documentation covers the plugin interfaces definitions and an example implementation.
Loading...
Searching...
No Matches
MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor Class Reference

Custom property descriptor, redirecting get/set into our mPropsValues dictionary. More...

Inheritance diagram for MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor:
Collaboration diagram for MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor:

Public Member Functions

 MyPropertyDescriptor (string name, Type proptype, string unit=null)
void AddAttribute (Attribute someAttr)
override void SetValue (object component, object value)
override object GetValue (object component)
override bool CanResetValue (object component)
override void ResetValue (object component)
override bool ShouldSerializeValue (object component)

Protected Member Functions

override void FillAttributes (System.Collections.IList attributeList)

Properties

override Type PropertyType [get]
override Type ComponentType [get]
override bool IsReadOnly [get]

Private Attributes

readonly List< Attribute > mExtraAttributes = new List<Attribute>()
readonly string mName

Detailed Description

Custom property descriptor, redirecting get/set into our mPropsValues dictionary.

Definition at line 100 of file MockDynamicProperties.cs.

Constructor & Destructor Documentation

◆ MyPropertyDescriptor()

MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor.MyPropertyDescriptor ( string name,
Type proptype,
string unit = null )

Definition at line 105 of file MockDynamicProperties.cs.

106 : base(new MyMemberDescriptor(name))
107 {
108 mName = name;
109 PropertyType = proptype;
110 AddAttribute(new DefaultUnitAttribute(unit));
111 }

References AddAttribute(), mName, and PropertyType.

Member Function Documentation

◆ AddAttribute()

void MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor.AddAttribute ( Attribute someAttr)

Definition at line 113 of file MockDynamicProperties.cs.

114 {
115 mExtraAttributes.Add(someAttr);
116 }

References mExtraAttributes.

Referenced by MyPropertyDescriptor().

◆ CanResetValue()

override bool MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor.CanResetValue ( object component)

Definition at line 143 of file MockDynamicProperties.cs.

144 {
145 return false;
146 }

◆ FillAttributes()

override void MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor.FillAttributes ( System.Collections.IList attributeList)
protected

Definition at line 118 of file MockDynamicProperties.cs.

119 {
120 base.FillAttributes(attributeList);
121 foreach (var someAttr in mExtraAttributes)
122 {
123 attributeList.Add(someAttr);
124 }
125 }

References mExtraAttributes.

◆ GetValue()

override object MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor.GetValue ( object component)

Definition at line 136 of file MockDynamicProperties.cs.

137 {
138 ((FlexibleArguments) component).mPropsValues.TryGetValue(mName, out var retval);
139 return retval;
140 }

References MockPlugin.Tasks.FlexibleArguments.FlexibleArguments(), mName, and MockPlugin.Tasks.FlexibleArguments.mPropsValues.

◆ ResetValue()

override void MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor.ResetValue ( object component)

Definition at line 148 of file MockDynamicProperties.cs.

149 {
150 // nothing
151 }

◆ SetValue()

override void MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor.SetValue ( object component,
object value )

Definition at line 131 of file MockDynamicProperties.cs.

132 {
133 ((FlexibleArguments) component).mPropsValues[mName] = value;
134 }

References MockPlugin.Tasks.FlexibleArguments.FlexibleArguments(), mName, and MockPlugin.Tasks.FlexibleArguments.mPropsValues.

◆ ShouldSerializeValue()

override bool MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor.ShouldSerializeValue ( object component)

Definition at line 155 of file MockDynamicProperties.cs.

156 {
157 return true;
158 }

Member Data Documentation

◆ mExtraAttributes

readonly List<Attribute> MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor.mExtraAttributes = new List<Attribute>()
private

Definition at line 102 of file MockDynamicProperties.cs.

Referenced by AddAttribute(), and FillAttributes().

◆ mName

readonly string MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor.mName
private

Definition at line 103 of file MockDynamicProperties.cs.

Referenced by GetValue(), MyPropertyDescriptor(), and SetValue().

Property Documentation

◆ ComponentType

override Type MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor.ComponentType
get

Definition at line 129 of file MockDynamicProperties.cs.

◆ IsReadOnly

override bool MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor.IsReadOnly
get

Definition at line 153 of file MockDynamicProperties.cs.

◆ PropertyType

override Type MockPlugin.Tasks.FlexibleArguments.MyPropertyDescriptor.PropertyType
get

Definition at line 127 of file MockDynamicProperties.cs.

127{ get; }

Referenced by MyPropertyDescriptor().


The documentation for this class was generated from the following file: