Exemple #1
0
        private async void ViewProfileDialog_Load(object sender, System.EventArgs e)
        {
            button8.Enabled = mUserId != mApi.UserId;
            var profile = await mApi.FetchUserProfileAsync(mUserId);

            if (profile != null)
            {
                if (profile.Status == 0)
                {
                    MessageBox.Show(profile.Error, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    var userTitle = String.IsNullOrEmpty(profile.UserTitle) ? "" : "・" + profile.UserTitle;
                    this.Text = "『" + profile.UserName + profile.UserDan + userTitle + "』のプロフィール";
                    if (!String.IsNullOrEmpty(profile.Text))
                    {
                        textBox2.Text = profile.Text.Replace("\n", "\r\n");
                    }
                }
            }
            else
            {
                MessageBox.Show("プロフィールの取得に失敗しました", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            var balance = await mApi.FetchBlanceAsync(0);

            if (balance != null)
            {
                if (balance.Status == 0)
                {
                    MessageBox.Show(balance.Error, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    textBox4.Text = (double.Parse(balance.Value) / 100000000).ToString("F8");
                }
            }
            else
            {
                MessageBox.Show("残高の取得に失敗しました", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #2
0
        private async void SendMonaDialog_Load(object sender, System.EventArgs e)
        {
            var result = await mApi.FetchBlanceAsync(0);

            if (result != null)
            {
                if (result.Status == 0)
                {
                    MessageBox.Show(result.Error, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    textBox4.Text = (double.Parse(result.Value) / 100000000).ToString("F8");
                }
            }
            else
            {
                MessageBox.Show("残高の取得に失敗しました", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #3
0
        private async void ScatterMonaDialog_Load(object sender, EventArgs e)
        {
            var responseList = await mApi.FetchResponseListAsync(mTopic.Id, 1, 1000, 1, mTopic.Modified);

            if (responseList != null)
            {
                if (responseList.Status == 0)
                {
                    MessageBox.Show(responseList.Error, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else if (responseList.Status != 2)
                {
                    mTopic        = responseList.Topic;
                    mResponseList = responseList;
                }
            }
            textBox2.Text  = FilterResponseList(mResponseList.Responses).Count().ToString();
            timer1.Enabled = true;

            var result = await mApi.FetchBlanceAsync(0);

            if (result != null)
            {
                if (result.Status == 0)
                {
                    MessageBox.Show(result.Error, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    textBox4.Text = (double.Parse(result.Value) / 100000000).ToString("F8");
                }
            }
            else
            {
                MessageBox.Show("残高の取得に失敗しました", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }