Ejemplo n.º 1
0
        private async void Download_Click(object sender, RoutedEventArgs e)
        {
            if (User)
            {
                PublicSummoner summoner = await RiotCalls.GetSummonerByName(Command.Text);

                if (string.IsNullOrWhiteSpace(summoner.Name))
                {
                    var overlay = new MessageOverlay
                    {
                        MessageTitle   = { Content = "No Summoner Found" },
                        MessageTextBox = { Text = "The summoner \"" + Command.Text + "\" does not exist." }
                    };
                    Client.OverlayContainer.Content    = overlay.Content;
                    Client.OverlayContainer.Visibility = Visibility.Visible;

                    return;
                }
                HintLabel.Content    = "retrieving replay";
                HintLabel.Visibility = Visibility.Visible;
                var fadeLabelInAnimationx = new DoubleAnimation(1, TimeSpan.FromSeconds(0.1));
                HintLabel.BeginAnimation(OpacityProperty, fadeLabelInAnimationx);
                PlatformGameLifecycleDTO n = await RiotCalls.RetrieveInProgressSpectatorGameInfo(Command.Text);

                if (n == null)
                {
                    var overlay = new MessageOverlay
                    {
                        MessageTitle   = { Content = "No Game Found" },
                        MessageTextBox = { Text = "The summoner \"" + Command.Text + "\" is not currently in game." }
                    };
                    Client.OverlayContainer.Content    = overlay.Content;
                    Client.OverlayContainer.Visibility = Visibility.Visible;

                    return;
                }
                if (n.GameName != null)
                {
                    string ip     = n.PlayerCredentials.ObserverServerIp + ":" + n.PlayerCredentials.ObserverServerPort;
                    string key    = n.PlayerCredentials.ObserverEncryptionKey;
                    var    gameId = (int)n.PlayerCredentials.GameId;
                    recorder = new ReplayRecorder(ip, gameId, Client.Region.InternalName, key);
                    recorder.OnReplayRecorded += recorder_OnReplayRecorded;
                    recorder.OnGotChunk       += recorder_OnGotChunk;

                    var fadeGridOutAnimation = new DoubleAnimation(0, TimeSpan.FromSeconds(0.1));
                    Command.Visibility   = Visibility.Hidden;
                    Download.Visibility  = Visibility.Hidden;
                    HintLabel.Visibility = Visibility.Visible;
                    HintLabel.Content    = "Starting replay download";
                }
                HintLabel.Content    = "That player is not in a game";
                HintLabel.Visibility = Visibility.Visible;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Dispose the specified disposing.
        /// </summary>
        /// <returns>The dispose.</returns>
        /// <param name="disposing">If set to <c>true</c> disposing.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                CellBase.PropertyChanged   -= CellPropertyChanged;
                CellParent.PropertyChanged -= ParentPropertyChanged;

                if (CellBase.Section != null)
                {
                    CellBase.Section.PropertyChanged -= SectionPropertyChanged;
                    CellBase.Section = null;
                }


                SelectedBackgroundView?.Dispose();
                SelectedBackgroundView = null;

                Device.BeginInvokeOnMainThread(() =>
                {
                    HintLabel.RemoveFromSuperview();
                    HintLabel.Dispose();
                    HintLabel = null;
                    TitleLabel?.Dispose();
                    TitleLabel = null;
                    DescriptionLabel?.Dispose();
                    DescriptionLabel = null;
                    IconView.RemoveFromSuperview();
                    IconView.Image?.Dispose();
                    IconView.Dispose();
                    IconView = null;
                    _iconTokenSource?.Dispose();
                    _iconTokenSource = null;
                    _iconConstraintWidth?.Dispose();
                    _iconConstraintHeight?.Dispose();
                    _iconConstraintHeight = null;
                    _iconConstraintWidth  = null;
                    ContentStack?.RemoveFromSuperview();
                    ContentStack?.Dispose();
                    ContentStack = null;
                    Cell         = null;

                    StackV?.RemoveFromSuperview();
                    StackV?.Dispose();
                    StackV = null;

                    StackH.RemoveFromSuperview();
                    StackH.Dispose();
                    StackH = null;
                }
                                               );
            }

            base.Dispose(disposing);
        }
Ejemplo n.º 3
0
        private async void Download_Click(object sender, RoutedEventArgs e)
        {
            if (User == true)
            {
                PublicSummoner Summoner = await Client.PVPNet.GetSummonerByName(Command.Text);

                if (String.IsNullOrWhiteSpace(Summoner.Name))
                {
                    MessageOverlay overlay = new MessageOverlay();
                    overlay.MessageTitle.Content       = "No Summoner Found";
                    overlay.MessageTextBox.Text        = "The summoner \"" + Command.Text + "\" does not exist.";
                    Client.OverlayContainer.Content    = overlay.Content;
                    Client.OverlayContainer.Visibility = Visibility.Visible;
                    return;
                }
                HintLabel.Content    = "retrieving replay";
                HintLabel.Visibility = Visibility.Visible;
                var fadeLabelInAnimationx = new DoubleAnimation(1, TimeSpan.FromSeconds(0.1));
                HintLabel.BeginAnimation(Label.OpacityProperty, fadeLabelInAnimationx);
                PlatformGameLifecycleDTO n = await Client.PVPNet.RetrieveInProgressSpectatorGameInfo(Command.Text);

                if (n.GameName != null)
                {
                    int    port = n.PlayerCredentials.ServerPort;
                    string IP;
                    if (port == 0)
                    {
                        IP = n.PlayerCredentials.ObserverServerIp + ":8088";
                    }
                    else
                    {
                        IP = n.PlayerCredentials.ObserverServerIp + ":" + port;
                    }
                    string Key    = n.PlayerCredentials.ObserverEncryptionKey;
                    int    GameID = (Int32)n.PlayerCredentials.GameId;
                    recorder = new ReplayRecorder(IP, GameID, Client.Region.InternalName, Key);
                    recorder.OnReplayRecorded += recorder_OnReplayRecorded;
                    recorder.OnGotChunk       += recorder_OnGotChunk;

                    var fadeGridOutAnimation = new DoubleAnimation(0, TimeSpan.FromSeconds(0.1));
                    Command.Visibility   = Visibility.Hidden;
                    Download.Visibility  = Visibility.Hidden;
                    HintLabel.Visibility = Visibility.Visible;
                    HintLabel.Content    = "Starting replay download";
                    return;
                }
                else
                {
                    HintLabel.Content    = "That player is not in a game";
                    HintLabel.Visibility = Visibility.Visible;
                    return;
                }
            }
        }
