コード例 #1
0
 public FirstViewModel(IMvxQueue queue)
 {
     var saveToLocalDatabaseCommand = new SaveToLocalDatabaseCommand { Message = "Test" };
     var saveToRemoteServiceCommand = new SaveToRemoteServiceCommand { InsultToSay = "You suck", TimesToKick = 10, TimesToLaugh = 20 };
     saveToLocalDatabaseCommand.AddSuccessCommand(saveToRemoteServiceCommand);
     queue.Push(saveToLocalDatabaseCommand);
     queue.ProcessQueue();
 }
コード例 #2
0
ファイル: QueueTests.cs プロジェクト: RobGibbens/QueueCross
        public void Should_process_successful_children()
        {
            var factory = new Cirrious.MvvmCross.Plugins.Sqlite.Wpf.MvxWpfSqLiteConnectionFactory();
            var connection = factory.Create("queue.db");
            connection.CreateTable<QueueEntity>();
            var entities = connection.Table<QueueEntity>().ToList();
            foreach (var entity in entities)
            {
                connection.Delete(entity);
            }

            var jsonConverter = new MvxJsonConverter();
            IMvxQueue queue = new MvxQueue(factory, jsonConverter);
            var saveToLocalDatabaseCommand = new SaveToLocalDatabaseCommand { Message = "Test" };
            var saveToRemoteServiceCommand = new FakeCommand();

            saveToLocalDatabaseCommand.AddSuccessCommand(saveToRemoteServiceCommand);
            queue.Push(saveToLocalDatabaseCommand);
            queue.ProcessQueue();
        }