예제 #1
0
        public IPyValue MakeSetValueExpression(IPyValue v)
        {
            if (TranslationInfo == null)
            {
                throw new ArgumentNullException("translationInfo");
            }
            if (TranslationInfo.IsStatic)
            {
                throw new NotSupportedException();
            }

            if (TranslationInfo.GetSetByMethod)
            {
                var a = new PyMethodCallExpression(TranslationInfo.SetMethodName);
                a.Arguments.Add(new PyMethodInvokeValue(v));
                a.TargetObject = TargetObject;
                return(a);
            }
            else
            {
                var a = new PyInstanceFieldAccessExpression(TranslationInfo.FieldScriptName, TargetObject, null);
                var b = new PyAssignExpression(a, v);
                return(b);
            }
        }
예제 #2
0
        // Public Methods 


        public static PyMethodCallExpression MakeConstructor(string constructedClassName,
                                                             MethodTranslationInfo translationInfo, params IPyValue[] args)
        {
            var methodCallExpression = new PyMethodCallExpression(ConstructorMethodName, args);

            methodCallExpression.SetClassName((PyQualifiedName)constructedClassName, translationInfo);
            return(methodCallExpression);
        }