Exemple #1
0
 /// <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)
     });
 }
Exemple #2
0
        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);
        }
Exemple #3
0
        /// <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);
            }
        }
Exemple #4
0
 protected virtual RemoteObject Evaluate(string expr)
 {
     return(RemoteObjectCreator.Create("Not implemented"));
 }