예제 #1
0
        public override void OnEnter()
        {
            if (!PlayMakerParseProxy.IsPropertyKeyValid(propertyKey.Value))
            {
                LogError("Property Key name invalid");
                Fsm.Event(errorEvent);
                Finish();
            }

            ParseQuery <ParseObject> _query = PlayMakerParseProxy.GetParseObjectQuery(queryId.Value);

            if (_query == null)
            {
                LogError("retrieving query failed");
                Fsm.Event(errorEvent);
                Finish();
            }

            if (where == ParseExistsClauses.Exists)
            {
                _query = _query.WhereExists(propertyKey.Value);
            }
            else if (where == ParseExistsClauses.DoesNotExist)
            {
                _query = _query.WhereDoesNotExist(propertyKey.Value);
            }

            PlayMakerParseProxy.CacheParseObjectQuery(queryId.Value, _query);

            Fsm.Event(successEvent);
            Finish();
        }
예제 #2
0
 public override string ErrorCheck()
 {
     if (!PlayMakerParseProxy.IsPropertyKeyValid(propertyKey.Value))
     {
         return("Parse Property must only contain alphanumeric or underscore characters, and must begin with a letter");
     }
     return("");
 }
예제 #3
0
        public override void OnEnter()
        {
            if (!PlayMakerParseProxy.IsPropertyKeyValid(className.Value))
            {
                LogWarning("Parse Class must only contain alphanumeric or underscore characters, and must begin with a letter");
                Fsm.Event(errorEvent);
                Finish();
                return;
            }

            _task = ParseObject.GetQuery(className.Value).GetAsync(objectId.Value);
        }
예제 #4
0
        public override void OnEnter()
        {
            if (!PlayMakerParseProxy.IsPropertyKeyValid(orderBy.Value))
            {
                LogError("orderBy Class name invalid");
                Fsm.Event(errorEvent);
                Finish();
            }

            if (!thenBy.IsNone && !PlayMakerParseProxy.IsPropertyKeyValid(thenBy.Value))
            {
                LogError("thenBy Class name invalid");
                Fsm.Event(errorEvent);
                Finish();
            }


            ParseQuery <ParseObject> _query = PlayMakerParseProxy.GetParseObjectQuery(queryId.Value);

            if (_query == null)
            {
                LogError("retrieving query failed");
                Fsm.Event(errorEvent);
                Finish();
            }

            if (descending.Value)
            {
                _query = _query.OrderBy(orderBy.Value);
            }
            else
            {
                _query = _query.OrderByDescending(orderBy.Value);
            }

            if (!thenBy.IsNone)
            {
                if (thenByDescending.Value)
                {
                    _query = _query.ThenBy(thenBy.Value);
                }
                else
                {
                    _query = _query.ThenByDescending(thenBy.Value);
                }
            }

            PlayMakerParseProxy.CacheParseObjectQuery(queryId.Value, _query);

            Fsm.Event(successEvent);
            Finish();
        }
예제 #5
0
        public override string ErrorCheck()
        {
            if (!PlayMakerParseProxy.IsPropertyKeyValid(orderBy.Value))
            {
                return("Parse order by name must only contain alphanumeric or underscore characters, and must begin with a letter");
            }

            if (!thenBy.IsNone && !PlayMakerParseProxy.IsPropertyKeyValid(thenBy.Value))
            {
                return("Parse order by name must only contain alphanumeric or underscore characters, and must begin with a letter");
            }
            return("");
        }
예제 #6
0
        public override void OnEnter()
        {
            if (!PlayMakerParseProxy.IsPropertyKeyValid(className.Value))
            {
                LogError("Class name invalid");
                Fsm.Event(errorEvent);
                Finish();
            }

            _object = new ParseObject(className.Value);

            if (useAcl)
            {
                ParseUser _aclOwner;

                if (AclOwnerObjectId.IsNone)
                {
                    _aclOwner = ParseUser.CurrentUser;
                }
                else
                {
                    _aclOwner = (ParseUser)PlayMakerParseProxy.GetParseObject(AclOwnerObjectId.Value);
                }

                if (_aclOwner != null)
                {
                    _object.ACL = new ParseACL(_aclOwner)
                    {
                        PublicReadAccess  = AclReadAccess.Value,
                        PublicWriteAccess = AclWriteAccess.Value
                    };
                }
                else
                {
                    LogError("ACL Owner is null.If you target the current user, make sure a user is logged in");
                    Fsm.Event(errorEvent);
                    Finish();
                }
            }

            bool ok = PlayMakerParseProxy.SetParsePropertyFromFsmVar(_object, property.Value, this.Fsm, value);

            if (!ok)
            {
                LogError("Set parse property failed");
                Fsm.Event(errorEvent);
                Finish();
            }

            _task = _object.SaveAsync();
        }
