How To Retrieve Values From The Shared Dictionary

Toolkits.HowToRetrieveValuesFromTheSharedDictionary History

Hide minor edits - Show changes to output

Added lines 1-44:
[[Toolkits.Networking | << Back to the .Networking page]]
\\
\\


'''Integer:''' retrieves an integer from a shared dictionary called SD at the path /value:

(:source lang=csharp tabwidth=2 :) [=
int x = (int) this.SD.GetEntry("/value").Value;
=]


'''String:''' retrieves a string from a shared dictionary called SD at the path /value:

(:source lang=csharp tabwidth=2 :) [=
string y = this.SD.GetEntry("/value").Value.ToString();
=]

'''Vector:''' retrieves a vector from a shared dictionary called SD at the path /value:

(:source lang=csharp tabwidth=2 :) [=
SharedDictionary.Vector v = this.SD["/value"] as SharedDictionary.Vector;
=]


'''Vector Elements:''' retrieves an integer from the last element of a vector. The vector is in the shared dictionary called SD at the path /value.

(:source lang=csharp tabwidth=2 :) [=
SharedDictionary.Vector v = this.SD["/value"] as SharedDictionary.Vector;
int z = (int) v[0];
=]


'''Subscription Notifications:''' retrieves a string from the shared dictionary during a subscription notification.

(:source lang=csharp tabwidth=2 :) [=
private void sub_Notified(object sender, SubscriptionEventArgs e)
{
string location = (string) e.Entry.Value;
}
=]


\\