当前位置: 首页>>代码示例>>C#>>正文


C# UrlHelper.GetUmbracoApiServiceBaseUrl方法代码示例

本文整理汇总了C#中System.Web.Mvc.UrlHelper.GetUmbracoApiServiceBaseUrl方法的典型用法代码示例。如果您正苦于以下问题:C# UrlHelper.GetUmbracoApiServiceBaseUrl方法的具体用法?C# UrlHelper.GetUmbracoApiServiceBaseUrl怎么用?C# UrlHelper.GetUmbracoApiServiceBaseUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.Mvc.UrlHelper的用法示例。


在下文中一共展示了UrlHelper.GetUmbracoApiServiceBaseUrl方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ServerVariablesParser_Parsing

        void ServerVariablesParser_Parsing(object sender, Dictionary<string, object> e)
        {
            if (HttpContext.Current == null) return;
            var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));

            var mainDictionary = new Dictionary<string, object>
            {
                {
                    "ocBaseUrl",
                    urlHelper.GetUmbracoApiServiceBaseUrl<ObjectController>(controller => controller.PostCreate(null))
                },
                {
                    "pecBaseUrl",
                    urlHelper.GetUmbracoApiServiceBaseUrl<PropertyEditorsApiController>(
                        controller => controller.GetAllTypes())
                },
                {
                    "fcBaseUrl",
                    urlHelper.GetUmbracoApiServiceBaseUrl<FieldApiController>(controller => controller.GetAllUsers())
                }
            };

            if (!e.Keys.Contains("uioMatic"))
            {
                e.Add("uioMatic", mainDictionary);
            }
        }
开发者ID:TimGeyssens,项目名称:UIOMatic,代码行数:27,代码来源:ServerVariableParserEvent.cs

示例2: ServerVariablesParserParsing

        /// <summary>
        /// The server variables parser parsing.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="items">
        /// The items.
        /// </param>
        private static void ServerVariablesParserParsing(object sender, Dictionary<string, object> items)
        {
            if (!items.ContainsKey("umbracoUrls"))
            {
                return;
            }

            var umbracoUrls = (Dictionary<string, object>) items["umbracoUrls"];

            var url = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));

            umbracoUrls.Add(
                "gleanerSettingsApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<SettingsApiController>(
                    controller => controller.GetAllCountries()));

            umbracoUrls.Add(
                "gleanerAgentApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<AgentApiController>(
                    controller => controller.SearchAgents(new QueryDisplay
                    {
                        CurrentPage = 0,
                        ItemsPerPage = 25,
                        Parameters = new QueryDisplayParameter[] { }
                    })));

            umbracoUrls.Add(
                "gleanerMemberApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<MemberApiController>(
                    controller => controller.SearchMembers(new QueryDisplay
                    {
                        CurrentPage = 0,
                        ItemsPerPage = 25,
                        Parameters = new QueryDisplayParameter[] { }
                    })));

            umbracoUrls.Add(
                "gleanerFormApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<FormApiController>(
                    controller => controller.SearchForms(new QueryDisplay
                    {
                        CurrentPage = 0,
                        ItemsPerPage = 25,
                        Parameters = new QueryDisplayParameter[] { }
                    })));

            umbracoUrls.Add(
                "gleanerFormGroupApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<FormGroupApiController>(
                    controller => controller.SearchFormGroups(new QueryDisplay
                    {
                        CurrentPage = 0,
                        ItemsPerPage = 25,
                        Parameters = new QueryDisplayParameter[] { }
                    })));
        }
开发者ID:AzarinSergey,项目名称:project-site,代码行数:65,代码来源:ServerVariablesParsingEvents.cs

示例3: ServerVariablesParser_Parsing

 static void ServerVariablesParser_Parsing(object sender, Dictionary<string, object> e)
 {
     if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null");
     var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));
     e.Add("articulate", new Dictionary<string, object>
     {
         {"articulateImportBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<ArticulateBlogImportController>(controller => controller.PostImportBlogMl(null))},
         {"articulatePropertyEditorsBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<ArticulatePropertyEditorsController>(controller => controller.GetThemes())}
     });
 }
开发者ID:BenFidge,项目名称:Articulate,代码行数:10,代码来源:UmbracoEventHandler.cs

示例4: ServerVariablesParser_Parsing

        void ServerVariablesParser_Parsing(object sender, Dictionary<string, object> e)
        {
            if (HttpContext.Current == null) return;
            var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));

            var mainDictionary = new Dictionary<string, object>();
            mainDictionary.Add("demoBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<PeopleApiController>(controller => controller.GetAll()));

            if (!e.Keys.Contains("demoSection"))
            {
                e.Add("demoSection", mainDictionary);
            }
        }
