Example #1
0
        public static PlistNode FromPlist(plist_t node, PlistStructure parent = null)
        {
            plist_type type = plist.plist_get_node_type(node);

            switch (type)
            {
            case plist_type.PLIST_DICT: return(new PlistDictionary(node, parent));

            case plist_type.PLIST_ARRAY: return(new PlistArray(node, parent));

            case plist_type.PLIST_BOOLEAN: return(new PlistBoolean(node, parent));

            case plist_type.PLIST_UINT: return(new PlistInteger(node, parent));

            case plist_type.PLIST_REAL: return(new PlistReal(node, parent));

            case plist_type.PLIST_STRING: return(new PlistString(node, parent));

            case plist_type.PLIST_KEY: return(new PlistKey(node, parent));

            case plist_type.PLIST_UID: return(new PlistUid(node, parent));

            case plist_type.PLIST_DATE: return(new PlistDate(node, parent));

            case plist_type.PLIST_DATA: return(new PlistData(node, parent));

            default: throw new NotSupportedException();
            }
        }
Example #2
0
        private static PlistStructure ImportStruct(plist_t root)
        {
            plist_type type = plist.plist_get_node_type(root);

            switch (type)
            {
            case plist_type.PLIST_ARRAY:
            case plist_type.PLIST_DICT:
                return((PlistStructure)FromPlist(root));

            default:
                throw new NotSupportedException();
            }
        }