Seldom used, this allows to access the reference itself, while AsMap, AsList and AsValue access the referenced Object.
Declaration Syntax
C# |
public override Reference AsReference()
Return Value
Returns itself
Remarks
Normally there is no need to access References, they just work their Targets are supposed to work.
Examples
CopyC#
Sofu.Sofu.Map stuff = new Sofu.Sofu.Map(); stuff.SetAttribute("vally",new Sofu.Sofu.Reference("valref",new Sofu.Sofu.Value("Hello World"))); Console.Out.WriteLine(stuff.Object("vally").AsReference().ToString()); //Will write "selfref" Console.Out.WriteLine(stuff.Object("vally").AsValue().ToString()); //Will write "Hello World"
Exceptions
Exception | Condition |
---|---|
SofuNotReferenceException | When this is not a Reference |