Beispiel #1
0
        public async void OpenItem(object DataContext)
        {
            if (DataContext is GRRow <FTSResult> RsRow)
            {
                Chapter Ch = Shared.BooksDb.Chapters.Find(RsRow.Source.ChapterId);
                if (Ch == null)
                {
                    StringResources stx = StringResources.Load("Message");
                    await Popups.ShowDialog(UIAliases.CreateDialog(string.Format(stx.Str("FTSNeedsRebuild"))));

                    return;
                }

                Ch.Book = Shared.BooksDb.QueryBook(x => x.Id == Ch.BookId).FirstOrDefault();

                // Chapter is hard-linked to Volume. So we can load it confidently
                await Shared.BooksDb.LoadCollectionAsync(Ch.Book, x => x.Volumes, x => x.Index);

                foreach (Volume V in Ch.Book.Volumes)
                {
                    await Shared.BooksDb.LoadCollectionAsync(V, x => x.Chapters, x => x.Index);
                }

                BookItem BkItem = ItemProcessor.GetBookItem(Ch.Book);
                PageProcessor.NavigateToReader(BkItem, Ch);
            }
        }
        private async void CloseInputBox()
        {
            if (!(string.IsNullOrEmpty(TweetInput.Text) || TweetInput.Text == (" " + Keywords.Text + " #wenku10")))
            {
                bool Discard = false;

                StringResources stx = StringResources.Load("Message");
                await Popups.ShowDialog(UIAliases.CreateDialog(
                                            stx.Str("ConfirmDiscard")
                                            , () => Discard = true
                                            , stx.Str("Yes"), stx.Str("No")
                                            ));

                if (!Discard)
                {
                    return;
                }
            }

            InReplyTo        = null;
            ReplyToName.Text = "";

            TransitionDisplay.SetState(TweetBox, TransitionState.Inactive);

            MajorControls = CommentControls;
            ControlChanged?.Invoke(this);
        }
Beispiel #3
0
        private void InitAppBar()
        {
            StringResources stx       = StringResources.Load("Settings", "Message", "ContextMenu");
            AppBarButton    LogoutBtn = UIAliases.CreateAppBarBtn(SegoeMDL2.ChevronLeft, stx.Text("Account_Logout"));

            LogoutBtn.Click += async(s, e) =>
            {
                bool Yes = false;
                await Popups.ShowDialog(UIAliases.CreateDialog(
                                            stx.Str("ConfirmLogout", "Message")
                                            , () => Yes = true
                                            , stx.Str("Yes", "Message"), stx.Str("No", "Message")
                                            ));

                if (Yes)
                {
                    X.Singleton <IMember>(XProto.SHMember).Logout();
                    ControlFrame.Instance.GoBack();
                    ControlFrame.Instance.BackStack.Remove(PageId.SH_USER_INFO);
                }
            };

            SecondaryIconButton ManageAuth = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.Manage, stx.Text("ManageAuths", "ContextMenu"));

            ManageAuth.Click += (s, e) => ControlFrame.Instance.SubNavigateTo(this, () => new ManageAuth());

            MajorControls    = new ICommandBarElement[] { LogoutBtn };
            Major2ndControls = new ICommandBarElement[] { ManageAuth };
        }
Beispiel #4
0
 private async void RemovePin(object sender, RoutedEventArgs e)
 {
     if (AppSettings.DeviceId == SelectedRecord.DevId)
     {
         PM.RemovePin(SelectedRecord.Id);
         UpdatePinData();
     }
     else
     {
         StringResources stx = StringResources.Load("Message");
         await Popups.ShowDialog(UIAliases.CreateDialog(
                                     stx.Str("PinMgr_NoRemoteAction")
                                     ));
     }
 }
Beispiel #5
0
        private async void SetAccelerScroll()
        {
            var ACSConf = GRConfig.ContentReader.AccelerScroll;

            ACScroll = new AccelerScroll
            {
                ProgramBrake      = true,
                TrackAutoAnchor   = ACSConf.TrackAutoAnchor,
                Brake             = ACSConf.Brake,
                BrakeOffset       = ACSConf.BrakeOffset,
                BrakingForce      = ACSConf.BrakingForce,
                AccelerMultiplier = ACSConf.AccelerMultiplier,
                TerminalVelocity  = ACSConf.TerminalVelocity
            };

            ACScroll.UpdateOrientation(App.ViewControl.DispOrientation);

            StringResources stx = StringResources.Load("Settings", "Message");

            ToggleAcceler        = UIAliases.CreateMenuFlyoutItem(stx.Text("Enabled"), new SymbolIcon(Symbol.Accept));
            ToggleAcceler.Click += (s, e) => ToggleAccelerScroll();

            CallibrateAcceler = new MenuFlyoutItem()
            {
                Text = stx.Text("Callibrate")
            };
            CallibrateAcceler.Click += CallibrateAcceler_Click;

            AccelerMenu.Items.Add(ToggleAcceler);
            AccelerMenu.Items.Add(CallibrateAcceler);

            if (ACScroll.Available && !ACSConf.Asked)
            {
                bool EnableAccel = false;

                await Popups.ShowDialog(UIAliases.CreateDialog(
                                            stx.Str("EnableAccelerScroll", "Message")
                                            , () => EnableAccel = true
                                            , stx.Str("Yes", "Message"), stx.Str("No", "Message")
                                            ));

                ACSConf.Asked  = true;
                ACSConf.Enable = EnableAccel;
            }

            ToggleAccelerScroll(ACSConf.Enable);
            UpdateAccelerDelta();
        }
Beispiel #6
0
        private async Task <AsyncTryOut <Chapter> > TryFoundIllustration()
        {
            Volume       V      = ReaderPage.CurrentChapter.Volume;
            ChapterImage CImage = Shared.BooksDb.ChapterImages.FirstOrDefault(x => V.Chapters.Contains(x.Chapter));

            if (CImage != null)
            {
                return(new AsyncTryOut <Chapter>(true, CImage.Chapter));
            }

            bool NeedDownload = Shared.BooksDb.Chapters.Any(x => x.Volume == V && x.Content == null);

            if (!NeedDownload)
            {
                Message.Text = "No Image for this volume";
                return(new AsyncTryOut <Chapter>());
            }

            NeedDownload = false;

            StringResources stm = StringResources.Load("Message");

            await Popups.ShowDialog(UIAliases.CreateDialog(
                                        "Not enough information to see if there were any illustrations within this volume. Download this volume?"
                                        , () => NeedDownload = true
                                        , stm.Str("Yes"), stm.Str("No")
                                        ));

            if (!NeedDownload)
            {
                Message.Text = "Not enough information for finding illustrations. Consider downloading a specific chapter";
                return(new AsyncTryOut <Chapter>());
            }

            ChapterList.ItemsSource = V.Chapters.Select(x => new ChapterVModel(x));
            await AutoCache.DownloadVolumeAsync(ReaderPage.CurrentBook, V);

            Chapter ImageChapter = V.Chapters.FirstOrDefault(x => x.Image != null);

            if (ImageChapter == null)
            {
                Worker.UIInvoke(() => Message.Text = "No Illustration available");
                return(new AsyncTryOut <Chapter>());
            }

            return(new AsyncTryOut <Chapter>(true, ImageChapter));
        }
Beispiel #7
0
        private async void RemoteAddress_LostFocus(object sender, RoutedEventArgs e)
        {
            string IP = RemoteAddress.Text.Trim();

            IPAddress NotUsed;

            if (!IPAddress.TryParse(IP, out NotUsed))
            {
                await Popups.ShowDialog(UIAliases.CreateDialog("This IP Address is invalid"));

                RemoteAddress.Text = Properties.RSYSTEM_LOG_ADDRESS;
            }
            else
            {
                Properties.RSYSTEM_LOG_ADDRESS = IP;
            }
        }
