Esempio n. 1
0
        public EventsCreateViewModel(IGoogleCalendar googleCalendar, IRecurrenceSettings recurrenceSettings, IRepository commonRepository, IMessanger commonMessanger)
        {
            try
            {
                log.Debug("Loading EventsCreate view model...");

                calendar = googleCalendar;
                repository = commonRepository;
                messanger = commonMessanger;
                recurrence = recurrenceSettings;

                CreateEventCommand = new RelayCommand(CreateEvent);
                UpdateEventCommand = new RelayCommand(UpdateEvent);
                QuickActionCommand = new RelayCommand(QuickAction);
                CancelUpdateEventCommand = new RelayCommand(CancelUpdateEvent);

                // For Update Events
                eventUpdater = repository.GetEventUpdater();
                if (eventUpdater.Type != GoogleCalendar.ActionType.none)
                {
                    IsUpdate = true;
                    SetUpdateEventSettings(eventUpdater);
                }

                log.Debug("EventsCreate view model was succssfully loaded");
            }
            catch(Exception ex)
            {
                log.Error("Failed to load EventsCreate view model:", ex);
            }
        }
Esempio n. 2
0
 public Receiver(WebSocket webSocket, IMessanger messanger, string receiverId, string docId)
 {
     _webSocket = webSocket;
     _messanger = messanger;
     ReceiverId = receiverId;
     DocId      = docId;
 }
        public ContentViewModel(IMessanger messanger)
        {
            //logger.Info("asd");
            messanger.Subscribe <string>(OnMessageArrived).ExecuteOn(MessageProcessingThread.Dispatcher);

            Button = new DummyCommand(this, messanger);
        }
Esempio n. 4
0
        public override void Start(IMessanger messanger)
        {
            this.ts = TeamSpeak.GetTeamspeak(ConfigurationManager.AppSettings["tsServer"], Int32.Parse(ConfigurationManager.AppSettings["tsQueryPort"]));
            this.ts.ErrorOccured += this.ts_ErrorOccured;

            base.Start(messanger);
        }
Esempio n. 5
0
        public AddQuickEventViewModel(IGoogleCalendar googleCalendar, IRepository commonRepository, IMessanger commonMessanger)
        {
            try
            {
                log.Debug("Loading AddQuickEvent view model...");

                calendar             = googleCalendar;
                repository           = commonRepository;
                messanger            = commonMessanger;
                quickEventsTemplates = repository.GetQuickEventsTemplates();
                LoadData();

                SelectTemplateCommand   = new RelayCommand(SelectTemplate);
                MoveUpTemplateCommand   = new RelayCommand(MoveUpTemplate);
                MoveDownTemplateCommand = new RelayCommand(MoveDownTemplate);
                RemoveTemplateCommand   = new RelayCommand(RemoveTemplate);
                AddQuickEventCommand    = new RelayCommand(AddQuickEvent);
                SaveAsTemplateCommand   = new RelayCommand(SaveAsTemplate);

                log.Debug("AddQuickEvent view model was succssfully loaded");
            }
            catch (Exception ex)
            {
                log.Error("Failed to load AddQuickEvent view model:", ex);
            }
        }
Esempio n. 6
0
        public void Start(IMessanger messanger)
        {
            this.listening = true;
            this.messanger = messanger;

            try
            {
                this.connection = new MySqlConnection(Forums.ConnectionString);
                this.connection.Open();
            }
            catch (MySqlException ex)
            {
                this.messanger.SendToChannel("ForumPosts module b0rked: " + ex.Message);
                this.Stop();

                return;
            }

            Thread listenerThread = new Thread(this.Listener)
            {
                Name         = "Forum post listener",
                IsBackground = true
            };

            listenerThread.Start();
        }
Esempio n. 7
0
 /// <summary>
 ///     Ctor.
 /// </summary>
 /// <param name="resourceManager">the resource manager class used to merging resources.</param>
 protected ModuleBase(IResourceManager resourceManager, IMessanger messanger, IContainer container)
 {
     Container       = container;
     ResourceManager = resourceManager;
     this.messanger  = messanger;
     PublishSystemMessage(string.Format("Module {0} has been created", typeof(T)));
 }
