Sofu Documentation
IsReference Method
NamespacesSofu.SofuReferenceIsReference()()()
Identifies itself as a Reference.
Declaration Syntax
C#
public override bool IsReference()
Return Value
Returns true
Remarks
This only works if called with Object() or in foreach().
Examples
CopyC#
Sofu.Sofu.Map stuff = new Sofu.Sofu.Map();
            stuff.SetAttribute("Self",new Sofu.Sofu.Reference("selfref",stuff));
            if (stuff.Object("Self").IsReference()) { //true;
                Console.WriteLine("I'm a Reference");
            }
            if (stuff.map("Self").IsReference()) { //map fetches the target of the Reference.
                Console.WriteLine("This shouldn't happen");
            }
            foreach (KeyValuePair<string,Sofu.SofuObject> entry in stuff) {
                if (entry.Value.IsReference()) {
                    Console.WriteLine("I'm still a Reference");
                }
                if (entry.Value.AsMap().IsReference()) { //AsMap fetches the Target, 
                    Console.WriteLine("This shouldn't happen");
                }
            }

Assembly: Sofu (Module: Sofu) Version: 0.2.1.0 (0.2.1.0)