Beispiel #8
0
        private async void ResetBtn_Click(object sender, RoutedEventArgs e)
        {
            bool            Reset = false;
            StringResources stx   = StringResources.Load("Message");

            await Popups.ShowDialog(UIAliases.CreateDialog(
                                        stx.Str("ConfirmResetConvTable"), stx.Str("ConfirmReset")
                                        , () => Reset = true
                                        , stx.Str("Yes"), stx.Str("No")
                                        ));

            if (Reset)
            {
                ToggleSaveBtn(false);
                ViewSource.ConvDataSource.ResetSource();
            }
        }
Beispiel #9
0
        private async void ConsoleBtn_Click(object sender, RoutedEventArgs e)
        {
            StringResources stx = StringResources.Load("Message");

            bool ConfirmRestart = false;

            await Popups.ShowDialog(UIAliases.CreateDialog(
                                        stx.Str("RestartToConsole")
                                        , () => ConfirmRestart = true
                                        , stx.Str("Yes"), stx.Str("No"))
                                    );

            if (ConfirmRestart)
            {
                Config.Properties.CONSOLE_MODE = true;
                await Utils.RestartOrExit();
            }
        }
Beispiel #10
0
        private async void CtrlSubmit()
        {
            if (TweetInput.FocusState == FocusState.Keyboard)
            {
                bool            Continue = false;
                StringResources stx      = StringResources.Load("Message");
                await Popups.ShowDialog(UIAliases.CreateDialog(
                                            stx.Str("ConfirmSubmit")
                                            , () => Continue = true
                                            , stx.Str("Yes"), stx.Str("No")
                                            ));

                if (Continue)
                {
                    Submit();
                }
            }
        }
Beispiel #11
0
        private async void OpenReader(object DataContext)
        {
            if (TryGetBookItem(DataContext, out BookItem BkItem))
            {
                AsyncTryOut <Chapter> TryAutoAnchor = await PageExtOperations.Run(PageProcessor.TryGetAutoAnchor(BkItem));

                if (TryAutoAnchor)
                {
                    PageProcessor.NavigateToReader(BkItem, TryAutoAnchor.Out);
                }
                else
                {
                    StringResources stx = StringResources.Load("Message");
                    await Popups.ShowDialog(UIAliases.CreateDialog(stx.Str("AnchorNotSetYet")));

                    OpenTOC(BkItem);
                }
            }
        }
Beispiel #12
0
        public async void CreateTileUpdateForBookSpider(string BookId, string TileId)
        {
            if (!CanBackground)
            {
                await Popups.ShowDialog(UIAliases.CreateDialog(
                                            "Background Task Manager"
                                            , "Backgorund Task is disabled. Unable to create tile update"));

                return;
            }

            XParameter BookParam = new XParameter(BookId);

            BookParam.SetValue(new XKey("tileId", TileId));
            BookParam.SetValue(new XKey("spider", true));

            XReg.SetParameter(BookParam);

            XReg.Save();
        }
Beispiel #13
0
        public static async Task RegLiveSpider(SpiderBook SBook, BookInstruction Book, string TileId)
        {
            if (!SBook.HasChakra)
            {
                StringResources stx = StringResources.Load("Message");

                bool Confirmed = false;

                await Popups.ShowDialog(UIAliases.CreateDialog(
                                            stx.Str("TileUpdateSupport"), stx.Str("ShellTile")
                                            , () => Confirmed = true
                                            , stx.Str("Yes"), stx.Str("No")
                                            ));

                if (Confirmed)
                {
                    BackgroundProcessor.Instance.CreateTileUpdateForBookSpider(Book.GID, TileId);
                }
            }
        }
