MCPcopy Create free account
hub / github.com/NodeRT/NodeRT / TryGetMember

Method TryGetMember

src/NodeRTLib/Reflector.cs:781–803  ·  view source on GitHub ↗

If you try to get a value of a property not defined in the class, this method is called.

(
            GetMemberBinder binder, out object result)

Source from the content-addressed store, hash-verified

779 // If you try to get a value of a property
780 // not defined in the class, this method is called.
781 public override bool TryGetMember(
782 GetMemberBinder binder, out object result)
783 {
784 string name = binder.Name;
785
786 // If the property name is found in a dictionary,
787 // set the result parameter to the property value and return true.
788 // Otherwise, try to load the template.
789 if (!dictionary.TryGetValue(name, out result))
790 {
791 Func<dynamic, String> template = TX.LazyTemplate(name, this.templateLocation, this.templateExtension);
792 if (template != null)
793 {
794 dictionary[name] = template;
795 result = template;
796 return true;
797 }
798
799 return false;
800 }
801
802 return true;
803 }
804
805 // If you try to set a value of a property that is
806 // not defined in the class, this method is called.

Callers

nothing calls this directly

Calls 1

LazyTemplateMethod · 0.80

Tested by

no test coverage detected