예제 #1
0
        private async Task SaveItemFromExternal(UriSchemeMessage message, Action errorAction = null)
        {
            HomeButtonIsVisible = true;
            var        allOk = true;
            ReaderItem item  = null;

            try
            {
                IsSavingVisible = true;

                item = await _readerHelper.HandleProtocolMessage(message);
            }
            catch (Exception ex)
            {
                Log.ErrorException("ShareMessage", ex);
                allOk = false;
            }

            if (item != null)
            {
                await SetReaderItem(item, autostart : false);
            }

            IsSavingVisible = false;


            if (allOk && _canStart)
            {
                StartStopTimer();
            }
            else
            {
                errorAction?.Invoke();
            }
        }
예제 #2
0
        protected override void WireMessages()
        {
            Messenger.Default.Register <UriSchemeMessage>(this, async m =>
            {
                if (m.SchemeType != SchemeType.Edit)
                {
                    return;
                }

                var text = _loader.GetString("Loading");
                SetProgressBar(text);

                ReaderItem = await _readerHelper.HandleProtocolMessage(m);

                SetProgressBar();
            });
        }
예제 #3
0
        protected override void WireMessages()
        {
            Messenger.Default.Register <UriSchemeMessage>(this, async m =>
            {
                if (m.SchemeType != SchemeType.Save)
                {
                    return;
                }

                IsSaving = true;

                try
                {
                    await _readerHelper.HandleProtocolMessage(m);
                }
                catch (Exception ex)
                {
                    Log.ErrorException("Saving from Scheme", ex);
                }

                IsSaving = false;
            });
        }