Esempio n. 8
0
        public AddQuickEventViewModel(IGoogleCalendar googleCalendar, IRepository commonRepository, IMessanger commonMessanger)
        {
            try
            {
                log.Debug("Loading AddQuickEvent view model...");

                calendar = googleCalendar;
                repository = commonRepository;
                messanger = commonMessanger;
                quickEventsTemplates = repository.GetQuickEventsTemplates();
                LoadData();

                SelectTemplateCommand = new RelayCommand(SelectTemplate);
                MoveUpTemplateCommand = new RelayCommand(MoveUpTemplate);
                MoveDownTemplateCommand = new RelayCommand(MoveDownTemplate);
                RemoveTemplateCommand = new RelayCommand(RemoveTemplate);
                AddQuickEventCommand = new RelayCommand(AddQuickEvent);
                SaveAsTemplateCommand = new RelayCommand(SaveAsTemplate);

                log.Debug("AddQuickEvent view model was succssfully loaded");
            }
            catch (Exception ex)
            {
                log.Error("Failed to load AddQuickEvent view model:", ex);
            }
        }
Esempio n. 9
0
        public ChatViewModel()
        {
            messanger = DependencyService.Get <IMessanger>();
            Messages  = new ObservableRangeCollection <Message>();

            SendCommand = new Command(() =>
            {
                var message = new Message
                {
                    Text    = OutGoingText,
                    OutOrIn = true
                };

                Messages.Add(message);
                messanger?.SendMessage(message.Text);
                OutGoingText = string.Empty;
            });

            //if (messanger == null)
            //{
            //    return;
            //}

            //messanger.MessageAdded = (message) =>
            //{
            //    Messages.Add(message);
            //};
        }
 public MarkersService(IMarkersDAL dal, IDocumentDAL DocumentDAL, IMessanger messanger, IDocumentSharingService documentSharingService)
 {
     _DocumentDAL            = DocumentDAL;
     _documentSharingService = documentSharingService;
     _dal       = dal;
     _messanger = messanger;
 }
Esempio n. 11
0
        public OtherContentViewModel(IMessanger messanger)
        {
            messanger.Subscribe <string>(OnMessageArrived).ExecuteOn(MessageProcessingThread.Dispatcher);

            Button     = new DummyCommandTwo(this, messanger);
            base.Title = "asd";
        }
Esempio n. 12
0
 public CommentService(IMarkersDAL markersDAL, ICommentDAL dal, IDocumentSharingService documentSharingService, IMessanger messanger)
 {
     _DAL = dal;
     _documentSharingService = documentSharingService;
     _messanger  = messanger;
     _markersDAL = markersDAL;
 }
Esempio n. 13
0
        public MainPresenter(IMainForm view)
        {
            this.log   = new Log();
            this.score = new Score();
            log.ReadFile();
            score.StartWindow();
            this.player     = new Player(score.NamePlayer);
            this.bot        = new Bot();
            this.save       = new Saver();
            this.load       = new Loader();
            this.view       = view;
            this.controller = new GameController(player, bot);
            this.messange   = new Messanger(player, bot, view);
            if (score.LoadStatus == true)
            {
                controller.LoadPlayer(load.LoadPlayer(score.NamePlayer));
                RefreshProgress();
            }
            StringBuilder str = new StringBuilder();

            str.Append("У вас осталось ");
            str.Append(player.Bonus);
            str.Append(" свободных статов");
            view.LabelStat = str.ToString();
            controller.SetBotStat();
            messange.Message();
            View();
            view.Fight             += view_Fight;
            view.NextBatle         += view_NextBatle;
            view.PlayerStrengthAdd += view_PlayerStrengthAdd;
            view.PlayerArmorAdd    += view_PlayerArmorAdd;
            view.Save += view_Save;
        }
