public HomeViewModel(INoticeHandler postHandler)
 {
     RoutineViewModel = new RoutineViewModel();
     _noticeHandler   = postHandler;
     Today            = DateTime.Now.DayOfWeek.ToString();
     Date             = DateTime.Now.ToString("dd MMMM yyyy");
 }
예제 #2
0
 public AddUpdateNoticeViewModel(INoticeHandler noticeHandler,
                                 ICourseHandler courseHandler, IPreferenceEngine preferenceEngine)
 {
     _noticeHandler    = noticeHandler;
     _courseHandler    = courseHandler;
     PostTypes         = Enum.GetValues(typeof(PostType)).Cast <PostType>();
     DBFiles           = new ObservableCollection <DBFile>();
     _preferneceEngine = preferenceEngine;
 }
        public IrcClient(
            Config.IBotConfigContainer botConfigContainer,
            IIRCLogger ircLogger,
            Chat.IChatMessageHandler chatMessageHandler,
            INoticeHandler noticeHandler,
            ICommunication communication,
            ErrorHandler errorHandler)
        {
            botConfig         = botConfigContainer.BotConfig;
            this.errorHandler = errorHandler;

            this.ircLogger          = ircLogger;
            this.chatMessageHandler = chatMessageHandler;
            this.noticeHandler      = noticeHandler;
            this.communication      = communication;

            username = botConfig.BotName.ToLower();
            channel  = botConfig.Broadcaster.ToLower();

            if (string.IsNullOrEmpty(username))
            {
                throw new ArgumentException("Bot Name cannot be empty.");
            }

            if (string.IsNullOrEmpty(channel))
            {
                throw new ArgumentException("Bot Channel cannot be empty.");
            }

            Channel <string> chatChannel = Channel.CreateUnbounded <string>();

            outgoingChatWriter = chatChannel.Writer;
            outgoingChatReader = chatChannel.Reader;

            exhaustiveLogging = botConfig.ExhaustiveIRCLogging;

            communication.SendMessageHandlers += SendMessage;
            communication.SendWhisperHandlers += SendWhisper;
        }
예제 #4
0
 public NoticesViewModel(INoticeHandler noticeHandler)
 {
     Notices        = new ObservableCollection <Notice>();
     _noticeHandler = noticeHandler;
 }