OSDMap options = new OSDMap(); options["name"] = "John"; options["age"] = 30; if (options.ContainsKey("name")) { Console.WriteLine("Name is present!"); }
OSDMap options = new OSDMap(); options.Parse(args); if (options.ContainsKey("help")) { Console.WriteLine("Displaying Help..."); } else { // Application logic }In this example, the OSDMap is populated with command line arguments using the Parse method. The ContainsKey method is then used to check whether the "help" argument was provided, and a corresponding message is displayed if it was. Overall, OSDMap is a useful class for managing key-value pairs in C# applications, particularly when dealing with command line arguments.