Esempio n. 1
0
        // Operations


        /// <summary>
        /// Creates a new object of given classname
        /// </summary>
        /// <param name="classname">Classname.</param>
        /// <param name="parameters">Parameters.</param>
        public object Create(string classname, params object[] parameters)
        {
            // send request
            var req = new CLRCreateMessage(classname, parameters);

            CLRMessage.Write(_cout, req);

            // get response
            return(CLRMessage.ReadValue(_cin));
        }
Esempio n. 2
0
        /// <summary>
        /// Calls the named static method.
        /// </summary>
        /// <returns>
        /// The return of static method call
        /// </returns>
        /// <param name='classname'>
        /// class name.
        /// </param>
        /// <param name='method'>
        /// Method name.
        /// </param>
        /// <param name='parameters'>
        /// Parameters.
        /// </param>
        public object CallStaticMethodByName(string classname, string method, params object[] parameters)
        {
            // send request
            var req = new CLRCallStaticMethodMessage(classname, method, parameters);

            CLRMessage.Write(_cout, req);

            // get response
            return(CLRMessage.ReadValue(_cin));
        }
Esempio n. 3
0
        /// <summary>
        /// Sets the named property
        /// </summary>
        /// <param name='classname'>
        /// class name
        /// </param>
        /// <param name='name'>
        /// Name.
        /// </param>
        /// <param val='value'>
        /// property value
        /// </param>
        public void SetStaticProperty(string classname, string name, object val)
        {
            // send request
            var req = new CLRSetStaticPropertyMessage(classname, name, val);

            CLRMessage.Write(_cout, req);

            // get response (to make sure is not an exception)
            CLRMessage.ReadValue(_cin);
        }
Esempio n. 4
0
        /// <summary>
        /// Gets the named property
        /// </summary>
        /// <param name='classname'>
        /// class name
        /// </param>
        /// <param name='name'>
        /// Name.
        /// </param>
        public object GetStaticProperty(string classname, string name)
        {
            // send request
            var req = new CLRGetStaticPropertyMessage(classname, name);

            CLRMessage.Write(_cout, req);

            // get response
            return(CLRMessage.ReadValue(_cin));
        }
Esempio n. 5
0
        /// <summary>
        /// Gets the ith element of collection
        /// </summary>
        /// <param name='type'>
        /// Type.
        /// </param>
        /// <param name='ith'>
        /// Index.
        /// </param>
        public object GetIndexed(object obj, int ith)
        {
            // send request
            var req = new CLRGetIndexedMessage(obj, ith);

            CLRMessage.Write(_cout, req);

            // get response
            return(CLRMessage.ReadValue(_cin));
        }
Esempio n. 6
0
        /// <summary>
        /// Gets the named property
        /// </summary>
        /// <param name='type'>
        /// Type.
        /// </param>
        /// <param name='name'>
        /// Name.
        /// </param>
        public object GetProperty(object obj, string name)
        {
            // send request
            var req = new CLRGetPropertyMessage(obj, name);

            CLRMessage.Write(_cout, req);

            // get response
            return(CLRMessage.ReadValue(_cin));
        }
Esempio n. 7
0
        /// <summary>
        /// Calls the named method, finding the one with the best match
        /// </summary>
        /// <returns>
        /// The return of static method call
        /// </returns>
        /// <param name='type'>
        /// Type.
        /// </param>
        /// <param name='name'>
        /// Name.
        /// </param>
        /// <param name='parameters'>
        /// Parameters.
        /// </param>
        public object CallMethod(object obj, string name, params object[] parameters)
        {
            // send request
            var req = new CLRCallMethodMessage(obj, name, parameters);

            CLRMessage.Write(_cout, req);

            // get response
            return(CLRMessage.ReadValue(_cin));
        }