void SeriesReady( )
        {
            // only do image work on the main thread
            InvokeOnMainThread(delegate
            {
                ActivityIndicator.Hidden = true;
                ActivityIndicator.RemoveFromSuperview( );

                // if there are now series entries, we're good
                if (RockLaunchData.Instance.Data.NoteDB.SeriesList.Count > 0)
                {
                    // setup each series entry in our table
                    SetupSeriesEntries(RockLaunchData.Instance.Data.NoteDB.SeriesList);

                    // only update the table if we're still visible
                    if (IsVisible == true)
                    {
                        NotesTableView.Hidden = false;
                        NotesTableView.Source = new TableSource(this, SeriesEntries, ImageMainPlaceholder, ImageThumbPlaceholder);
                        NotesTableView.ReloadData( );
                    }
                }
                else if (IsVisible == true)
                {
                    // jhm hack : Show our stupid error message
                    ResultView.Show(MessagesStrings.Series_Error_Title,
                                    PrivateControlStylingConfig.Result_Symbol_Failed,
                                    MessagesStrings.Series_Error_Message + "\n" + RockLaunchData.HackNotesErrorCheck,
                                    GeneralStrings.Retry);
                }
            });
        }
Exemple #2
0
        void JoinClicked(PlatformButton button)
        {
            if (ValidateInput( ))
            {
                //hack - Can't figure out WHY the join button isn't in the proper Z order on the Nexus 7.
                // but I just don't care right now. So hide it and unhide it.
                JoinButton.Hidden = true;
                EnableControls(false);

                BlockerView.Show( );

                MobileAppApi.JoinGroup(GroupID, FirstName.Text, LastName.Text, SpouseName.Text, Email.Text, CellPhone.Text.AsNumeric( ),
                                       delegate(System.Net.HttpStatusCode statusCode, string statusDescription)
                {
                    BlockerView.Hide( );

                    if (Rock.Mobile.Network.Util.StatusInSuccessRange(statusCode) == true)
                    {
                        ResultView.Show(RegisterStrings.RegisterStatus_Success,
                                        PrivateControlStylingConfig.Result_Symbol_Success,
                                        string.Format(ConnectStrings.JoinGroup_RegisterSuccess, GroupTitle.Text),
                                        GeneralStrings.Done);
                    }
                    else
                    {
                        ResultView.Show(RegisterStrings.RegisterStatus_Failed,
                                        PrivateControlStylingConfig.Result_Symbol_Failed,
                                        ConnectStrings.JoinGroup_RegisterFailed,
                                        GeneralStrings.Done);
                    }
                });
            }
        }
Exemple #3
0
                public bool OnError(MediaPlayer mp, MediaError error, int extra)
                {
                    ProgressBar.Visibility = ViewStates.Gone;

                    // only show the resultView if we're active.
                    if (FragmentActive == true)
                    {
                        ResultView.Show(MessagesStrings.Error_Title,
                                        PrivateControlStylingConfig.Result_Symbol_Failed,
                                        MessagesStrings.Error_Watch_Playback,
                                        GeneralStrings.Retry);

                        ResultView.SetBounds(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));
                    }

                    if (mp != null)
                    {
                        mp.Stop( );
                        mp.Reset( );
                    }

                    MediaControllerPrepared = false;

                    PlayerState = MediaPlayerState.None;

                    //SyncUI( );

                    return(true);
                }
Exemple #4
0
                protected void ReportException(string errorMsg, Exception e)
                {
                    Rock.Mobile.Threading.Util.PerformOnUIThread(delegate
                    {
                        FinishNotesCreation( );

                        // if we have more download attempts, use them before reporting
                        // an error to the user.
                        if (NoteDownloadRetries > 0)
                        {
                            NoteDownloadRetries--;

                            PrepareCreateNotes( );
                        }
                        else
                        {
                            if (e != null)
                            {
                                errorMsg += e.Message;
                            }

                            if (MobileApp.Shared.Network.RockLaunchData.Instance.Data.DeveloperModeEnabled == true)
                            {
                                Springboard.DisplayError("Note Error", errorMsg);
                            }
                            else
                            {
                                ResultView.Show(MessagesStrings.Error_Title,
                                                PrivateControlStylingConfig.Result_Symbol_Failed,
                                                MessagesStrings.Error_Message,
                                                GeneralStrings.Retry);
                            }
                        }
                    });
                }
