コード例 #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 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();
        }
コード例 #3
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();
        }
コード例 #4
0
        public override void OnEnter()
        {
            ParseQuery <ParseObject> _query = PlayMakerParseProxy.GetParseObjectQuery(queryId.Value);

            if (_query == null)
            {
                Fsm.Event(errorEvent);
                Finish();
            }
            else
            {
                if (firstOrDefault.Value)
                {
                    _task = _query.FirstOrDefaultAsync();
                }
                else
                {
                    _task = _query.FirstAsync();
                }
            }
        }
コード例 #5
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();
        }