コード例 #1
0
        private DotNetFunctionData ChangeFunctionParamsToEnums(DotNetFunctionData function, IEnumerable<XmlCommandParamData> @params)
        {
            var copy = function.Clone();
            copy.IsNative = false;

            foreach (var param in @params)
            {
                var dotNetParam = copy.Params.Single(x => x.OriginalName == param.Name);

                dotNetParam.DotNetType = param.TypeGroup;
                dotNetParam.IsEnum = true;
            }

            return copy;
        }
コード例 #2
0
        private DotNetFunctionData ChangeFunctionParamsToIntPtr(DotNetFunctionData function, IEnumerable<string> @params)
        {
            var copy = function.Clone();
            copy.IsNative = false;

            foreach (var param in copy.Params.Where(x => @params.Contains(x.OriginalName)))
            {
                param.DotNetType = "IntPtr";
                param.ShouldUseGenerics = false;
                param.ShouldUseFixed = false;
            }

            if (!copy.Params.Any(x => x.IsPointer))
                copy.IsUnsafe = false;

            if (!copy.Params.Any(x => x.ShouldUseGenerics))
                copy.ShouldUseGenerics = false;

            return copy;
        }
コード例 #3
0
        private DotNetFunctionData ChangeFunctionParamsToRefOrOut(DotNetFunctionData function, IEnumerable<string> @params)
        {
            var copy = function.Clone();
            copy.IsNative = false;

            //if (function.OriginalName == "glShaderBinary")
            //	Console.WriteLine("Stop");

            foreach (var param in copy.Params.Where(x => @params.Contains(x.OriginalName)))
            {
                param.DotNetType = param.DotNetType.Replace("[]", "");

                if (param.IsOutput)
                {
                    param.ShouldUseOut = true;
                }
                else
                {
                    param.ShouldUseRef = true;
                }

                param.ShouldUseAddressOfOperator = true;
            }

            return copy;
        }