开发者ID:Mantus667,项目名称:ListViewForCustomSection,代码行数:13,代码来源:ServerVariableParserEvent.cs

示例5: ServerVariablesParser_Parsing

        void ServerVariablesParser_Parsing(object sender, Dictionary<string, object> dictionary)
        {
            if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null");
            var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));
            
            var url = urlHelper.GetUmbracoApiServiceBaseUrl<RelationsApiController>("GetRelations");

            dictionary.Add("arknuRelations", new Dictionary<string, object>
            {
                {"relationsApiBase", url}
            });  

        }
开发者ID:clausjensen,项目名称:Arknu.Umbraco.Relations,代码行数:13,代码来源:Events.cs

示例6: ServerVariablesParser_Parsing

        void ServerVariablesParser_Parsing(object sender, Dictionary<string, object> e)
        {
            if (HttpContext.Current == null) return;
            var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));

            var mainDictionary = new Dictionary<string, object>
            {
                {
                    "apiBaseUrl",
                    urlHelper.GetUmbracoApiServiceBaseUrl<VortoApiController>(
                        controller => controller.GetInstalledLanguages())
                }
            };



            if (!e.Keys.Contains("vorto"))
            {
                e.Add("vorto", mainDictionary);
            }
        }
开发者ID:simonech,项目名称:umbraco-vorto,代码行数:21,代码来源:VortoServerVariablesParser.cs

示例7: Parsing

        private void Parsing(object sender, Dictionary<string, object> e)
        {
            if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null");
            var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));            

            var mainDictionary = new Dictionary<string, object>();
            mainDictionary.Add("calendarBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<CalendarApiController>(controller => controller.PostSave(null)));
            mainDictionary.Add("locationBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<LocationApiController>(controller => controller.PostSave(null)));
            mainDictionary.Add("eventBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<EventApiController>(controller => controller.PostSave(null)));
            mainDictionary.Add("reventBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<REventApiController>(controller => controller.PostSave(null)));
            mainDictionary.Add("userBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<UserApiController>(controller => controller.PostSave(null)));
            mainDictionary.Add("importBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<ImportApiController>(controller => controller.Import()));

            if (!e.Keys.Contains("eventCalendar"))
            {
                e.Add("eventCalendar", mainDictionary);
            }
        }
开发者ID:nhaberl,项目名称:EventCalendarBelle,代码行数:18,代码来源:EventCalendarHelper.cs

示例8: ServerVariablesParserParsing

        private static void ServerVariablesParserParsing(object sender, Dictionary<string, object> items)
        {
            if (!items.ContainsKey("umbracoUrls")) return;

            var umbracoUrls = (Dictionary<string, object>)items["umbracoUrls"];

            var url = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));

            umbracoUrls.Add("merchelloProductApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<ProductApiController>(
                controller => controller.GetAllProducts()));
            umbracoUrls.Add("merchelloProductVariantsApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<ProductVariantApiController>(
                controller => controller.GetProductVariant(Guid.NewGuid())));
            umbracoUrls.Add("merchelloSettingsApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<SettingsApiController>(
                controller => controller.GetAllCountries()));
            umbracoUrls.Add("merchelloWarehouseApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<WarehouseApiController>(
                controller => controller.GetDefaultWarehouse()));
            umbracoUrls.Add("merchelloCatalogShippingApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<CatalogShippingApiController>(
                controller => controller.GetShipCountry(Guid.NewGuid())));
            umbracoUrls.Add("merchelloCatalogFixedRateShippingApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<CatalogFixedRateShippingApiController>(
                controller => controller.GetAllShipCountryFixedRateProviders(Guid.NewGuid())));
            umbracoUrls.Add("merchelloPaymentGatewayApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<PaymentGatewayApiController>(
                controller => controller.GetAllGatewayProviders()));
            umbracoUrls.Add("merchelloTaxationGatewayApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<TaxationGatewayApiController>(
                controller => controller.GetAllGatewayProviders()));
            umbracoUrls.Add("merchelloInvoiceApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<InvoiceApiController>(
                controller => controller.GetAllInvoices()));
            umbracoUrls.Add("merchelloOrderApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<OrderApiController>(
                controller => controller.GetOrder(Guid.NewGuid())));
            umbracoUrls.Add("merchelloShipmentApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<ShipmentApiController>(
                controller => controller.GetShipment(Guid.NewGuid())));
            umbracoUrls.Add("merchelloPaymentApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<PaymentApiController>(
                controller => controller.GetPayment(Guid.NewGuid())));
            umbracoUrls.Add("merchelloGatewayProviderApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<GatewayProviderApiController>(
                controller => controller.GetGatewayProvider(Guid.NewGuid())));
        }
