Esempio n. 1
0
        /// <summary>
        /// called when a new pin is available. Show this pin somewhere in your ui, and only hide it when either CastStart or CastEnd have been called.
        /// only called when RequirePinAuth is set to true.
        /// </summary>
        /// <param name="transmitterName">name of the transmitter to authentificate</param>
        /// <param name="pin">the pin that is available</param>
        void OnPinAvailable(string transmitterName, string pin)
        {
            Log($"new pin available: {pin}");

            //init cast ui and show pin
            if (castUI == null)
            {
                castUI = new ImmersiveCastUI(S.AppName);
            }
            castUI.MoveToScreen(App.Config.CastDisplayId);
            castUI.SetPin(S.CastPinMessage.ReplaceMap(new Dictionary <string, string>
            {
                { "{DisplayName}", miracastReceiver.DisplayName },
                { "{Transmitter}", transmitterName },
                { "{Pin}", pin }
            }));
            castUI.ShowImmersive();
        }