Beispiel #14
0
        private async void OpenTwitter(object sender, RoutedEventArgs e)
        {
            CommentBtn.IsEnabled = false;

            if (!GRConfig.System.TwitterConfirmed)
            {
                GRConfig.System.TwitterConfirmed = true;
                StringResources stx = StringResources.Load("Message");
                await Popups.ShowDialog(UIAliases.CreateDialog(stx.Str("ConfirmTwitter"), "Twitter"));
            }

            if (!await GR.Model.Twitter.AuthData.Authenticate())
            {
                return;
            }

            ControlFrame.Instance.SubNavigateTo(this, () => new TwitterCommentView(ThisBook));

            CommentBtn.IsEnabled = true;
        }
Beispiel #15
0
        protected async void DownloadVolume(object sender, RoutedEventArgs e)
        {
            StringResources stx = StringResources.Load("Message", "ContextMenu");

            bool Confirmed = false;

            await Popups.ShowDialog(
                UIAliases.CreateDialog(
                    RightClickedVolume.Title, stx.Text("AutoUpdate", "ContextMenu")
                    , () => Confirmed = true
                    , stx.Str("Yes"), stx.Str("No")
                    ));

            if (!Confirmed)
            {
                return;
            }

            AutoCache.DownloadVolume(ThisBook, RightClickedVolume);
        }
Beispiel #16
0
        private async void TryBuildIndex()
        {
            if (!ViewSource.FTSData.IsBuilt)
            {
                string EstSize = Utils.AutoByteUnit(( ulong )(3.77 * (await Shared.Storage.FileSize(FileLinks.DB_BOOKS))));

                bool BuildIndex = false;

                StringResources stx = StringResources.Load("Message");
                await Popups.ShowDialog(UIAliases.CreateDialog(
                                            string.Format(stx.Str("ConfirmBuildFTS"), EstSize)
                                            , () => BuildIndex = true
                                            , stx.Str("Yes"), stx.Str("No")
                                            ));

                if (BuildIndex)
                {
                    await ViewSource.FTSData.Rebuild();
                }
            }
        }
Beispiel #17
0
        private async void JumpButton_Click(object sender, RoutedEventArgs e)
        {
            Button Btn = ( Button )sender;

            Btn.IsEnabled = false;

            // AnchorSync is already handled on this page
            AsyncTryOut <Chapter> TryAutoAnchor = await PageProcessor.TryGetAutoAnchor(ThisBook, false);

            if (TryAutoAnchor)
            {
                PageProcessor.NavigateToReader(ThisBook, TryAutoAnchor.Out);
            }
            else
            {
                StringResources stx = StringResources.Load("Message");
                await Popups.ShowDialog(UIAliases.CreateDialog(stx.Str("AnchorNotSetYet")));
            }

            Btn.IsEnabled = true;
        }
Beispiel #18
0
        private async void PinDevToStart(object sender, RoutedEventArgs e)
        {
            if (ActionBlocked)
            {
                return;
            }
            ActionBlocked = true;

            PinManager PM = new PinManager();

            PinRecord[] Records = CurrRecords.Where(x => x.DevId == SelectedRecord.DevId && 0 < x.TreeLevel).ToArray();

            if (5 < Records.Length)
            {
                bool            Canceled = true;
                StringResources stx      = StringResources.Load("Message");
                await Popups.ShowDialog(UIAliases.CreateDialog(
                                            string.Format(stx.Str("ConfirmMassPin"), Records.Length)
                                            , () => Canceled = false
                                            , stx.Str("Yes"), stx.Str("No")
                                            ));

                if (Canceled)
                {
                    ActionBlocked = false;
                    return;
                }
            }

            foreach (PinRecord Record in Records)
            {
                await PinRecord(Record);
            }

            PM.Save();
            UpdatePinData();
            ActionBlocked = false;
        }