开发者ID:koswesley,项目名称:Merchello-1,代码行数:35,代码来源:ServerVariablesParsingEvents.cs

示例9: ServerVariablesParserParsing

        /// <summary>
        /// Updates Umbraco's server variables collection with Merchello server variable values.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The dictionary of server variables.
        /// </param>
        private static void ServerVariablesParserParsing(object sender, Dictionary<string, object> e)
        {
            if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null");

            if (e.ContainsKey("merchelloUrls")) return;

            var merchelloUrls = new Dictionary<string, object>();

            var url = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));

            merchelloUrls.Add(
                "merchelloAuditLogApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<AuditLogApiController>(
                    controller => controller.GetSalesHistoryByInvoiceKey(Guid.Empty)));

            merchelloUrls.Add(
             "merchelloBackOfficeCheckoutApiBaseUrl",
              url.GetUmbracoApiServiceBaseUrl<BackOfficeCheckoutApiController>(
                  controller => controller.GetPaymentMethods()));

            merchelloUrls.Add(
                "merchelloCustomerApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<CustomerApiController>(
                controller => controller.SearchCustomers(new QueryDisplay()
                    {
                        CurrentPage = 0,
                        ItemsPerPage = 25,
                        Parameters = new QueryDisplayParameter[] { }
                    })));

            merchelloUrls.Add(
                "merchelloDetachedContentApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<DetachedContentApiController>(
                controller => controller.GetContentTypes()));

            merchelloUrls.Add(
                "merchelloEntityCollectionApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<EntityCollectionApiController>(
                controller => controller.GetEntityCollectionProviders()));

            merchelloUrls.Add(
                "merchelloFixedRateShippingApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<FixedRateShippingApiController>(
                controller => controller.GetShipFixedRateTable(new ShipMethodDisplay())));

            merchelloUrls.Add(
                "merchelloGatewayProviderApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<GatewayProviderApiController>(
                controller => controller.GetGatewayProvider(Guid.NewGuid())));

            merchelloUrls.Add(
                "merchelloInvoiceApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<InvoiceApiController>(
                controller => controller.SearchInvoices(new QueryDisplay()
                {
                    CurrentPage = 0,
                    ItemsPerPage = 25,
                    Parameters = new QueryDisplayParameter[] { }
                })));

            merchelloUrls.Add(
                "merchelloMarketingApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<MarketingApiController>(
                controller => controller.GetAllOfferSettings()));

            merchelloUrls.Add(
                 "merchelloNoteApiBaseUrl",
                 url.GetUmbracoApiServiceBaseUrl<NoteApiController>(
                     controller => controller.GetByEntityKey(Guid.Empty)));

            merchelloUrls.Add(
                "merchelloNotificationApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<NotificationGatewayApiController>(
                controller => controller.GetAllGatewayProviders()));

            merchelloUrls.Add(
                "merchelloOrderApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<OrderApiController>(
                controller => controller.GetOrder(Guid.NewGuid())));

            merchelloUrls.Add(
                "merchelloPaymentApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<PaymentApiController>(
                controller => controller.GetPayment(Guid.NewGuid())));

            merchelloUrls.Add(
                "merchelloPaymentGatewayApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<PaymentGatewayApiController>(
                controller => controller.GetAllGatewayProviders()));

            merchelloUrls.Add(
//.........这里部分代码省略.........
开发者ID:jlarc,项目名称:Merchello,代码行数:101,代码来源:ServerVariablesParsingEvents.cs

示例10: ServerVariablesParserParsing

        /// <summary>
        /// The server variables parser parsing.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="items">
        /// The items.
        /// </param>
        private static void ServerVariablesParserParsing(object sender, Dictionary<string, object> items)
        {
            if (!items.ContainsKey("umbracoUrls")) return;

            var umbracoUrls = (Dictionary<string, object>)items["umbracoUrls"];

            var url = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));

            umbracoUrls.Add(
                "merchelloAuditLogApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<AuditLogApiController>(
                    controller => controller.GetSalesHistoryByInvoiceKey(Guid.Empty)));

            umbracoUrls.Add(
                "merchelloProductApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<ProductApiController>(
                controller => controller.SearchProducts(new QueryDisplay()
                    {
                        CurrentPage = 0,
                        ItemsPerPage = 100,
                        Parameters = new QueryDisplayParameter[] { }
                    })));

            //umbracoUrls.Add(
            //    "merchelloProductVariantsApiBaseUrl",
            //    url.GetUmbracoApiServiceBaseUrl<ProductVariantApiController>(
            //    controller => controller.GetProductVariant(Guid.NewGuid())));

            umbracoUrls.Add(
                "merchelloCustomerApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<CustomerApiController>(
                controller => controller.SearchCustomers(new QueryDisplay()
                    {
                        CurrentPage = 0,
                        ItemsPerPage = 100,
                        Parameters = new QueryDisplayParameter[] { }
                    })));

            umbracoUrls.Add(
                "merchelloSettingsApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<SettingsApiController>(
                controller => controller.GetAllCountries()));

            umbracoUrls.Add(
                "merchelloWarehouseApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<WarehouseApiController>(
                controller => controller.GetDefaultWarehouse()));

            umbracoUrls.Add(
                "merchelloCatalogShippingApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<ShippingGatewayApiController>(
                controller => controller.GetShipCountry(Guid.NewGuid())));

            umbracoUrls.Add(
                "merchelloNotificationApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<NotificationGatewayApiController>(
                controller => controller.GetAllGatewayProviders()));

            umbracoUrls.Add(
                "merchelloPaymentGatewayApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<PaymentGatewayApiController>(
                controller => controller.GetAllGatewayProviders()));

            umbracoUrls.Add(
                "merchelloTaxationGatewayApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<TaxationGatewayApiController>(
                controller => controller.GetAllGatewayProviders()));

            umbracoUrls.Add(
                "merchelloInvoiceApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<InvoiceApiController>(
                controller => controller.SearchInvoices(new QueryDisplay()
                {
                    CurrentPage = 0,
                    ItemsPerPage = 100,
                    Parameters = new QueryDisplayParameter[] { }
                })));

            umbracoUrls.Add(
                "merchelloOrderApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<OrderApiController>(
                controller => controller.GetOrder(Guid.NewGuid())));

            umbracoUrls.Add(
                "merchelloShipmentApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<ShipmentApiController>(
                controller => controller.GetShipment(Guid.NewGuid())));

            umbracoUrls.Add(
                "merchelloRateTableApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<FixedRateShippingApiController>(
//.........这里部分代码省略.........
开发者ID:arknu,项目名称:Merchello,代码行数:101,代码来源:ServerVariablesParsingEvents.cs

示例11: ServerVariablesParserOnParsing

        /// <summary>
        /// The server variables parser on parsing.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The dictionary.
        /// </param>
        private static void ServerVariablesParserOnParsing(object sender, Dictionary<string, object> e)
        {
            if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null");

            var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));
            if (!e.ContainsKey("merchelloBazaarUrls"))
            e.Add(
                "merchelloBazaarUrls", 
                new Dictionary<string, object>()
                    {
                        { "merchelloBazaarPropertyEditorsApiBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<PropertyEditorsController>(controller => controller.GetThemes()) }
                    });
        }
开发者ID:drpeck,项目名称:Merchello,代码行数:22,代码来源:UmbracoEventHandler.cs

示例12: ServerVariablesParserOnParsing

        /// <summary>
        /// The server variables parser on parsing.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The dictionary.
        /// </param>
        private static void ServerVariablesParserOnParsing(object sender, Dictionary<string, object> e)
        {
            if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null");

            if (e.ContainsKey("merchelloPaymentsUrls")) return;

            var merchelloPaymentsUrls = new Dictionary<string, object>();

            var url = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));

            merchelloPaymentsUrls.Add(
                "merchelloBraintreeApiBaseUrl",
                url.GetUmbracoApiServiceBaseUrl<BraintreeApiController>(
                    controller => controller.GetClientRequestToken(Guid.Empty)));

            e.Add("merchelloPaymentsUrls", merchelloPaymentsUrls);
        }
开发者ID:jlarc,项目名称:Merchello,代码行数:26,代码来源:UmbracoApplicationEvents.cs


注:本文中的System.Web.Mvc.UrlHelper.GetUmbracoApiServiceBaseUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。