예제 #1
0
        public PushService(IMTProtoService protoService, ICacheService cacheService)
        {
            _protoService = protoService;
            _cacheService = cacheService;

            _registrationLock = new DisposableMutex();
        }
예제 #2
0
        public ContactsService(IMTProtoService protoService, ITelegramEventAggregator aggregator)
        {
            _protoService = protoService;
            _aggregator   = aggregator;

            _syncLock           = new DisposableMutex();
            _importedPhonesRoot = new object();
        }
예제 #3
0
        public ChatSearchViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator, DialogViewModel viewModel)
            : base(protoService, cacheService, settingsService, aggregator)
        {
            _dialog       = viewModel;
            _loadMoreLock = new DisposableMutex();

            NextCommand     = new RelayCommand(NextExecute, NextCanExecute);
            PreviousCommand = new RelayCommand(PreviousExecute, PreviousCanExecute);
        }
예제 #4
0
        public ContactsService(IProtoService protoService, ICacheService cacheService, IEventAggregator aggregator)
        {
            _protoService = protoService;
            _cacheService = cacheService;
            _aggregator   = aggregator;

            _syncLock           = new DisposableMutex();
            _importedPhonesRoot = new object();
        }
예제 #5
0
        public NotificationsService(IProtoService protoService, ICacheService cacheService, IEventAggregator aggregator)
        {
            _protoService = protoService;
            _cacheService = cacheService;
            _aggregator   = aggregator;

            _registrationLock = new DisposableMutex();

            _aggregator.Subscribe(this);
        }
예제 #6
0
        public DialogSearchViewModel(IProtoService protoService, ICacheService cacheService, IEventAggregator aggregator, DialogViewModel viewModel)
            : base(protoService, cacheService, aggregator)
        {
            _dialog       = viewModel;
            _loadMoreLock = new DisposableMutex();

            FilterCommand   = new RelayCommand(FilterExecute);
            NextCommand     = new RelayCommand(NextExecute, NextCanExecute);
            PreviousCommand = new RelayCommand(PreviousExecute, PreviousCanExecute);
            SearchCommand   = new RelayCommand <string>(SearchExecute);
        }
예제 #7
0
        public ContactsViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator, IContactsService contactsService)
            : base(protoService, cacheService, settingsService, aggregator)
        {
            _contactsService = contactsService;

            _loadMoreLock = new DisposableMutex();

            Items = new SortedObservableCollection <User>(new UserComparer(Settings.IsContactsSortedByEpoch));

            Initialize();
        }
예제 #8
0
        public NotificationsService(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator)
        {
            _protoService = protoService;
            _cacheService = cacheService;
            _settings     = settingsService;
            _aggregator   = aggregator;

            _registrationLock = new DisposableMutex();

            _aggregator.Subscribe(this);

            Handle(new UpdateUnreadMessageCount(protoService.UnreadCount, protoService.UnreadUnmutedCount));
        }
예제 #9
0
        public ContactsService(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator)
        {
            _protoService    = protoService;
            _cacheService    = cacheService;
            _settingsService = settingsService;
            _aggregator      = aggregator;

            _syncLock           = new DisposableMutex();
            _importedPhonesRoot = new object();

            _contacts = new HashSet <long>();

            _aggregator.Subscribe <Telegram.Td.Api.UpdateAuthorizationState>(this, Handle);
        }
예제 #10
0
        public ContactsService(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator)
        {
            _protoService    = protoService;
            _cacheService    = cacheService;
            _settingsService = settingsService;
            _aggregator      = aggregator;

            _syncLock           = new DisposableMutex();
            _importedPhonesRoot = new object();

            _contacts = new HashSet <int>();

            _aggregator.Subscribe(this);
        }
예제 #11
0
        public NotificationsService(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, ISessionService sessionService, IEventAggregator aggregator)
        {
            _protoService   = protoService;
            _cacheService   = cacheService;
            _settings       = settingsService;
            _sessionService = sessionService;
            _aggregator     = aggregator;

            _registrationLock = new DisposableMutex();

            _aggregator.Subscribe(this);

            var unreadCount = _cacheService.GetUnreadCount(new ChatListMain());

            Handle(unreadCount.UnreadChatCount);
            Handle(unreadCount.UnreadMessageCount);
        }
예제 #12
0
 /// <summary>Removes the first occurence of an item from the pool.</summary>
 /// <param name="item">The item to remove from the pool.</param>
 /// <param name="mutex">The mutex to use when removing an item from the pool.</param>
 /// <returns><c>true</c> if <paramref name="item" /> was removed from the pool; otherwise, <c>false</c>.</returns>
 public bool Remove(T item, ValueMutex mutex)
 {
     using var disposableMutex = new DisposableMutex(mutex, isExternallySynchronized: false);
     return(Remove(item));
 }
예제 #13
0
 private MediaLibraryCollection()
 {
     _dispatcher   = Window.Current.Dispatcher;
     _loadMoreLock = new DisposableMutex();
 }
예제 #14
0
 public ContactsService()
 {
     _syncLock = new DisposableMutex();
 }