Beispiel #19
0
        public async Task <bool> ConfirmRestart(string CaptionRes)
        {
            StringResources stx = StringResources.Load("Message", "Settings");

            bool Restart = false;

            await Popups.ShowDialog(
                UIAliases.CreateDialog(
                    stx.Str("NeedRestart"), stx.Text(CaptionRes, "Settings")
                    , () => Restart = true
                    , stx.Str("Yes"), stx.Str("No")
                    ));

            if (Restart)
            {
                await ControlFrame.Instance.CloseSubView();

                ControlFrame.Instance.CollapseAppBar();
                NavigationHandler.InsertHandlerOnNavigatedBack(Exit);
                RestartMask.State = ControlState.Active;
            }

            return(Restart);
        }
Beispiel #20
0
        private async void TakeOverDev(object sender, RoutedEventArgs e)
        {
            if (SelectedRecord.DevId == AppSettings.DeviceId)
            {
                return;
            }

            bool Canceled = true;

            StringResources stx = StringResources.Load("Message");
            await Popups.ShowDialog(UIAliases.CreateDialog(
                                        stx.Str("ConfirmTakeOver")
                                        , () => Canceled = false
                                        , stx.Str("Yes"), stx.Str("No")
                                        ));

            if (Canceled)
            {
                return;
            }

            PM.TakeOver(SelectedRecord.DevId);
            UpdatePinData();
        }
Beispiel #21
0
        private async void Submit()
        {
            string TweetContent = TweetInput.Text.Replace("\r\n", "\n").Trim();

            if (TweetLimit < TweetContent.Length)
            {
                return;
            }

            if (!SubmitBtn.IsEnabled)
            {
                return;
            }
            SubmitBtn.IsEnabled = false;

            if (!(TweetContent.Contains("#wenku10") && TweetContent.Contains(Keywords.Text)))
            {
                bool            Continue = false;
                StringResources stx      = StringResources.Load("Message");
                await Popups.ShowDialog(UIAliases.CreateDialog(
                                            string.Format(stx.Str("Desc_OSTweet"), Keywords.Text, "#wenku10")
                                            , stx.Str("OSTweet")
                                            , () => Continue = true
                                            , stx.Str("Yes"), stx.Str("No")
                                            ));

                if (!Continue)
                {
                    string ScopeText = "";

                    if (!TweetContent.Contains(Keywords.Text))
                    {
                        ScopeText += Keywords.Text + " ";
                    }
                    if (!TweetContent.Contains("#wenku10"))
                    {
                        ScopeText += "#wenku10 ";
                    }

                    TweetInput.Text            = TweetContent + " " + ScopeText;
                    TweetInput.SelectionStart  = TweetContent.Length;
                    TweetInput.SelectionLength = ScopeText.Length;

                    TweetInput.Focus(FocusState.Keyboard);

                    UpdateCharLeft();

                    SubmitBtn.IsEnabled = true;
                    return;
                }
            }

            try
            {
                TweetInput.IsEnabled = false;
                if (InReplyTo == null)
                {
                    await TwitterService.Instance.TweetStatusAsync(TweetContent);
                }
                else
                {
                    await TSExtended.Instance.ReplyStatusAsync(TweetContent, InReplyTo.Id);
                }

                InsertFakeTweet(TweetContent);

                TweetInput.Text     = "";
                SubmitBtn.IsEnabled = true;

                CloseInputBox();
            }
            catch (TwitterException ex)
            {
                var j = Popups.ShowDialog(UIAliases.CreateDialog(ex.Message));
            }

            TweetInput.IsEnabled = true;
        }