Ejemplo n.º 4
0
 private void WaterTextbox_PasswordChanged(object sender, RoutedEventArgs e)
 {
     if (WaterTextbox.Password.Length > 0)
     {
         var fadeLabelOutAnimation = new DoubleAnimation(0, TimeSpan.FromSeconds(0.1));
         HintLabel.BeginAnimation(Label.OpacityProperty, fadeLabelOutAnimation);
     }
     else
     {
         var fadeLabelInAnimation = new DoubleAnimation(1, TimeSpan.FromSeconds(0.1));
         HintLabel.BeginAnimation(Label.OpacityProperty, fadeLabelInAnimation);
     }
 }
Ejemplo n.º 5
0
		protected override void Init()
		{
			var label = new Label
			{
				Text = $"There should be an empty label below this one. If the label shows a period (.), this test has failed. There should also be a label that says \"{HintLabel.Success}\"."
			};

			var emptyLabel = new Label { HorizontalTextAlignment = TextAlignment.Center };

			var customLabel = new HintLabel { HorizontalTextAlignment = TextAlignment.Center };
			;

			Content = new StackLayout { Children = { label, emptyLabel, customLabel } };
		}
Ejemplo n.º 6
0
        private void Download_Click(object sender, RoutedEventArgs e)
        {
            HintLabel.Content    = "retrieving replay";
            HintLabel.Visibility = Visibility.Visible;
            var fadeLabelInAnimation = new DoubleAnimation(1, TimeSpan.FromSeconds(0.1));

            HintLabel.BeginAnimation(Label.OpacityProperty, fadeLabelInAnimation);

            string SpectatorCommand = Command.Text;

            string[] RemoveExcessInfo = SpectatorCommand.Split(new string[1] {
                "spectator "
            }, StringSplitOptions.None);

            if (RemoveExcessInfo.Length != 2)
            {
                HintLabel.Content    = "invalid command";
                HintLabel.Visibility = Visibility.Visible;
                return;
            }

            string[] Info = RemoveExcessInfo[1].Replace("\"", "").Split(' ');

            if (Info.Length != 4)
            {
                HintLabel.Content    = "invalid command";
                HintLabel.Visibility = Visibility.Visible;
                return;
            }

            Command.Text = "";

            int GameId = Convert.ToInt32(Info[2]);

            recorder = new ReplayRecorder(Info[0], GameId, Info[3], Info[1]);
            recorder.OnReplayRecorded += recorder_OnReplayRecorded;
            recorder.OnGotChunk       += recorder_OnGotChunk;

            var fadeGridOutAnimation = new DoubleAnimation(0, TimeSpan.FromSeconds(0.1));

            Command.Visibility  = Visibility.Hidden;
            Download.Visibility = Visibility.Hidden;
        }
 void ReleaseDesignerOutlets()
 {
     if (ControlsOverlay != null)
     {
         ControlsOverlay.Dispose();
         ControlsOverlay = null;
     }
     if (FinishRoundButton != null)
     {
         FinishRoundButton.Dispose();
         FinishRoundButton = null;
     }
     if (HintLabel != null)
     {
         HintLabel.Dispose();
         HintLabel = null;
     }
     if (OverlayView != null)
     {
         OverlayView.Dispose();
         OverlayView = null;
     }
     if (PlayerOnePlayerNameLabel != null)
     {
         PlayerOnePlayerNameLabel.Dispose();
         PlayerOnePlayerNameLabel = null;
     }
     if (PlayerOneProfilePictureImage != null)
     {
         PlayerOneProfilePictureImage.Dispose();
         PlayerOneProfilePictureImage = null;
     }
     if (PlayerOneTimeElapsed != null)
     {
         PlayerOneTimeElapsed.Dispose();
         PlayerOneTimeElapsed = null;
     }
     if (PlayerOneViewContainer != null)
     {
         PlayerOneViewContainer.Dispose();
         PlayerOneViewContainer = null;
     }
     if (PlayerTwoPlayerNameLabel != null)
     {
         PlayerTwoPlayerNameLabel.Dispose();
         PlayerTwoPlayerNameLabel = null;
     }
     if (PlayerTwoProfilePictureImage != null)
     {
         PlayerTwoProfilePictureImage.Dispose();
         PlayerTwoProfilePictureImage = null;
     }
     if (PlayerTwoTimeElapsed != null)
     {
         PlayerTwoTimeElapsed.Dispose();
         PlayerTwoTimeElapsed = null;
     }
     if (PlayerTwoViewContainer != null)
     {
         PlayerTwoViewContainer.Dispose();
         PlayerTwoViewContainer = null;
     }
 }