Exemple #1
0
        public string FromNative(string var)
        {
            if (IGen == null)
            {
                return(string.Empty);
            }

            if (ElementType != string.Empty)
            {
                string args = (owned ? "true" : "false") + ", " + (elements_owned ? "true" : "false");
                if (IGen.QualifiedName == "GLib.PtrArray")
                {
                    return(string.Format("({0}[]) GLib.Marshaller.PtrArrayToArray ({1}, {2}, typeof({0}))", ElementType, var, args));
                }
                else
                {
                    return(string.Format("({0}[]) GLib.Marshaller.ListPtrToArray ({1}, typeof({2}), {3}, typeof({0}))", ElementType, var, IGen.QualifiedName, args));
                }
            }
            else if (IGen is HandleBase)
            {
                return(((HandleBase)IGen).FromNative(var, owned));
            }
            else if (is_null_term)
            {
                return(string.Format("GLib.Marshaller.NullTermPtrToStringArray ({0}, {1})", var, owned ? "true" : "false"));
            }
            else
            {
                return(IGen.FromNativeReturn(var));
            }
        }