質問編集履歴
4
title
CHANGED
File without changes
|
body
CHANGED
@@ -70,7 +70,7 @@
|
|
70
70
|
public Tokenss tokensa = new Tokenss();
|
71
71
|
public Tokens tokens;
|
72
72
|
public int inital = 0;
|
73
|
-
public OAuthSession oauth = Authorize("
|
73
|
+
public OAuthSession oauth = Authorize("", "");
|
74
74
|
public MainWindow()
|
75
75
|
{
|
76
76
|
InitializeComponent();
|
3
補足追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -164,5 +164,10 @@
|
|
164
164
|
|
165
165
|
```
|
166
166
|
###補足情報(言語/FW/ツール等のバージョンなど)
|
167
|
+
ソースは上から
|
168
|
+
MainWindow.xaml
|
169
|
+
MainWindow.xaml.cs
|
170
|
+
Token.xaml
|
171
|
+
Token.xaml.cs
|
167
172
|
環境はVisualStudio2017
|
168
173
|
C#とXaml
|
2
他のファイルのコードも記入しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -42,7 +42,127 @@
|
|
42
42
|
</Window>
|
43
43
|
|
44
44
|
```
|
45
|
+
```MainWindow.xaml.cs
|
46
|
+
using System;
|
47
|
+
using System.Collections.Generic;
|
48
|
+
using System.Linq;
|
49
|
+
using System.Text;
|
50
|
+
using System.Windows;
|
51
|
+
using System.Windows.Controls;
|
52
|
+
using System.Windows.Data;
|
53
|
+
using System.Windows.Documents;
|
54
|
+
using System.Windows.Input;
|
55
|
+
using System.Windows.Media;
|
56
|
+
using System.Windows.Media.Imaging;
|
57
|
+
using System.Windows.Navigation;
|
58
|
+
using System.Windows.Shapes;
|
59
|
+
using CoreTweet;
|
60
|
+
using System.Diagnostics;
|
61
|
+
using static CoreTweet.OAuth;
|
45
62
|
|
63
|
+
namespace TweetOnlyClient
|
64
|
+
{
|
65
|
+
/// <summary>
|
66
|
+
/// MainWindow.xaml の相互作用ロジック
|
67
|
+
/// </summary>
|
68
|
+
public partial class MainWindow : Window
|
69
|
+
{
|
70
|
+
public Tokenss tokensa = new Tokenss();
|
71
|
+
public Tokens tokens;
|
72
|
+
public int inital = 0;
|
73
|
+
public OAuthSession oauth = Authorize("AGCFWxBG3kSoXmmCPh8t8A5A6", "j5tXJ7BfWj9EscWC4qUE282VFKBpPWtRUavrxNozpv0YBl7C2l");
|
74
|
+
public MainWindow()
|
75
|
+
{
|
76
|
+
InitializeComponent();
|
77
|
+
if (inital == 0)
|
78
|
+
{
|
79
|
+
tokensa.Show();
|
80
|
+
Hide();
|
81
|
+
inital++;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
private void Window_KeyDown(object sender, KeyEventArgs e)
|
86
|
+
{
|
87
|
+
if(e.Key == Key.LeftCtrl||e.Key == Key.RightCtrl&&e.Key == Key.Enter)
|
88
|
+
{
|
89
|
+
if (TweetBOx.Text == null || TweetBOx.Text == "")
|
90
|
+
{
|
91
|
+
tokens.Statuses.Update(status => TweetBOx.Text);
|
92
|
+
TweetBOx.Text = "";
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
private void Tweet_Click(object sender, RoutedEventArgs e)
|
98
|
+
{
|
99
|
+
tokens.Statuses.Update(status => TweetBOx.Text);
|
100
|
+
TweetBOx.Text = "";
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
```
|
105
|
+
```Token.xaml
|
106
|
+
<Window x:Class="TweetOnlyClient.Tokenss"
|
107
|
+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
108
|
+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
109
|
+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
110
|
+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
111
|
+
xmlns:local="clr-namespace:TweetOnlyClient"
|
112
|
+
mc:Ignorable="d"
|
113
|
+
Title="取得したPINを入力してください。" Height="101" Width="200" Activated="Window_Activated">
|
114
|
+
<Grid>
|
115
|
+
<TextBox Name="TextBox1" HorizontalAlignment="Left" Height="23" Margin="10,35,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="90"/>
|
116
|
+
<Label Content="取得したPINを入力してください。" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top"/>
|
117
|
+
<Button Content="Submit" HorizontalAlignment="Left" Margin="105,35,0,0" VerticalAlignment="Top" Width="75" Height="23" Click="Button_Click"/>
|
118
|
+
|
119
|
+
</Grid>
|
120
|
+
</Window>
|
121
|
+
```
|
122
|
+
```Token.xaml.cs
|
123
|
+
using System;
|
124
|
+
using System.Collections.Generic;
|
125
|
+
using System.Linq;
|
126
|
+
using System.Text;
|
127
|
+
using System.Windows;
|
128
|
+
using System.Windows.Controls;
|
129
|
+
using System.Windows.Data;
|
130
|
+
using System.Windows.Documents;
|
131
|
+
using System.Windows.Input;
|
132
|
+
using System.Windows.Media;
|
133
|
+
using System.Windows.Media.Imaging;
|
134
|
+
using System.Windows.Shapes;
|
135
|
+
using CoreTweet;
|
136
|
+
|
137
|
+
namespace TweetOnlyClient
|
138
|
+
{
|
139
|
+
/// <summary>
|
140
|
+
/// Token.xaml の相互作用ロジック
|
141
|
+
/// </summary>
|
142
|
+
public partial class Tokenss : Window
|
143
|
+
{
|
144
|
+
public static MainWindow main = new MainWindow();
|
145
|
+
public Tokenss()
|
146
|
+
{
|
147
|
+
InitializeComponent();
|
148
|
+
System.Diagnostics.Process.Start(main.oauth.AuthorizeUri.AbsoluteUri);
|
149
|
+
}
|
150
|
+
|
151
|
+
private void Button_Click(object sender, RoutedEventArgs e)
|
152
|
+
{
|
153
|
+
main.tokens = main.oauth.GetTokens(TextBox1.Text);
|
154
|
+
main.Show();
|
155
|
+
Hide();
|
156
|
+
}
|
157
|
+
|
158
|
+
private void Window_Activated(object sender, EventArgs e)
|
159
|
+
{
|
160
|
+
|
161
|
+
}
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
```
|
46
166
|
###補足情報(言語/FW/ツール等のバージョンなど)
|
47
167
|
環境はVisualStudio2017
|
48
168
|
C#とXaml
|
1
初心者マークをつけただけです
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|