OAuth 認証を提供します。
Inheritance: IDisposable
Exemplo n.º 1
0
		public AuthenticateWindow(OAuthAuthorization authorization)
		{
			InitializeComponent();

			if (authorization.Token != null)
				this.Title += ": " + authorization.Token.Name;

			this.ViewModel.Authorization = authorization;
			this.ViewModel.RequestClose += (sender, e) => this.DialogResult = e.Value;
			this.ViewModel.RequestError += (sender, e) => Application.Current.Dispatcher.BeginInvoke((Action)(() => MessageBoxEx.Show(this, e.Value.Message, this.Title, MessageBoxButton.OK, MessageBoxImage.Exclamation)), DispatcherPriority.Background);
		}
Exemplo n.º 2
0
		/// <summary>
		/// 指定された認証を使用して非同期に User Streams に接続を開始します。
		/// </summary>
		/// <param name="auth">OAuth 認証。</param>
		/// <returns>接続が開始されたかどうか。</returns>
		public bool Connect(OAuthAuthorization auth)
		{
			if (streamingThread != null)
				return false;

			streamingThread = new Thread(ThreadMain)
			{
				IsBackground = true,
			};
			streamingThread.Start(auth);

			return true;
		}