Stetic.ObjectWrapper.GenerateObjectCreation C# (CSharp) Method

GenerateObjectCreation() protected method

protected GenerateObjectCreation ( GeneratorContext ctx ) : System.CodeDom.CodeExpression
ctx GeneratorContext
return System.CodeDom.CodeExpression
        protected internal virtual CodeExpression GenerateObjectCreation(GeneratorContext ctx)
        {
            if (ClassDescriptor.InitializationProperties != null) {
                CodeExpression[] paramters = new CodeExpression [ClassDescriptor.InitializationProperties.Length];
                for (int n=0; n < paramters.Length; n++) {
                    PropertyDescriptor prop = ClassDescriptor.InitializationProperties [n];
                    paramters [n] = ctx.GenerateValue (prop.GetValue (Wrapped), prop.RuntimePropertyType, prop.Translatable && prop.IsTranslated (Wrapped));
                }
                return new CodeObjectCreateExpression (WrappedTypeName, paramters);
            } else
                return new CodeObjectCreateExpression (WrappedTypeName);
        }