Esempio n. 14
0
        public EventsCreateViewModel(IGoogleCalendar googleCalendar, IRecurrenceSettings recurrenceSettings, IRepository commonRepository, IMessanger commonMessanger)
        {
            try
            {
                log.Debug("Loading EventsCreate view model...");

                calendar   = googleCalendar;
                repository = commonRepository;
                messanger  = commonMessanger;
                recurrence = recurrenceSettings;

                CreateEventCommand       = new RelayCommand(CreateEvent);
                UpdateEventCommand       = new RelayCommand(UpdateEvent);
                QuickActionCommand       = new RelayCommand(QuickAction);
                CancelUpdateEventCommand = new RelayCommand(CancelUpdateEvent);

                // For Update Events
                eventUpdater = repository.GetEventUpdater();
                if (eventUpdater.Type != GoogleCalendar.ActionType.none)
                {
                    IsUpdate = true;
                    SetUpdateEventSettings(eventUpdater);
                }

                log.Debug("EventsCreate view model was succssfully loaded");
            }
            catch (Exception ex)
            {
                log.Error("Failed to load EventsCreate view model:", ex);
            }
        }
Esempio n. 15
0
 public SplashViewModel(IMessanger messanger)
 {
     Messages = new ObservableCollection <string>();
     messangerSubscription =
         messanger.Subscribe <SystemNotyficationMessage>(OnMessageArrive)
         .ExecuteOn(MessageProcessingThread.Dispatcher);
 }
Esempio n. 16
0
 public WebhookController(IMessanger messanger,
                          CommandFactory commandFactory,
                          UserRepository userRepo)
 {
     _messanger      = messanger;
     _commandFactory = commandFactory;
     _userRepo       = userRepo;
 }
Esempio n. 17
0
 public DummyModule(IResourceManager resourceManager, INavigationManager navigationManager,
                    IRegionManager regionManager, IMessanger messanger, IContainer container)
     : base(resourceManager, messanger, container)
 {
     this.navigationManager = navigationManager;
     this.regionManager     = regionManager;
     messanger.Publish("publish from module;");
 }
Esempio n. 18
0
 public SettingsViewModel(IRepository commonRepository, IMessanger commonMessanger)
 {
     repository          = commonRepository;
     dateTimePreferences = repository.GetDateTimePreferences();
     messanger           = commonMessanger;
     LoadDateTimePreferences();
     SaveDateTimePreferencesCommand = new RelayCommand(SaveDateTimePreferences);
 }
Esempio n. 19
0
 public async Task SendMessage(string userId, IMessanger client)
 {
     if (_title != null)
     {
         await _title.SendMessage(userId, client);
     }
     await Task.WhenAll(_texts.Select(t => t.SendMessage(userId, client)));
 }
Esempio n. 20
0
 public SettingsViewModel(IRepository commonRepository, IMessanger commonMessanger)
 {
     repository = commonRepository;            
     dateTimePreferences = repository.GetDateTimePreferences();
     messanger = commonMessanger;
     LoadDateTimePreferences();            
     SaveDateTimePreferencesCommand = new RelayCommand(SaveDateTimePreferences);
 }
Esempio n. 21
0
 public async Task SendMessage(string userId, IMessanger client)
 {
     await client.SendMessage(userId,
                              new TextData
     {
         Text = _text
     });
 }
Esempio n. 22
0
 public TabCategoryViewModel(IMessanger messageService)
 {
     if (messageService == null)
     {
         throw ArgumentNullException("messageService");
     }
     this.messageService = messageService;
     this.messageService.Register <GoToPageMessage>(this, OnSelectedViewChanged);
 }
Esempio n. 23
0
        public ShopMapFragment(IMessanger messanger,
                               IGeolocationService geolocationService,
                               ISettingsRepository settingsRepository)
        {
            _token = messanger.Subscribe <ShopCreatedMessage>(HandleShopCreated);

            _geolocationService = geolocationService;
            _settingsRepository = settingsRepository;
        }
Esempio n. 24
0
        public Service(IDBRepository repository, IMapper mapper, IMessanger messanger, ILogger <IService> logger)
        {
            Verify(repository, mapper, messanger, logger);

            _repository = repository;
            _mapper     = mapper;
            _messanger  = messanger;
            _logger     = logger;
        }
