Ejemplo n.º 1
0
        /// <summary>
        /// Get the ParseInstance pointed to by a field.
        /// </summary>
        /// <param name="key">
        /// A <see cref="System.String"/>
        /// </param>
        /// <returns>
        /// A <see cref="ParseInstance"/>
        /// </returns>
        public ParseInstance GetPointer(string key)
        {
            var h = json[key] as Hashtable;

            if (h == null)
            {
                return(null);
            }
            if ("Pointer" == (string)h["__type"])
            {
                var           className = (string)h["className"];
                ParseInstance pi;
                if (className == "_User")
                {
                    pi = ParseClass.users.Get((string)h["objectId"]);
                }
                else
                {
                    pi = new ParseClass("/classes/" + className).Get((string)h["objectId"]);
                }
                return(pi);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Find all instances in otherClass which reference this instance in the field identified by key.
        /// </summary>
        /// <param name="otherClass">
        /// A <see cref="ParseClass"/>
        /// </param>
        /// <param name="key">
        /// A <see cref="System.String"/>
        /// </param>
        /// <returns>
        /// A <see cref="ParseInstanceCollection"/>
        /// </returns>
        public ParseInstanceCollection FindReferencesIn(ParseClass otherClass, string key)
        {
            var q = "where={\"" + key + "\": {\"__type\":\"Pointer\", \"className\":\"" + parseClass.className + "\", \"objectId\":\"" + objectId + "\"}} ";

            return(otherClass.List(q));
        }
Ejemplo n.º 3
0
 public ParseInstance(ParseClass parseClass)
 {
     this.parseClass = parseClass;
 }
Ejemplo n.º 4
0
 public ParseInstanceCollection(ParseClass parseClass)
 {
     this.parseClass = parseClass;
 }