Exemple #5
0
        void RetrieveBiblePassage( )
        {
            ResultView.Hide( );

            BlockerView.Show(delegate
            {
                RequestingBiblePassage = true;

                BibleRenderer.RetrieveBiblePassage(BibleAddress, delegate(string htmlStream)
                {
                    // if it worked, take the html stream and store it
                    if (string.IsNullOrWhiteSpace(htmlStream) == false)
                    {
                        PassageHTML = htmlStream;
                        BibleWebView.LoadHtmlString(PassageHTML, NSBundle.MainBundle.BundleUrl);
                    }
                    else
                    {
                        // otherwise display an error
                        ResultView.Show(GeneralStrings.Network_Status_FailedText,
                                        PrivateControlStylingConfig.Result_Symbol_Failed,
                                        GeneralStrings.Network_Result_FailedText,
                                        GeneralStrings.Retry);
                    }

                    RequestingBiblePassage = false;
                    BlockerView.Hide(null);
                });
            });
        }
Exemple #6
0
        void RegisterUser()
        {
            if (State == RegisterState.None)
            {
                // make sure they entered all required fields
                if (ValidateInput( ))
                {
                    ToggleControls(false);

                    ProgressBarBlocker.Visibility = ViewStates.Visible;
                    State = RegisterState.Trying;

                    // create a new user and submit them
                    Rock.Client.Person newPerson = new Rock.Client.Person();

                    // copy all the edited fields into the person object
                    newPerson.Email = EmailText.Text;

                    // set the nickName AND firstName to NickName
                    newPerson.NickName  = NickNameText.Text;
                    newPerson.FirstName = NickNameText.Text;

                    newPerson.LastName = LastNameText.Text;

                    MobileAppApi.RegisterNewUser(UserNameText.Text, PasswordText.Text, NickNameText.Text, LastNameText.Text, EmailText.Text, CellPhoneText.Text,
                                                 delegate(System.Net.HttpStatusCode statusCode, string statusDescription)
                    {
                        ProgressBarBlocker.Visibility = ViewStates.Gone;

                        // scroll to the top so the Result is visible
                        ScrollView.Post(new Action(delegate
                        {
                            ScrollView.ScrollTo(0, 0);
                        }));

                        if (Rock.Mobile.Network.Util.StatusInSuccessRange(statusCode) == true)
                        {
                            ProfileAnalytic.Instance.Trigger(ProfileAnalytic.Register);

                            State = RegisterState.Success;
                            ResultView.Show(RegisterStrings.RegisterStatus_Success,
                                            PrivateControlStylingConfig.Result_Symbol_Success,
                                            RegisterStrings.RegisterResult_Success,
                                            GeneralStrings.Done);
                        }
                        else
                        {
                            State = RegisterState.Fail;
                            ResultView.Show(RegisterStrings.RegisterStatus_Failed,
                                            PrivateControlStylingConfig.Result_Symbol_Failed,
                                            statusDescription,
                                            GeneralStrings.Done);
                        }

                        ResultView.SetBounds(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));
                    });
                }
            }
        }
Exemple #7
0
        private void NewResultWindow(object sender, NewResultWindowEventArgs e)
        {
            ResultView      view      = new ResultView();
            ResultViewModel viewModel = new ResultViewModel(e);

            view.DataContext = viewModel;
            view.Show();
        }
Exemple #8
0
        void RegisterUser()
        {
            if (State == RegisterState.None)
            {
                // make sure they entered all required fields
                if (ValidateInput( ))
                {
                    BlockerView.Show(
                        delegate
                    {
                        // force the UI to scroll back up
                        ScrollView.ContentOffset = CGPoint.Empty;
                        ScrollView.ScrollEnabled = false;

                        State = RegisterState.Trying;

                        // create a new user and submit them
                        Rock.Client.Person newPerson = new Rock.Client.Person();

                        // copy all the edited fields into the person object
                        newPerson.Email = EmailText.Field.Text;

                        // set both the nick name and first name to NickName
                        newPerson.NickName  = NickNameText.Field.Text;
                        newPerson.FirstName = NickNameText.Field.Text;

                        newPerson.LastName = LastNameText.Field.Text;

                        MobileAppApi.RegisterNewUser(UserNameText.Field.Text, PasswordText.Field.Text, NickNameText.Field.Text, LastNameText.Field.Text, EmailText.Field.Text, CellPhoneText.Field.Text,
                                                     delegate(System.Net.HttpStatusCode statusCode, string statusDescription)
                        {
                            if (Rock.Mobile.Network.Util.StatusInSuccessRange(statusCode) == true)
                            {
                                ProfileAnalytic.Instance.Trigger(ProfileAnalytic.Register);

                                State = RegisterState.Success;
                                ResultView.Show(RegisterStrings.RegisterStatus_Success,
                                                PrivateControlStylingConfig.Result_Symbol_Success,
                                                RegisterStrings.RegisterResult_Success,
                                                GeneralStrings.Done);
                            }
                            else
                            {
                                State = RegisterState.Fail;
                                ResultView.Show(RegisterStrings.RegisterStatus_Failed,
                                                PrivateControlStylingConfig.Result_Symbol_Failed,
                                                statusDescription,
                                                GeneralStrings.Done);
                            }

                            BlockerView.Hide(null);
                        });
                    });
                }
            }
        }
