Exemplo n.º 1
0
        public ChannelService(
            IChatState chatState,
            ILogThings logger,
            IAutomateThings automation)
        {
            try
            {
                region          = chatState.RegionManager;
                container       = chatState.Container;
                events          = chatState.EventAggregator;
                cm              = chatState.ChatModel;
                connection      = chatState.Connection;
                characters      = chatState.CharacterManager;
                this.logger     = logger.ThrowIfNull("logger");
                this.automation = automation.ThrowIfNull("automation");

                events.GetEvent <ChatOnDisplayEvent>().Subscribe(BuildHomeChannel, ThreadOption.UIThread, true);
                events.GetEvent <RequestChangeTabEvent>().Subscribe(RequestNavigate, ThreadOption.UIThread, true);
            }
            catch (Exception ex)
            {
                ex.Source = "Message Daemon, init";
                Exceptions.HandleException(ex);
            }
        }
Exemplo n.º 2
0
        public ChannelService(
            IChatState chatState,
            ILogThings logger,
            IAutomateThings automation)
        {
            try
            {
                region = chatState.RegionManager;
                container = chatState.Container;
                events = chatState.EventAggregator;
                cm = chatState.ChatModel;
                connection = chatState.Connection;
                characters = chatState.CharacterManager;
                this.logger = logger.ThrowIfNull("logger");
                this.automation = automation.ThrowIfNull("automation");

                events.GetEvent<ChatOnDisplayEvent>().Subscribe(BuildHomeChannel, ThreadOption.UIThread, true);
                events.GetEvent<RequestChangeTabEvent>().Subscribe(RequestNavigate, ThreadOption.UIThread, true);
            }
            catch (Exception ex)
            {
                ex.Source = "Message Daemon, init";
                Exceptions.HandleException(ex);
            }
        }
Exemplo n.º 3
0
        public UserCommandService(
            IChatState chatState,
            IHandleApi api,
            ILogThings logger,
            IManageChannels channels,
            IHandleIcons iconService)
        {
            try
            {
                regionManager = chatState.RegionManager;
                events = chatState.EventAggregator;
                cm = chatState.ChatModel;
                connection = chatState.Connection;
                characterManager = chatState.CharacterManager;
                this.api = api.ThrowIfNull("api");
                this.logger = logger.ThrowIfNull("logger");
                this.channels = channels.ThrowIfNull("channelManager");
                this.iconService = iconService;

                events.GetEvent<UserCommandEvent>().Subscribe(CommandReceived, ThreadOption.UIThread, true);

                commands = new Dictionary<string, CommandHandler>
                {
                    {"bookmark-add", OnBookmarkAddRequested},
                    {"friend-remove", OnFriendRemoveRequested},
                    {"request-accept", OnFriendRequestAcceptRequested},
                    {"request-deny", OnFriendRequestDenyRequested},
                    {"request-send", OnFriendRequestSendRequested},
                    {"request-cancel", OnFriendRequestCancelRequested},
                    {"priv", OnPrivRequested},
                    {UserMessage, OnPivateMessageSendRequested},
                    {ChannelMessage, OnMsgRequested},
                    {ChannelAd, OnLrpRequested},
                    {UserStatus, OnStatusChangeRequested},
                    {"close", OnCloseRequested},
                    {"forceclose", OnForceChannelCloseRequested},
                    {"join", OnJoinRequested},
                    {UserIgnore, OnIgnoreRequested},
                    {"clear", OnClearRequested},
                    {"clearall", OnClearAllRequested},
                    {"_logger_open_log", OnOpenLogRequested},
                    {"_logger_open_folder", OnOpenLogFolderRequested},
                    {"code", OnChannelCodeRequested},
                    {UserInvite, OnInviteToChannelRequested},
                    {"who", OnWhoInformationRequested},
                    {"getdescription", OnChannelDescriptionRequested},
                    {"interesting", OnMarkInterestedRequested},
                    {"notinteresting", OnMarkNotInterestedRequested},
                    {"ignoreUpdates", OnIgnoreUpdatesRequested},
                    {AdminAlert, OnReportRequested},
                    {"tempignore", OnTemporaryIgnoreRequested},
                    {"tempunignore", OnTemporaryIgnoreRequested},
                    {"tempinteresting", OnTemporaryInterestedRequested},
                    {"tempnotinteresting", OnTemporaryInterestedRequested},
                    {"handlelatest", OnHandleLatestReportRequested},
                    {"handlereport", OnHandleLatestReportByUserRequested},
                    {"bookmark-remove", OnBookmarkRemoveRequested},
                    {"rejoin", OnChannelRejoinRequested},
                    {"searchtag", OnSearchTagToggleRequested},
                    {"logout", OnLogoutRequested},
                    {"soundon", OnSoundOnRequested},
                    {"soundoff", OnSoundOffRequested},
                    {"whois", OnWhoIsRequested},
                    {ChannelRoll, OnRollRequested}
                };
            }
            catch (Exception ex)
            {
                ex.Source = "Message Daemon, init";
                Exceptions.HandleException(ex);
            }
        }
