Exemple #1
0
        public GenFunction(GenClass gc, MethodInfo info)
            : base(gc, info)
        {
            Name = info.Name;
            Info = info;

            NameUnique = Name;

            int nCount = 0;

            foreach (var fun in gc.Functions)
            {
                if (fun.Name == Name)
                {
                    nCount++;
                }
            }

            if (nCount > 0)
            {
                NameUnique += nCount.ToString();
            }

            IsVoidReturn   = info.ReturnParameter.ParameterType == typeof(void);
            IsStringReturn = info.ReturnParameter.ParameterType == typeof(String);

            ReturnNativeType  = GenParameter.GetParameterNativeType(info.ReturnParameter.ParameterType);
            ReturnManagedType = GenParameter.GetParameterManagedType(info.ReturnParameter.ParameterType);

            ReturnManagedName = GenParameter.GetParameterManagedCallName("res", info.ReturnParameter.ParameterType);
            ReturnNativeName  = GenParameter.GetParameterNativeCallName(gc.Name, "res", info.ReturnParameter.ParameterType);

            ReturnManagedDefault = GetManagedDefault(info.ReturnParameter.ParameterType);
            ReturnNativeDefault  = GetNativeDefault(info.ReturnParameter.ParameterType);
        }
Exemple #2
0
        public GenProperty(GenClass gc, PropertyInfo info)
        {
            Info = info;
            Name = info.Name;

            SetNativeName  = GenParameter.GetParameterNativeCallName(gc.Name, "Value", info.PropertyType);
            SetManagedName = GenParameter.GetParameterManagedCallName("Value", info.PropertyType);

            NativeType = GenParameter.GetParameterNativeType(info.PropertyType);
            IsString   = (info.PropertyType == typeof(String));

            if (info.PropertyType.IsClass)
            {
                ReturnManagedType  = info.PropertyType.FullName.Replace(".", "::");
                ReturnManagedType += "^";
            }
            else
            {
                ReturnManagedType = NativeType;
            }

            ReturnNativeName  = GenParameter.GetParameterNativeCallName(gc.Name, "res", info.PropertyType);
            ReturnManagedName = GenParameter.GetParameterManagedCallName("res", info.PropertyType);
        }