Beispiel #22
0
        private async void CheckTiles()
        {
            PinErrored = false;
            PinManager PM = new PinManager();

            await PM.SyncSettings();

            if (PM.Policy == PinPolicy.DO_NOTHING)
            {
                return;
            }

            ActiveItem[] MissingPins = PM.GetLocalPins().Where(
                x => !Windows.UI.StartScreen.SecondaryTile.Exists(x.Payload)
                ).ToArray();

            if (0 < MissingPins.Length)
            {
                switch (PM.Policy)
                {
                case PinPolicy.ASK:
                    bool            RemoveRecord = true;
                    StringResources stx          = StringResources.Load("Message", "AppBar", "ContextMenu");
                    await Popups.ShowDialog(UIAliases.CreateDialog(
                                                string.Format(stx.Str("MissingPins"), MissingPins.Length)
                                                , () => RemoveRecord = false
                                                , stx.Text("PinToStart", "ContextMenu"), stx.Text("PinPolicy_RemoveMissing", "AppBar")
                                                ));

                    if (RemoveRecord)
                    {
                        goto case PinPolicy.REMOVE_MISSING;
                    }
                    goto case PinPolicy.PIN_MISSING;

                case PinPolicy.PIN_MISSING:
                    foreach (ActiveItem Item in MissingPins)
                    {
                        BookItem Book = await ItemProcessor.GetBookFromId(Item.Desc);

                        if (Book == null)
                        {
                            PinError();
                        }
                        else
                        {
                            TaskCompletionSource <string> TileId = new TaskCompletionSource <string>();

                            BookLoader Loader = new BookLoader(async(b) =>
                            {
                                TileId.SetResult(b == null ? null : await PageProcessor.PinToStart(b));
                            });

                            Loader.Load(Book, true);
                            await TileId.Task;
                        }
                    }
                    break;

                case PinPolicy.REMOVE_MISSING:
                    PM.RemovePin(MissingPins.Remap(x => x.Desc));
                    break;
                }
            }
        }
Beispiel #23
0
        private async void MessageBus_OnDelivery(Message Mesg)
        {
            switch (Mesg.Content)
            {
            case AppKeys.SH_SCRIPT_DATA:
                HubScriptItem HSI = ( HubScriptItem )Mesg.Payload;

                if ((HSI.Scope & SpiderScope.ZONE) != 0)
                {
                    ControlFrame.Instance.NavigateTo(
                        PageId.MASTER_EXPLORER, () => new MasterExplorer()
                        //  Open ZoneSpider Manager
                        , P => (( MasterExplorer )P).NavigateToDataSource(
                            typeof(ZSMDisplayData)
                            , async(ZSVS) =>
                    {
                        // Using the manager, import this script
                        ZSMDisplayData DisplayData = (( ZSManagerVS )ZSVS).ZSMData;
                        if (await DisplayData.OpenFile(HSI.ScriptFile))
                        {
                            // Open the imported script
                            ZoneSpider ZSpider = DisplayData.ZSTable.Items.Select(x => ( ZoneSpider )x.Source).FirstOrDefault(x => x.ZoneId == HSI.Id);
                            (( MasterExplorer )P).NavigateToZone(ZSpider);
                        }
                    }
                            ));
                    break;
                }

                // This will save the book
                SpiderBook SBook = await SpiderBook.ImportFile(await HSI.ScriptFile.ReadString(), true);

                if (SBook.CanProcess)
                {
                    ConfirmScriptParse(SBook);
                }
                else
                {
                    ConfirmErrorReport(HSI.Id, StatusType.HS_INVALID);
                }
                break;

            case AppKeys.HS_DECRYPT_FAIL:
                StringResources stx = StringResources.Load("Message", "ContextMenu");

                bool Place = false;

                await Popups.ShowDialog(UIAliases.CreateDialog(
                                            stx.Str("Desc_DecryptionFailed"), stx.Str("DecryptionFailed")
                                            , () => Place = true
                                            , stx.Text("PlaceRequest", "ContextMenu"), stx.Str("OK")
                                            ));

                if (Place)
                {
                    HSI = ( HubScriptItem )Mesg.Payload;
                    TransferRequest(SHTarget.KEY, HSI);
                }

                break;

            case AppKeys.HS_OPEN_COMMENT:
                InboxMessage BoxMessage = ( InboxMessage )Mesg.Payload;
                ControlFrame.Instance.NavigateTo(PageId.SCRIPT_DETAILS
                                                 , () => new ScriptDetails(BoxMessage.HubScript)
                                                 , P => (( ScriptDetails )P).OpenCommentStack(BoxMessage.CommId)
                                                 );
                break;

            case AppKeys.HS_NO_VOLDATA:
                ConfirmErrorReport((( BookInstruction )Mesg.Payload).ZItemId, StatusType.HS_NO_VOLDATA);
                break;

            case AppKeys.EX_DEATHBLOW:
                stx = StringResources.Load("Message", "ContextMenu");

                bool UseDeathblow = false;

                await Popups.ShowDialog(UIAliases.CreateDialog(
                                            stx.Str("ConfirmDeathblow")
                                            , () => UseDeathblow = true
                                            , stx.Str("Yes"), stx.Str("No")
                                            ));

                if (UseDeathblow)
                {
                    IDeathblow Deathblow = ( IDeathblow )Mesg.Payload;
                    ControlFrame.Instance.NavigateTo(PageId.W_DEATHBLOW, () => new WDeathblow(Deathblow), P => (( WDeathblow )P).Blow());
                }

                break;

            case AppKeys.PM_CHECK_TILES:
                CheckTiles();
                break;

            case AppKeys.OPEN_VIEWSOURCE:
                ControlFrame.Instance.NavigateTo(PageId.MASTER_EXPLORER, () => new MasterExplorer(), P => (( MasterExplorer )P).NavigateToViewSource(( GRViewSource )Mesg.Payload));
                break;

            case AppKeys.OPEN_ZONE:
                ControlFrame.Instance.NavigateTo(PageId.MASTER_EXPLORER, () => new MasterExplorer(), P => (( MasterExplorer )P).NavigateToZone(( ZoneSpider )Mesg.Payload));
                break;

            case AppKeys.PROMPT_LOGIN:
                (IMember Member, Action DialogClosed) = (Tuple <IMember, Action>)Mesg.Payload;
                if (!Member.IsLoggedIn)
                {
                    Login LoginDialog = new Login(Member);
                    await Popups.ShowDialog(LoginDialog);
                }
                DialogClosed();
                break;
            }
        }
