/// <summary> /// Create an immutabe string property /// </summary> private PropertyDescriptor GetImmutableStringProperty(string name, string value) { return(new PropertyDescriptor { Configurable = false, Enumerable = true, IsOwn = true, Writable = false, Name = name, Value = RemoteObjectCreator.Create(value) }); }
private ConsoleAPICalledEvent GetLogEvent(string logMessage, string level) { var logEvent = new ConsoleAPICalledEvent { Type = level, Timestamp = DateTimeOffset.Now.ToUnixTimeMilliseconds(), ExecutionContextId = Context, Args = new RemoteObject[] { RemoteObjectCreator.Create(logMessage) } }; return(logEvent); }
/// <summary> /// Try to create an immutable number property for the object /// </summary> /// <param name="name">property name</param> /// <param name="value">generic value</param> /// <returns>null if the value cannot converted to double</returns> private PropertyDescriptor TryGetImmutableNumberProperty(string name, object value) { if (value == null) { return(null); } try { return(new PropertyDescriptor { Configurable = false, Enumerable = true, IsOwn = true, Writable = false, Name = name, Value = RemoteObjectCreator.Create(Convert.ToDouble(value)) }); } catch { return(null); } }
protected virtual RemoteObject Evaluate(string expr) { return(RemoteObjectCreator.Create("Not implemented")); }