Exemplo n.º 4
0
        public UserCommandService(
            IChatState chatState,
            IHandleApi api,
            ILogThings logger,
            IManageChannels channels,
            IHandleIcons iconService)
        {
            try
            {
                regionManager    = chatState.RegionManager;
                events           = chatState.EventAggregator;
                cm               = chatState.ChatModel;
                connection       = chatState.Connection;
                characterManager = chatState.CharacterManager;
                this.api         = api.ThrowIfNull("api");
                this.logger      = logger.ThrowIfNull("logger");
                this.channels    = channels.ThrowIfNull("channelManager");
                this.iconService = iconService;

                events.GetEvent <UserCommandEvent>().Subscribe(CommandReceived, ThreadOption.UIThread, true);

                commands = new Dictionary <string, CommandHandler>
                {
                    { "bookmark-add", OnBookmarkAddRequested },
                    { "friend-remove", OnFriendRemoveRequested },
                    { "request-accept", OnFriendRequestAcceptRequested },
                    { "request-deny", OnFriendRequestDenyRequested },
                    { "request-send", OnFriendRequestSendRequested },
                    { "request-cancel", OnFriendRequestCancelRequested },
                    { "priv", OnPrivRequested },
                    { UserMessage, OnPivateMessageSendRequested },
                    { ChannelMessage, OnMsgRequested },
                    { ChannelAd, OnLrpRequested },
                    { UserStatus, OnStatusChangeRequested },
                    { "close", OnCloseRequested },
                    { "forceclose", OnForceChannelCloseRequested },
                    { "join", OnJoinRequested },
                    { UserIgnore, OnIgnoreRequested },
                    { "clear", OnClearRequested },
                    { "clearall", OnClearAllRequested },
                    { "_logger_open_log", OnOpenLogRequested },
                    { "_logger_open_folder", OnOpenLogFolderRequested },
                    { "code", OnChannelCodeRequested },
                    { UserInvite, OnInviteToChannelRequested },
                    { "who", OnWhoInformationRequested },
                    { "getdescription", OnChannelDescriptionRequested },
                    { "interesting", OnMarkInterestedRequested },
                    { "notinteresting", OnMarkNotInterestedRequested },
                    { "ignoreUpdates", OnIgnoreUpdatesRequested },
                    { AdminAlert, OnReportRequested },
                    { "tempignore", OnTemporaryIgnoreRequested },
                    { "tempunignore", OnTemporaryIgnoreRequested },
                    { "tempinteresting", OnTemporaryInterestedRequested },
                    { "tempnotinteresting", OnTemporaryInterestedRequested },
                    { "handlelatest", OnHandleLatestReportRequested },
                    { "handlereport", OnHandleLatestReportByUserRequested },
                    { "bookmark-remove", OnBookmarkRemoveRequested },
                    { "rejoin", OnChannelRejoinRequested },
                    { "searchtag", OnSearchTagToggleRequested },
                    { "logout", OnLogoutRequested },
                    { "soundon", OnSoundOnRequested },
                    { "soundoff", OnSoundOffRequested },
                    { "whois", OnWhoIsRequested },
                    { ChannelRoll, OnRollRequested }
                };
            }
            catch (Exception ex)
            {
                ex.Source = "Message Daemon, init";
                Exceptions.HandleException(ex);
            }
        }