public async Task <Counter> AddNewCounter(string name)
        {
            var counter = new Counter {
                Name = name
            };
            await repository.Save(counter).ConfigureAwait(false);

            return(counter);
        }
Ejemplo n.º 2
0
        public async Task <Counter> AddNewCounter(string account, string password)
        {
            var counter = new Counter {
                Account = account, Password = password
            };
            await repository.Save(counter).ConfigureAwait(false);

            messenger.Publish(new CountersChangedMessage(this));
            return(counter);
        }
Ejemplo n.º 3
0
        //public CountersService(ICountersRepository repository, IMvxMessenger messenger)
        //{
        //    this.messenger = messenger;
        //    this.repository = repository;
        //}

        public async Task <Counter> AddNewCounter(string name)
        {
            var counter = new Counter {
                Name = name
            };
            await repository.Save(counter).ConfigureAwait(false);

            //messenger.Publish(new CountersChangedMessage(this));
            return(counter);
        }
Ejemplo n.º 4
0
        //Implementing the ICountersService interface
        public async Task <Counter> AddNewCounter(string name)
        {
            //A new counter is created from a name, stored in the repository, then removed.
            var counter = new Counter {
                Name = name
            };
            await repository.Save(counter).ConfigureAwait(false);

            messenger.Publish(new CountersChangedMessage(this)); //Once a counter is saved, publish the message
            return(counter);
        }
Ejemplo n.º 5
0
        public async Task <Counter> AddNewCounter(string name)
        {
            var counter = new Counter {
                Name = name
            };
            await repository.Save(counter).ConfigureAwait(false);

            messenger.Publish(new CountersChangedMessage(this));

            var props = new Dictionary <string, string>();

            props.Add("Counter Name", name);
            Analytics.TrackEvent("Add new counter", props);

            return(counter);
        }