public static void AddStaticMethod(this Environment environment, string name, System.Type type, string methodName) { var method = type.RTGetMethod(methodName); if (method != null && method.IsStatic) { var boundVariable = new BoundVariable(name, null, method); environment.AddVariable(boundVariable); } }
public static void AddStaticProperty(this Environment environment, string name, System.Type type, string propertyName) { var property = type.RTGetProperty(propertyName); if (property != null && property.RTIsStatic()) { var boundVariable = new BoundVariable(name, null, property); environment.AddVariable(boundVariable); } }
public static void AddBoundMethod(this Environment environment, string name, object target, string methodName) { var method = target.GetType().RTGetMethod(methodName); if (method != null && !method.IsStatic) { var boundVariable = new BoundVariable(name, target, method); environment.AddVariable(boundVariable); } }
public static void AddBoundProperty(this Environment environment, string name, object target, string propertyName) { var property = target.GetType().RTGetProperty(propertyName); if (property != null && !property.RTIsStatic()) { var boundVariable = new BoundVariable(name, target, property); environment.AddVariable(boundVariable); } }
public static void AddStaticMethod(this Environment environment, string name, System.Type type, MethodInfo method) { var boundVariable = new BoundVariable(name, null, method); environment.AddVariable(boundVariable); }
public static void AddStaticProperty(this Environment environment, string name, System.Type type, PropertyInfo property) { var boundVariable = new BoundVariable(name, null, property); environment.AddVariable(boundVariable); }
public static void AddBoundMethod(this Environment environment, string name, object target, MethodInfo method) { var boundVariable = new BoundVariable(name, target, method); environment.AddVariable(boundVariable); }
public static void AddBoundProperty(this Environment environment, string name, object target, PropertyInfo property) { var boundVariable = new BoundVariable(name, target, property); environment.AddVariable(boundVariable); }
///---------------------------------------------------------------------------------------------- public static void AddVariable(this Environment environment, string name, object target) { environment.AddVariable(name, target, target.GetType()); }