public static VariantType NewMaybe(VariantType element) { VariantType result = new VariantType(); result.handle = g_variant_type_new_maybe(element == null ? IntPtr.Zero : element.Handle); return(result); }
public static VariantType NewDictionaryEntry(VariantType key, VariantType value) { VariantType result = new VariantType(); result.handle = g_variant_type_new_dict_entry(key == null ? IntPtr.Zero : key.Handle, value == null ? IntPtr.Zero : value.Handle); return(result); }
public static VariantType NewTuple(VariantType[] items) { VariantType result = new VariantType(); IntPtr[] native = new IntPtr [items.Length]; for (int i = 0; i < items.Length; i++) { native [i] = items [i].Handle; } result.handle = g_variant_type_new_tuple(native, native.Length); return(result); }
public Variant(IDictionary <string, Variant> dict) { VariantType type = VariantType.NewDictionaryEntry( VariantType.String, VariantType.Variant); var pairs = new List <Variant> (); foreach (var kvp in dict) { pairs.Add(NewDictEntry(new Variant(kvp.Key), NewVariant(kvp.Value))); } handle = g_variant_ref_sink(NewArray(type, pairs.ToArray()).Handle); }
public static Variant NewArray(VariantType type, Variant[] children) { if (children == null) { if (type == null) { throw new ArgumentException("The type and children parameters cannot be both null"); } else { return(new Variant(g_variant_new_array(type.Handle, null, new UIntPtr(0ul)))); } } IntPtr[] native = new IntPtr[children.Length]; for (int i = 0; i < children.Length; i++) { native[i] = children[i].Handle; } return(new Variant(g_variant_new_array(type == null ? (IntPtr)null : type.Handle, native, new UIntPtr((ulong)children.Length)))); }
public bool IsSubtypeOf(VariantType supertype) { return(g_variant_type_is_subtype_of(Handle, supertype == null ? IntPtr.Zero : supertype.Handle)); }
public static Variant NewArray (VariantType type, Variant[] children) { if (children == null) { if (type == null) { throw new ArgumentException ("The type and children parameters cannot be both null"); } else { return new Variant (g_variant_new_array (type.Handle, null, new UIntPtr (0ul))); } } IntPtr[] native = new IntPtr[children.Length]; for (int i = 0; i < children.Length; i++) native[i] = children[i].Handle; return new Variant (g_variant_new_array (type == null ? (IntPtr) null : type.Handle, native, new UIntPtr ((ulong) children.Length))); }
public bool IsSubtypeOf(VariantType supertype) { return g_variant_type_is_subtype_of (Handle, supertype == null ? IntPtr.Zero : supertype.Handle); }
public static VariantType NewTuple(VariantType[] items) { VariantType result = new VariantType (); IntPtr[] native = new IntPtr [items.Length]; for (int i = 0; i < items.Length; i++) native [i] = items [i].Handle; result.handle = g_variant_type_new_tuple (native, native.Length); return result; }
public static VariantType NewMaybe(VariantType element) { VariantType result = new VariantType (); result.handle = g_variant_type_new_maybe (element == null ? IntPtr.Zero : element.Handle); return result; }
public static VariantType NewDictionaryEntry(VariantType key, VariantType value) { VariantType result = new VariantType (); result.handle = g_variant_type_new_dict_entry (key == null ? IntPtr.Zero : key.Handle, value == null ? IntPtr.Zero : value.Handle); return result; }