Esempio n. 25
0
        public ContentViewModel(IMessanger messanger)
        {
            //logger.Info("asd");
            messanger.Subscribe <string>(OnMessageArrived).ExecuteOn(MessageProcessingThread.Dispatcher);

            Button     = new DummyCommand(this, messanger);
            base.Title = "asd";
            Items      = new ObservableCollection <string>(new[] { "-- All --", "Anna", "annie", "cookie", "lolo test" });
            Reset      = new ResetKey();
        }
Esempio n. 26
0
 public SchedulerController(IMessanger messanger,
                            SnowfallChecker snowfallChecker,
                            UserRepository userRepo,
                            SubscriptionRepository subscriptionRepo)
 {
     _messanger        = messanger;
     _snowfallChecker  = snowfallChecker;
     _userRepo         = userRepo;
     _subscriptionRepo = subscriptionRepo;
 }
Esempio n. 27
0
        public void Start(IMessanger messanger)
        {
            this.messanger = messanger;

            this.ts = TeamSpeak.GetTeamspeak(ConfigurationManager.AppSettings["tsServer"], Int32.Parse(ConfigurationManager.AppSettings["tsQueryPort"]));
            this.ts.ErrorOccured += this.ts_ErrorOccured;
            this.ts.PlayerJoined += this.ts_PlayerJoined;
            this.ts.PlayerLeft   += this.ts_PlayerLeft;
            this.ts.StartListener(15000);
        }
Esempio n. 28
0
 public override void PostConfiguration(IContainer container, IMessanger messanger)
 {
     // lets setup main window name and icon
     if (container.IsTypeRegistered <IShellViewModel>())
     {
         var shellViewModel = container.Resolve <IShellViewModel>();
         shellViewModel.Icon  = new Uri("pack://application:,,,/Wise.Framework.Presentation.Resources;component/Resources/1389141962_229117.ico", UriKind.Absolute);
         shellViewModel.Title = "Wise Test WPF Application";
     }
 }
Esempio n. 29
0
        /// <summary>
        /// Starts the plugin
        /// </summary>
        /// <param name="m">The messanger the plugin should use to communicate</param>
        public void Start(IMessanger m)
        {
            this.messanger = m;
            this.listening = true;

            (this.listenerThread = new Thread(this.Listener)
            {
                IsBackground = true
            }).Start();
        }
        public SortingAndFilteringViewModel(IRepository commonRepository, IMessanger commonMessanger)
        {
            repository = commonRepository;
            messanger = commonMessanger;
            sortFilterPreferences = repository.GetSortFilterPreferences();
            LoadSortFilterPreferences();

            SavePreferencesAsDefaultCommand = new RelayCommand(SaveAsDefault);
            SortAndFilterCommand = new RelayCommand(SortAndFilter);
            CancelSortAndFilterCommand = new RelayCommand(CancelSortAndFilter);
        }
Esempio n. 31
0
        public SortingAndFilteringViewModel(IRepository commonRepository, IMessanger commonMessanger)
        {
            repository            = commonRepository;
            messanger             = commonMessanger;
            sortFilterPreferences = repository.GetSortFilterPreferences();
            LoadSortFilterPreferences();

            SavePreferencesAsDefaultCommand = new RelayCommand(SaveAsDefault);
            SortAndFilterCommand            = new RelayCommand(SortAndFilter);
            CancelSortAndFilterCommand      = new RelayCommand(CancelSortAndFilter);
        }
Esempio n. 32
0
 public ShopRepository(IMessanger messenger,
                       UsersContext usersContext,
                       ISettingsRepository settingsRepository,
                       IGeofenceService geofenceService)
 {
     _messanger          = messenger;
     _usersContext       = usersContext;
     _settingsRepository = settingsRepository;
     _user            = _settingsRepository.User;
     _geofenceService = geofenceService;
 }
Esempio n. 33
0
 public NavigationManager(IContainer container, IMessanger messanger, IRegionManager regionManager,
                          IShellWindow shell, ILog loger, IMenuService menuService, IRegionNavigationJournal regionNavigationJournal)
 {
     this.menuService             = menuService;
     this.loger                   = loger;
     this.container               = container;
     this.shell                   = shell;
     this.messanger               = messanger;
     this.regionManager           = regionManager;
     this.regionNavigationJournal = regionNavigationJournal;
     subscription                 = messanger.Subscribe <NavigationRequest>(OnMessageArrived);
 }
