Creates a new Reference with target information and a target
Declaration Syntax
C# |
public Reference( string target, SofuObject tObject )
Parameters
- target (String)
- Way to the target
- tObject (SofuObject)
- The target itself
Examples
CopyC#
Sofu.Sofu.Map mymap = new Sofu.Sofu.Map(); mymap.SetAttribute("MyList",new Sofu.Sofu.List()); mymap.SetAttribute("MyRef",new Sofu.Sofu.Reference("someref", mymap.list("MyList"))); if (mymap.Object("MyRef").IsReference()) { Console.Out.WriteLine("MyRef is a Reference"); } if (mymap.Object("MyList").IsList()) { Console.Out.WriteLine("MyList is a (real) List"); } if (mymap.Object("MyRef").IsList()) { Console.Out.WriteLine("MyRef is also (real) List"); } if (mymap.list("MyRef") == mymap.list("myList")) { Console.Out.WriteLine("Both are the same List"); } if (mymap.Object("MyRef") == mymap.Object("myList")) { //note the Object() Console.Out.WriteLine("Both are the same Object"); //Won't happen } else { Console.Out.WriteLine("Both aren't the same Object"); //Will happen }