예제 #7
0
        public override void OnEnter()
        {
            if (!PlayMakerParseProxy.IsPropertyKeyValid(propertyKey.Value))
            {
                LogError("Property Key name invalid");
                Fsm.Event(errorEvent);
                Finish();
            }

            ParseQuery <ParseObject> _query = PlayMakerParseProxy.GetParseObjectQuery(queryId.Value);

            if (_query == null)
            {
                LogError("retrieving query failed");
                Fsm.Event(errorEvent);
                Finish();
            }

            if (where == ParseComparisonClauses.EqualTo)
            {
                _query = _query.WhereEqualTo(propertyKey.Value, PlayMakerParseProxy.GetParseValueFromFsmVar(this.Fsm, propertyValue));
            }
            else if (where == ParseComparisonClauses.NotEqualTo)
            {
                _query = _query.WhereNotEqualTo(propertyKey.Value, PlayMakerParseProxy.GetParseValueFromFsmVar(this.Fsm, propertyValue));
            }
            else if (where == ParseComparisonClauses.LessThan)
            {
                _query = _query.WhereLessThan(propertyKey.Value, PlayMakerParseProxy.GetParseValueFromFsmVar(this.Fsm, propertyValue));
            }
            else if (where == ParseComparisonClauses.LessThanOrEqualTo)
            {
                _query = _query.WhereLessThanOrEqualTo(propertyKey.Value, PlayMakerParseProxy.GetParseValueFromFsmVar(this.Fsm, propertyValue));
            }
            else if (where == ParseComparisonClauses.GreaterThan)
            {
                _query = _query.WhereGreaterThan(propertyKey.Value, PlayMakerParseProxy.GetParseValueFromFsmVar(this.Fsm, propertyValue));
            }
            else if (where == ParseComparisonClauses.GreaterThanOrEqualTo)
            {
                _query = _query.WhereGreaterThanOrEqualTo(propertyKey.Value, PlayMakerParseProxy.GetParseValueFromFsmVar(this.Fsm, propertyValue));
            }

            PlayMakerParseProxy.CacheParseObjectQuery(queryId.Value, _query);

            Fsm.Event(successEvent);
            Finish();
        }
예제 #8
0
        public override void OnEnter()
        {
            if (!PlayMakerParseProxy.IsPropertyKeyValid(className.Value))
            {
                LogError("Class name invalid");
                Fsm.Event(errorEvent);
                Finish();
            }


            ParseQuery <ParseObject> _query = ParseObject.GetQuery(className.Value);

            if (_query == null)
            {
                LogError("Set parse property failed");
                Fsm.Event(errorEvent);
                Finish();
            }

            if (!limit.IsNone)
            {
                _query = _query.Limit(limit.Value);
            }

            if (!string.IsNullOrEmpty(include.Value))
            {
                _query = _query.Include(include.Value);
            }


            bool ok = PlayMakerParseProxy.CacheParseObjectQuery(queryId.Value, _query);

            if (!ok)
            {
                LogError("Parse Query could not be cached");
                Fsm.Event(errorEvent);
                Finish();
            }

            Fsm.Event(successEvent);
            Finish();
        }
예제 #9
0
        public override void OnEnter()
        {
            if (!PlayMakerParseProxy.IsPropertyKeyValid(propertyKey.Value))
            {
                LogError("Property Key name invalid");
                Fsm.Event(errorEvent);
                Finish();
            }

            ParseQuery <ParseObject> _query = PlayMakerParseProxy.GetParseObjectQuery(queryId.Value);

            if (_query == null)
            {
                LogError("retrieving query failed");
                Fsm.Event(errorEvent);
                Finish();
            }

            if (where == ParseStringMatchClauses.Contains)
            {
                _query = _query.WhereContains(propertyKey.Value, propertyValue.Value);
            }
            else if (where == ParseStringMatchClauses.StartsWith)
            {
                _query = _query.WhereStartsWith(propertyKey.Value, propertyValue.Value);
            }
            else if (where == ParseStringMatchClauses.EndsWith)
            {
                _query = _query.WhereEndsWith(propertyKey.Value, propertyValue.Value);
            }
            else if (where == ParseStringMatchClauses.Matches)
            {
                _query = _query.WhereMatches(propertyKey.Value, propertyValue.Value, null);
            }

            PlayMakerParseProxy.CacheParseObjectQuery(queryId.Value, _query);

            Fsm.Event(successEvent);
            Finish();
        }