Exemple #9
0
 private async UniTask HandleResult(bool result, CancellationToken token)
 {
     if (result)
     {
         await _correctResultView.Show(token);
     }
     else
     {
         await _wrongResultView.Show(token);
     }
 }
Exemple #10
0
    void StartResult()
    {
        Destroy(gameOverView);

        ResultView view = null;

        view = ResultView.Show(uiParent, new TitleConstData(titleData), inGame.Score, () => {
            ShowTitle();
            Destroy(view.gameObject);
        });
    }
Exemple #11
0
        // 動的解析を行う処理
        private void RunMonteCarlo()
        {
            string output = "";

            try {
                // 艦隊を読み込み
                var      friendFleet = FriendFleet(InputDeckBuilderText);
                LandBase landBase    = null;
                if (IsLandBaseUse)
                {
                    landBase = LandBaseFleet(InputAirBaseText);
                }
                var enemyFleet = EnemyFleet(InputEnemyDataText);
                // 時間を記録する
                var sw = new System.Diagnostics.Stopwatch();
                sw.Start();
                // モンテカルロシミュレーションを行う
                var simulationSize = new int[] { 10000, 100000, 1000000, 10000000, 100000000 };
                output = Simulator.MonteCarlo(friendFleet, enemyFleet, landBase, simulationSize[SimulationSizeIndex]);
                // 先頭に計算時間を追加する
                sw.Stop();
                output = $"経過時間:{Math.Round(sw.Elapsed.TotalSeconds, 1)}秒\n" + output;
                // 結果を表示する
                List <string> nameList;
                List <List <List <double> > > histList;
                Simulator.ResultData(friendFleet, enemyFleet, landBase, simulationSize[SimulationSizeIndex], out nameList, out histList);
                //rv?.Close();
                var rvm = new ResultViewModel(
                    nameList,
                    histList,
                    InputDeckBuilderText,
                    InputAirBaseText,
                    InputEnemyDataText,
                    output);
                rv             = new ResultView();
                rv.DataContext = rvm;
                rvm.SetDelegate(rv.DrawChart, rv.CopyChart, SendFriend, SendLandBase, SendEnemy);
                rv.Show();
            }
            catch {
                output = "自艦隊 or 敵艦隊が正常に読み込めませんでした.";
            }
            // 表示
            MessageBox.Show(output, "AWSR");
        }
Exemple #12
0
        private void Listbox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (_lists.Count < 1)
            {
                return;
            }
            var content = ReplaceTb.Text;

            Task.Factory.StartNew(() =>
            {
                content = _regex.Compiler(content);
                Dispatcher.Invoke(() =>
                {
                    var page = new ResultView {
                        Content = content
                    };
                    page.Show();
                });
            });
        }
Exemple #13
0
    void ShowTitle()
    {
        TitleView view = null;

        view = TitleView.Show(uiParent,
                              (_level) => {
            GetTitleData((_data) => {
                titleData = _data;
                inGame.StartGame(_level, new TitleConstData(titleData));
                Destroy(view.gameObject);
            });
        },
                              () => {
            ResultView resultView = null;
            resultView            = ResultView.Show(uiParent, () => {
                ShowTitle();
                Destroy(resultView.gameObject);
            });
            Destroy(view.gameObject);
        });
    }
        void RefreshProfile( )
        {
            // don't allow a double refresh, obviously.
            if (RefreshingProfile == false)
            {
                RefreshingProfile = true;

                ResultView.Hide( );
                BlockerView.BringToFront( );

                BlockerView.Show(
                    delegate
                {
                    RockMobileUser.Instance.GetPersonData(delegate(System.Net.HttpStatusCode statusCode, string statusDescription)
                    {
                        RefreshingProfile = false;

                        if (Rock.Mobile.Network.Util.StatusInSuccessRange(statusCode) == true)
                        {
                            // show the latest profile info
                            ModelToUI( );
                        }
                        else
                        {
                            // show failure prompt
                            ResultView.Show(ProfileStrings.ProfileErrorTitle, PrivateControlStylingConfig.Result_Symbol_Failed, ProfileStrings.ProfileErrorDesc, GeneralStrings.Ok);

                            // if the result is "Not Found", then that means their login is no longer valid. Force a logout.
                            if (statusCode == System.Net.HttpStatusCode.NotFound)
                            {
                                // then log them out.
                                RockMobileUser.Instance.LogoutAndUnbind( );
                            }
                        }

                        BlockerView.Hide(null);
                    });
                });
            }
        }
