private static void RemoveAccount(AuthenticateInfo info) { lock (_dictLock) { _dictionary.Remove(info.Id); } }
public SearchCandidateItemViewModel(SearchCandidateViewModel parent, AuthenticateInfo authenticateInfo, long id, string query) { _parent = parent; _authenticateInfo = authenticateInfo; _id = id; _query = query; }
public RelationControlViewModel(UserInfoViewModel parent, AuthenticateInfo source, TwitterUser target) { this._parent = parent; this._source = source; this._target = target; var rds = source.GetRelationData(); this.IsFollowing = rds.IsFollowing(target.Id); this.IsFollowedBack = rds.IsFollowedBy(target.Id); this.IsBlocking = rds.IsBlocking(target.Id); source.GetFriendship(source.Id, target_id: target.Id) .Subscribe( r => { // ReSharper disable InvertIf if (this.IsFollowing != r.relationship.source.following) { this.IsFollowing = r.relationship.source.following; if (r.relationship.source.following) { rds.AddFollowing(target.Id); } else { rds.RemoveFollowing(target.Id); } } if (this.IsFollowedBack != r.relationship.source.followed_by) { this.IsFollowedBack = r.relationship.source.followed_by; if (r.relationship.source.followed_by) { rds.AddFollower(target.Id); } else { rds.RemoveFollower(target.Id); } } if (this.IsBlocking != r.relationship.source.blocking) { this.IsBlocking = r.relationship.source.blocking; if (r.relationship.source.blocking) { rds.AddBlocking(target.Id); } else { rds.RemoveBlocking(target.Id); } } // ReSharper restore InvertIf }, ex => { this.Enabled = false; }); }
public override IObservable<TwitterStatus> Upload(AuthenticateInfo authInfo, string status, byte[] attachedImageBin, long? in_reply_to_status_id = null, double? geo_lat = null, double? geo_long = null) { return authInfo.UpdateWithMedia( status, attachedImageBin, "twitter_picture", false, in_reply_to_status_id, geo_lat, geo_long); }
protected PollingConnectionBase(AuthenticateInfo ai) : base(ai) { _disposablesHolder.Add(Observable.FromEvent( h => App.OnApplicationFinalize += h, h => App.OnApplicationFinalize -= h) .Subscribe(_ => this.Dispose())); _disposablesHolder.Add(Observable.Interval(TimeSpan.FromSeconds(1)) .Subscribe(_ => OnTick())); // ReSharper disable DoNotCallOverridableMethodsInConstructor _currentTick = IntervalSec; // first receive occurs immediately. // ReSharper restore DoNotCallOverridableMethodsInConstructor }
public BackstageAccountModel(AuthenticateInfo info) { this._info = info; this.UpdateConnectionState(); StoreHelper.GetUser(_info.Id) .Subscribe( u => { _user = u; this.OnTwitterUserChanged(); }, ex => BackstageModel.RegisterEvent( new OperationFailedEvent("Could not receive user info: " + this._info.UnreliableScreenName + " - " + ex.Message))); }
public void StartReceive(AuthenticateInfo auth, ListInfo info) { lock (_listReceiverLocker) { if (_listReceiverReferenceCount.ContainsKey(info)) { _listReceiverReferenceCount[info]++; } else { var lr = new ListReceiver(auth, info); _listReceiverReferenceCount.Add(info, 1); _listReceiverResolver.Add(info, lr); } } }
private static void SetupAccount(AuthenticateInfo info) { lock (_dictLock) { if (_dictionary.ContainsKey(info.Id)) return; _dictionary.Add(info.Id, new LinkedList<TwitterStatus>()); StatusStore.FindBatch(s => s.User.Id == info.Id, Setting.PostLimitPerWindow.Value) .Subscribe(PostDetected); } }
public TrackLimitEvent(AuthenticateInfo relatedInfo, int drop) { this._info = relatedInfo; this._drop = drop; }
public static void RegisterList(AuthenticateInfo authInfo, ListInfo info) { _listReceiveManager.StartReceive(authInfo, info); }
public UserReceiveBundle(AuthenticateInfo authInfo) { _authInfo = authInfo; // ReSharper disable UseObjectOrCollectionInitializer _disposable = new CompositeDisposable(); _disposable.Add(_userStreamsReceiver = new UserStreamsReceiver(authInfo)); _disposable.Add(_homeTimelineReceiver = new HomeTimelineReceiver(authInfo)); _disposable.Add(_mentionTimelineReceiver = new MentionTimelineReceiver(authInfo)); _disposable.Add(_directMessagesReceiver = new DirectMessagesReceiver(authInfo)); _disposable.Add(_userInfoReceiver = new UserInfoReceiver(authInfo)); _disposable.Add(_userRelationReceiver = new UserRelationReceiver(authInfo)); // ReSharper restore UseObjectOrCollectionInitializer _userStreamsReceiver.StateChanged += () => this.OnStateChanged(this.UserId); }
public static void ReceiveMentionTimeline(AuthenticateInfo info, long? maxId = null) { info.GetMentions(count: 100, include_rts: false, max_id: maxId) .RegisterToStore(); }
/// <summary> /// returns updated status. /// </summary> public abstract IObservable<TwitterStatus> Upload(AuthenticateInfo authInfo, string status, byte[] attachedImageBin, long? in_reply_to_status_id = null, double? geo_lat = null, double? geo_long = null);
public ListReceiver(AuthenticateInfo auth, ListInfo listInfo) { _auth = auth; _listInfo = listInfo; }
public FallbackedEvent(AuthenticateInfo authInfo, AuthenticateInfo fallbackTo) { this._authInfo = authInfo; this._fallbackToAuthInfo = fallbackTo; }
public static void NotifyLimitationInfoGot(AuthenticateInfo auth, int trackLimit) { Action<AuthenticateInfo, int> handler = OnLimitationInfoGot; if (handler != null) handler(auth, trackLimit); }
public MentionTimelineReceiver(AuthenticateInfo authInfo) { _authInfo = authInfo; }
public PostResult(AuthenticateInfo info, Exception ex) { AuthInfo = info; IsSucceeded = false; ThrownException = ex; }
public PostResult(AuthenticateInfo info, TwitterStatus status) { AuthInfo = info; IsSucceeded = true; Status = status; }
public static void ReceiveMessages(AuthenticateInfo info, long? maxId = null) { info.GetDirectMessages(count: 50, max_id: maxId) .RegisterToStore(); }
protected IObservable<TwitterStatus> Update(AuthenticateInfo info, string status, long? inReplyToId, long? geoLat, long? geoLong) { return info.Update(status, inReplyToId, geoLat, geoLong); }
public UserTimelinesReceiver(AuthenticateInfo info) : base(info) { }
private static void SetupAccount(AuthenticateInfo info) { lock (_dictLock) { if (_dictionary.ContainsKey(info.Id)) return; _dictionary.Add(info.Id, new LinkedList<TwitterStatus>()); } }
public HomeTimelineReceiver(AuthenticateInfo authInfo) { _authInfo = authInfo; }
public static IObservable<TwitterStatus> DoReceive(AuthenticateInfo info, ListInfo list, long? maxId = null) { return info.GetListStatuses(slug: list.Slug, owner_screen_name: list.OwnerScreenName, max_id: maxId); }
public static AuthenticateInfo BacktrackFallback(AuthenticateInfo info) { if (!Setting.IsBacktrackFallback.Value) return info; var cinfo = info; while (true) { var backtrack = AccountsStore.Accounts .FirstOrDefault(i => i.FallbackNext == cinfo.Id); if (backtrack == null) return cinfo; if (backtrack.UserId == info.Id) return info; cinfo = backtrack.AuthenticateInfo; } }
public SelectableAccountViewModel(AccountSelectorViewModel parent, AuthenticateInfo info, Action onSelectionChanged) { this._parent = parent; this._info = info; this._onSelectionChanged = onSelectionChanged; }
public static void ReceiveHomeTimeline(AuthenticateInfo info, long? maxId = null) { info.GetHomeTimeline(count: 100, include_rts: true, include_entities: true, max_id: maxId) .RegisterToStore(); }
public UserRelationReceiver(AuthenticateInfo authInfo) { _authInfo = authInfo; }
public AuthenticateInfoViewModel(AuthenticateInfo info) { _authInfo = info; }