Exemplo n.º 1
0
        public Object (string id, string parentId, ObjectOptions options)
        {
            if (id == null) {
                throw new ArgumentNullException ("id");
            } else if (parentId == null) {
                throw new ArgumentNullException ("parentId");
            } else if (options == null) {
                throw new ArgumentNullException ("options");
            }

            Id = id;
            ParentId = parentId;
            Title = options.Title;
            Creator = options.Creator;
            WriteStatus = options.WriteStatus;
            IsRestricted = options.IsRestricted;
            Resources = Helper.MakeReadOnlyCopy (options.Resources);
            Class = new Class (ClassManager.GetClassNameFromType (GetType ()));
        }
Exemplo n.º 2
0
        protected virtual void DeserializePropertyElement(XmlReader reader)
        {
            if (reader == null) throw new ArgumentNullException ("reader");

            if (reader.NamespaceURI == Schemas.DidlLiteSchema) {
                if (reader.LocalName == "res") {
                    resource_list.Add (new Resource (reader));
                } else {
                    reader.Skip (); // This is a workaround for Mono bug 334752
                }
            } else if (reader.NamespaceURI == Schemas.UpnpSchema) {
                switch (reader.LocalName) {
                case "class":
                    Class = new Class (reader);
                    has_class = true;
                    break;
                case "writeStatus":
                    // TODO parse here
                    break;
                default: // This is a workaround for Mono bug 334752
                    reader.Skip ();
                    break;
                }
            } else if (reader.NamespaceURI == Schemas.DublinCoreSchema) {
                switch (reader.LocalName) {
                case "title":
                    Title = reader.ReadString ();
                    break;
                case "creator":
                    Creator = reader.ReadString ();
                    break;
                default: // This is a workaround for Mono bug 334752
                    reader.Skip ();
                    break;
                }
            } else { // This is a workaround for Mono bug 334752
                reader.Skip ();
            }
        }