예제 #1
0
        public MfaDialog(AudibleApi.MfaConfig mfaConfig)
        {
            InitializeComponent();

            radioButtons = new[] { this.radioButton1, this.radioButton2, this.radioButton3 };

            // optional string settings
            if (!string.IsNullOrWhiteSpace(mfaConfig.Title))
            {
                this.Text = mfaConfig.Title;
            }
            setOptional(this.radioButton1, mfaConfig.Button1Text);
            setOptional(this.radioButton2, mfaConfig.Button2Text);
            setOptional(this.radioButton3, mfaConfig.Button3Text);

            // mandatory values
            radioButton1.Name = mfaConfig.Button1Name;
            radioButton1.Tag  = mfaConfig.Button1Value;

            radioButton2.Name = mfaConfig.Button2Name;
            radioButton2.Tag  = mfaConfig.Button2Value;

            radioButton3.Name = mfaConfig.Button3Name;
            radioButton3.Tag  = mfaConfig.Button3Value;
        }
예제 #2
0
        public MfaDialog(AudibleApi.MfaConfig mfaConfig)
        {
            InitializeComponent();

            _mfaConfig = mfaConfig;

            radioButtons = new[] { this.radioButton1, this.radioButton2, this.radioButton3 };

            // optional string settings
            if (!string.IsNullOrWhiteSpace(mfaConfig.Title))
            {
                this.Text = mfaConfig.Title;
            }

            setRadioButton(0, this.radioButton1);
            setRadioButton(1, this.radioButton2);
            setRadioButton(2, this.radioButton3);

            Serilog.Log.Logger.Information("{@DebugInfo}", new
            {
                paramButtonCount        = mfaConfig.Buttons.Count,
                visibleRadioButtonCount = radioButtons.Count(rb => rb.Visible)
            });
        }