and Bricscad
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Dynamic;
using BricscadApp;
using BricscadDb;
using RxNet.ApplicationServices;
using RxNet.DatabaseServices;
using RxNet.Runtime;
using RxNet.Geometry;
using RxNet.RxGlobal;
namespace Bricscad
{
public class DynamicDictionary : DynamicObject
{
Dictionary<string, object>
_dictionary = new Dictionary<string, object>();
public override bool TrySetMember(SetMemberBinder binder, object value)
{
_dictionary[binder.Name] = value;
return true;
}
public override bool TryGetMember(GetMemberBinder binder,
out object result)
{
return _dictionary.TryGetValue(binder.Name, out result);
}
}
public static class Commands
{
[CommandMethod("doit")]
public static void Doit()
{
dynamic dict = new DynamicDictionary();
dict.Foo = "Some Value";
dict.Bar = 123;
dict.Beer = "beer";
GlobalFunctions.Printf("Foo: {0}, Bar: {1} , Beer: {2}", dict.Foo, dict.Bar, dict.Beer);
}
}
}