예제 #1
0
        public bool SaveScheduledTask(SmartEarthTask task)
        {
            var collection = Database.GetCollection <SmartEarthTask>(Core.SCHEDULED_TASK_DATABASE_DOCUMENT);

            if (collection == null)
            {
                return(false);
            }

            var result = collection.Upsert(task);

            UpdateScheduledTasks();
            return(result);
        }
예제 #2
0
        public bool RemoveScheduledTask(SmartEarthTask task)
        {
            var collection = Database.GetCollection <SmartEarthTask>(Core.SCHEDULED_TASK_DATABASE_DOCUMENT);

            if (collection == null)
            {
                return(false);
            }

            var count = collection.Delete(t => t.Signature == task.Signature) > 0;

            UpdateScheduledTasks();
            return(count);
        }