Exemple #15
0
 public void ShowResult(EnCharacterType winner)
 {
     result.Show(winner, OnReplayAction, OnBackToMenuAction);
 }
 public void HandleLoadError( )
 {
     ResultView.Show(GeneralStrings.Network_Status_FailedText, PrivateControlStylingConfig.Result_Symbol_Failed, GeneralStrings.Network_Result_FailedText, GeneralStrings.Retry);
     ActivityIndicator.Hidden = true;
 }
Exemple #17
0
        void Internal_DisplayView( )
        {
            // default all controls to hidden, and we'll figure out what to show in the layout method.
            HideControls(true);

            IsDownloading = true;

            BlockerView.Show(delegate
            {
                MobileAppApi.GetGroupSummary(GroupEntry.Id,
                                             delegate(MobileAppApi.GroupInfo groupInfo, System.IO.MemoryStream familyPhoto, System.IO.MemoryStream groupPhoto)
                {
                    try
                    {
                        IsDownloading = false;

                        if (familyPhoto != null)
                        {
                            // setup the family image
                            FamilyImage.Image = familyPhoto;

                            float imageSize    = Rock.Mobile.Graphics.Util.UnitToPx(PrivateConnectConfig.GroupInfo_Leader_ImageSize);
                            FamilyImage.Bounds = new RectangleF(0, 0, imageSize, imageSize);

                            // if we had a valid image stream, dispose of it now
                            FamilyImageValid = true;
                            familyPhoto.Dispose( );
                        }
                        else
                        {
                            FamilyImageValid = false;
                        }

                        // setup the group image
                        if (groupPhoto != null)
                        {
                            GroupImage.Image = groupPhoto;

                            float imageSize   = Rock.Mobile.Graphics.Util.UnitToPx(PrivateConnectConfig.GroupInfo_Group_ImageSize);
                            GroupImage.Bounds = new RectangleF(0, 0, imageSize, imageSize);

                            GroupImageValid = true;
                            groupPhoto.Dispose( );
                        }
                        else
                        {
                            // if we had a valid image stream, dispose of it now
                            GroupImageValid = false;
                        }

                        // set the details for the group (distance, meeting time, etc)

                        // set the group title
                        GroupTitle.Text = GroupEntry.Name;

                        if (string.IsNullOrWhiteSpace(GroupEntry.MeetingTime) == false)
                        {
                            MeetingTime.Text = GroupEntry.MeetingTime;
                        }
                        else
                        {
                            MeetingTime.Text = ConnectStrings.GroupFinder_ContactForTime;
                        }

                        // add the distance
                        MeetingTime.Text += "\n" + string.Format("{0:##.0} {1}", GroupEntry.DistanceFromSource, ConnectStrings.GroupFinder_MilesSuffix);

                        // childcare provided header
                        if (string.IsNullOrWhiteSpace(groupInfo.Filters) == false && groupInfo.Filters.Contains(PrivateConnectConfig.GroupFinder_Childcare_Filter))
                        {
                            ChildcareProvided.Text = ConnectStrings.GroupFinder_OffersChildcare;
                        }
                        else
                        {
                            ChildcareProvided.Text = string.Empty;
                        }

                        // young adults header
                        if (string.IsNullOrWhiteSpace(groupInfo.Filters) == false && groupInfo.Filters.Contains(PrivateConnectConfig.GroupFinder_YoungAdults_Filter))
                        {
                            YoungAdults.Text = ConnectStrings.GroupFinder_YoungAdults;
                        }
                        else
                        {
                            YoungAdults.Text = string.Empty;
                        }

                        // childcare description (if its blank, it'll be hidden)
                        ChildDesc.Text = groupInfo.ChildcareDesc;

                        // group description (if its blank, it'll be hidden)
                        GroupDesc.Text = groupInfo.Description;


                        BlockerView.Hide( );

                        GroupSummaryResult(HttpStatusCode.OK, string.Empty);
                    }
                    catch
                    {
                        BlockerView.Hide( );

                        ResultView.Show(ConnectStrings.GroupInfo_Failed,
                                        PrivateControlStylingConfig.Result_Symbol_Failed,
                                        ConnectStrings.GroupInfoResult_Failed,
                                        GeneralStrings.Retry);

                        GroupSummaryResult(HttpStatusCode.NotFound, string.Empty);
                    }
                });
            });
        }