Esempio n. 34
0
        public DeleteEventOptionsViewModel(IGoogleCalendar googleCalendar, IRepository commonRepository, IMessanger commonMessanger)
        {
            calendar      = googleCalendar;
            repository    = commonRepository;
            selectedEvent = repository.GetCurrentEvent();
            messanger     = commonMessanger;

            DeleteOnlyInstanceCommand    = new RelayCommand(DeleteOnlyInstance);
            DeleteFollowingEventsCommand = new RelayCommand(DeleteFollowingEvents);
            DeleteAllEventsCommand       = new RelayCommand(DeleteAllEvents);
            CancelDeleteCommand          = new RelayCommand(CloseWindow);
        }
Esempio n. 35
0
        public DeleteEventOptionsViewModel(IGoogleCalendar googleCalendar, IRepository commonRepository, IMessanger commonMessanger)
        {
            calendar = googleCalendar;
            repository = commonRepository;
            selectedEvent = repository.GetCurrentEvent();
            messanger = commonMessanger;

            DeleteOnlyInstanceCommand = new RelayCommand(DeleteOnlyInstance);
            DeleteFollowingEventsCommand = new RelayCommand(DeleteFollowingEvents);
            DeleteAllEventsCommand = new RelayCommand(DeleteAllEvents);
            CancelDeleteCommand = new RelayCommand(CloseWindow);

        }
Esempio n. 36
0
        public OthersCalendarViewModel(IGoogleCalendar googleCalendar, ICalendarEventService eventService, ITimeIntervals timeInterval, IRepository commonRepository, IMessanger commonMessanger)
        {
            try
            {
                log.Debug("Loading EventsList view model...");

                calendar = googleCalendar;
                service = eventService;
                period = timeInterval;
                repository = commonRepository;
                sortFilterPreferences = repository.GetSortFilterPreferences();
                messanger = commonMessanger;

                OthersEvents = service.GetOthersEvents(calendar, period.Today(), _OtherCalendarsList);
                OthersEvents = service.FormatEventsDatesStringRepresentation(OthersEvents, repository.GetDateTimePreferences());

                GetOtherCalendarsCommand = new RelayCommand(GetOtherCalendars);
                GetTodayEventsCommand = new RelayCommand(GetTodayEvents);
                GetTomorrowEventsCommand = new RelayCommand(GetTomorrowEvents);
                GetThisWeekEventsCommand = new RelayCommand(GetThisWeekEvents);
                GetNextWeekEventsCommand = new RelayCommand(GetNextWeekEvents);
                GetThisMonthEventsCommand = new RelayCommand(GetThisMonthEvents);
                GetNextMonthEventsCommand = new RelayCommand(GetNextMonthEvents);
                GetPeriodEventsCommand = new RelayCommand(GetPeriodEvents);
                RefreshCommand = new RelayCommand(RefreshEventsList);
                DeleteEventCommand = new RelayCommand(DeleteEvent);
                UpdateEventCommand = new RelayCommand(FullUpdateEvent);
                ConfirmEventCommand = new RelayCommand(ConfirmEvent);
                MakeTentativeEventCommand = new RelayCommand(MakeTentativeEvent);
                ShowChooseDateEventsControlsCommand = new RelayCommand(ShowChooseDateEventsControls);
                HideChooseDateEventsControlsCommand = new RelayCommand(HideChooseDateEventsControls);
                GetChooseDateEventsCommand = new RelayCommand(GetChooseDateEvents);
                SetSortingAndFilteringPreferencesCommand = new RelayCommand(SetSortingAndFilteringPreferences);
                LogOutCommand = new RelayCommand(LogOut);

                log.Debug("EventsList view model was succssfully loaded");
            }
            catch(Exception ex)
            {
                log.Error("Failed to load EventsList view model:", ex);
            }
        }