Распределяет запросы протокола по обработчикам.
예제 #1
0
 public void ExecuteShowForumArticles(ICommandContext context, int?forumId)
 {
     context.OpenUrlInBrowser(
         JanusProtocolDispatcher.FormatURI(
             JanusProtocolResourceType.ArticleList,
             GetForumId(context, forumId).ToString()));
 }
예제 #2
0
        public void ExecuteShowUserRatingOut(ICommandContext context)
        {
            var uid = Config.Instance.SelfId;

            context.OpenUrlInBrowser(
                JanusProtocolDispatcher.FormatURI(
                    JanusProtocolResourceType.UserOutrating, uid.ToString()));
        }
예제 #3
0
        public void ExecuteOpenMessageInJBrowser(ICommandContext context, int?messageId)
        {
            var url = JanusProtocolDispatcher.FormatURI(
                JanusProtocolResourceType.Message,
                ForumCommandHelper.GetMessageId(context, messageId).ToString());

            context.OpenUrlInBrowser(url, UrlBehavior.InternalBrowser);
        }
예제 #4
0
        internal void Run(IServiceProvider serviceProvider)
        {
            serviceProvider.SetSplashMessage(SR.Splash.InitApplication);

            CheckJanusProtocolInstallation();
            CheckGoJanusNetInstallation();

            ProtocolDispatcher = new JanusProtocolDispatcher(serviceProvider);

            Forums.BeforeLoadData += ForumsBeforeLoadData;

            foreach (var forum in Forums.Instance.ForumList)
            {
                forum.BeforeLoadData += ActiveForumBeforeLoadData;
            }

            Init(serviceProvider);
            serviceProvider.SetSplashMessage(SR.Splash.RunApplication);

            Application.Run(MainForm);
        }
예제 #5
0
 public void ExecuteShowAllArticles(ICommandContext context)
 {
     context.OpenUrlInBrowser(
         JanusProtocolDispatcher.FormatURI(
             JanusProtocolResourceType.ArticleList, "0"));
 }
예제 #6
0
 public void ExecuteShowTeamList(ICommandContext context)
 {
     context.OpenUrlInBrowser(
         JanusProtocolDispatcher.FormatURI(
             JanusProtocolResourceType.TeamList, string.Empty));
 }
예제 #7
0
 /// <summary>
 /// Получить внешний формат ссылки для соответствующего ресурса.
 /// <seealso cref="SiteUrlHelper"/>
 /// </summary>
 /// <param name="resourceType">Тип ресурса.</param>
 /// <param name="parameters">Параметр ссылки.</param>
 /// <returns>Внешний формат ссылки на ресурс.</returns>
 private static string FormatExternalUri(JanusProtocolResourceType resourceType, string parameters)
 {
     return(JanusProtocolDispatcher.FormatExternalURI(resourceType, parameters));
 }
예제 #8
0
        internal void Run(IServiceProvider serviceProvider)
        {
            serviceProvider.SetSplashMessage(SR.Splash.InitApplication);

            CheckJanusProtocolInstallation();
            CheckGoJanusNetInstallation();

            ProtocolDispatcher = new JanusProtocolDispatcher(serviceProvider);

            Forums.BeforeLoadData += ForumsBeforeLoadData;

            foreach (var forum in Forums.Instance.ForumList)
                forum.BeforeLoadData += ActiveForumBeforeLoadData;

            Init(serviceProvider);
            serviceProvider.SetSplashMessage(SR.Splash.RunApplication);

            Application.Run(MainForm);
        }