Beispiel #24
0
        private async void AddTweet_Click(object sender, RoutedEventArgs e)
        {
            Button Btn = ( Button )sender;

            Btn.IsEnabled = false;

            if (!await AuthData.Authenticate())
            {
                goto TweetEnd;
            }

            string          TweetText = "";
            StringResources stx       = StringResources.Load("Error", "AppResources");

TweetStart:

            ValueHelpInput TweetInput = new ValueHelpInput("", "wenku10 ♥", stx.Text("Tweetwenku10", "AppResources"));

            TweetInput.Value = TweetText;

            await Popups.ShowDialog(TweetInput);

            if (TweetInput.Canceled)
            {
                goto TweetEnd;
            }

            TweetText = TweetInput.Value.Trim();
            if (string.IsNullOrEmpty(TweetText))
            {
                goto TweetEnd;
            }

            if (131 < TweetText.Length)
            {
                await Popups.ShowDialog(UIAliases.CreateDialog(
                                            stx.Str("TweetTooLong") + string.Format(" ( {0} < {1} )", 131, TweetText.Length)
                                            ));

                goto TweetStart;
            }

            if (await TwitterService.Instance.TweetStatusAsync(TweetText + " #wenku10"))
            {
                Observables <Tweet, Tweet> Tweets = (Observables <Tweet, Tweet>)TweetsView.ItemsSource;
                Tweets.Insert(0, new Tweet()
                {
                    Text        = TweetText
                    , User      = await TwitterService.Instance.GetUserAsync()
                    , CreatedAt = DateTime.Now.ToString("ddd MMM dd HH:mm:ss zzzz yyyy", CultureInfo.InvariantCulture)
                });
            }
            else
            {
                await Popups.ShowDialog(UIAliases.CreateDialog(stx.Str("SubmitError")));

                goto TweetStart;
            }

TweetEnd:
            Btn.IsEnabled = true;
        }