Esempio n. 1
0
        public FeaturesViewEngine()
        {
            ViewLocationCache = new DefaultViewLocationCache();

            var featureFolders = new[]
            {
                "~/Features/%1/{1}/{0}.cshtml",
                "~/Features/%1/%2/{1}/{0}.cshtml",
                "~/Features/%1/{0}.cshtml",
                "~/Features/%1/%2/{0}.cshtml",
                "~/Cms/%1/{1}/{0}.cshtml",
                "~/Commerce/%1/{1}/{0}.cshtml",
                "~/Social/%1/{1}/{0}.cshtml"
            };

            featureFolders = featureFolders.Union(AdditionalPartialViewFormats).ToArray();

            ViewLocationFormats = ViewLocationFormats
                                  .Union(featureFolders)
                                  .ToArray();

            PartialViewLocationFormats = PartialViewLocationFormats
                                         .Union(featureFolders)
                                         .ToArray();

            MasterLocationFormats = MasterLocationFormats
                                    .Union(featureFolders)
                                    .ToArray();
        }
Esempio n. 2
0
    /*==========================================================================================================================
    | CONSTRUCTOR
    \-------------------------------------------------------------------------------------------------------------------------*/
    /// <summary>
    ///   Initializes a new instance of <see cref="TopicViewEngine"/>.
    /// </summary>
    /// <remarks>
    ///   When instantiated, the <see cref="TopicViewEngine.TopicViewEngine"/> constructor will initialize location formats with
    ///   extensions intended to support organizing views by <see cref="Topic.ContentType"/>.
    /// </remarks>
    public TopicViewEngine(IViewPageActivator viewPageActivator = null) : base(viewPageActivator) {

      /*------------------------------------------------------------------------------------------------------------------------
      | Define view location
      >-------------------------------------------------------------------------------------------------------------------------
      | Supports the following replacement tokens: {0} Controller, {1} View, {2} Area, and {3} Content Type.
      \-----------------------------------------------------------------------------------------------------------------------*/
      var viewLocations = new[] {
        "~/Views/{3}/{1}.cshtml",
        "~/Views/ContentTypes/{3}.{1}.cshtml",
        "~/Views/ContentTypes/{1}.cshtml",
        "~/Views/Shared/{1}.cshtml",
      };

      /*------------------------------------------------------------------------------------------------------------------------
      | Set view locations
      \-----------------------------------------------------------------------------------------------------------------------*/
      ViewLocationFormats = ViewLocationFormats.Union(viewLocations).ToArray();
      MasterLocationFormats = MasterLocationFormats.Union(viewLocations).ToArray();
      PartialViewLocationFormats = PartialViewLocationFormats.Union(viewLocations).ToArray();

      /*------------------------------------------------------------------------------------------------------------------------
      | Update view locations for areas
      \-----------------------------------------------------------------------------------------------------------------------*/
      viewLocations = viewLocations.Select(v => v.Replace("~", "~/{2}/")).ToArray();

      /*------------------------------------------------------------------------------------------------------------------------
      | Set area view locations
      \-----------------------------------------------------------------------------------------------------------------------*/
      AreaViewLocationFormats = AreaViewLocationFormats.Union(viewLocations).ToArray();
      AreaMasterLocationFormats = AreaMasterLocationFormats.Union(viewLocations).ToArray();
      AreaPartialViewLocationFormats = AreaPartialViewLocationFormats.Union(viewLocations).ToArray();

    }
Esempio n. 3
0
        public ViewEngine() : base()
        {
            string[] strNewPartialViewLocationFormats = { "~/Views/Shared/PartialViews/FileManager/{0}.cshtml" };

            PartialViewLocationFormats =
                PartialViewLocationFormats.Union(strNewPartialViewLocationFormats).ToArray();
        }
        public SiteViewEngine()
        {
            ViewLocationCache = new DefaultViewLocationCache();

            // {0} = action
            // {1} = controller

            var featureFolders = new[]
            {
                "~/Features/Pages/{1}/{1}{0}.cshtml",
                "~/Views/Pages/{1}/{1}{0}.cshtml",     // ~/Views/Pages/Start/StartIndex.cshtml
                "~/Features/{1}{0}.cshtml",
                "~/Features/{1}/{0}.cshtml",
                "~/Features/{1}/Views/{0}.cshtml",
                "~/Features/{1}/Views/{1}.cshtml"
            }
            .Union(SubFeatureFolders("~/Features"))
            .ToArray();

            featureFolders = featureFolders.Union(AdditionalPartialViewFormats).
                             ToArray();

            ViewLocationFormats = ViewLocationFormats
                                  .Union(featureFolders)
                                  .ToArray();

            PartialViewLocationFormats = PartialViewLocationFormats
                                         .Union(featureFolders)
                                         .ToArray();
        }
 public CustomRazorViewEngine()
 {
     PartialViewLocationFormats = PartialViewLocationFormats.Union(new[] {
         "~/Views/Shared/Blocks/{0}.cshtml",
         "~/Views/Blocks/{0}.cshtml"
     }).ToArray();
 }
Esempio n. 6
0
 public AdageKitViewEngine()
 {
     PartialViewLocationFormats = PartialViewLocationFormats.Union(new[]
     {
         "~/Views/ClientViews/Shared/{0}.cshtml",
         "~/Views/AdageViews/Shared/{0}.cshtml",
     }).ToArray();
 }
 public ElementViewEngine()
 {
     PartialViewLocationFormats = PartialViewLocationFormats.Union(
         ExtendedPartialViewsLocations
         .Select(x => "~/Views" + x)
         )
                                  .ToArray();
 }
Esempio n. 8
0
        public PartialViewViewEngine()
        {
            var newLocationFormat = new[]
            {
                "~/Views/{1}/Partial/{0}.cshtml",
            };

            PartialViewLocationFormats = PartialViewLocationFormats.Union(newLocationFormat).ToArray();
        }
Esempio n. 9
0
 public EPiServerViewEngine()
 {
     this.PartialViewLocationFormats     = PartialViewLocationFormats.Union(ViewFormats).ToArray();
     this.ViewLocationFormats            = ViewLocationFormats.Union(ViewFormats).ToArray();
     this.AreaPartialViewLocationFormats = AreaPartialViewLocationFormats.Union(AreaViewFormats).ToArray();
     this.AreaViewLocationFormats        = AreaViewLocationFormats.Union(AreaViewFormats).ToArray();
     this.AreaMasterLocationFormats      = AreaMasterViewFormats.Union(AreaMasterViewFormats).ToArray();
     this.MasterLocationFormats          = MasterLocationFormats.Union(MasterViewFormats).ToArray();
 }
Esempio n. 10
0
        public UberDeployerViewEngine()
        {
            var newLocationFormats = new[]
            {
                "~/Views/{1}/Popups/{0}.cshtml"
            };

            PartialViewLocationFormats = PartialViewLocationFormats.Union(newLocationFormats).ToArray();
        }
Esempio n. 11
0
        public ExtendedRazorViewEngine()
        {
            //Remove this optimization to enable Visual Basic views
            FileExtensions = new[]
            {
                "cshtml"
            };

            PartialViewLocationFormats = PartialViewLocationFormats.Union(_newPartialViewFormats).ToArray();
        }
        public SiteViewEngine()
        {
            PartialViewLocationFormats = PartialViewLocationFormats.Union(AdditionalPartialViewFormats).ToArray();

            AreaPartialViewLocationFormats = AreaPartialViewLocationFormats
                                             .Union(new[]
            {
                "~/Areas/{2}/Views/Shared/{0}.cshtml",
                "~/Areas/{2}/Views/Shared/Blocks/{0}.cshtml"
            }).ToArray();
        }
Esempio n. 13
0
        public ViewEngine()
        {
            var newLocationFormat = new[]
            {
                "~/Views/{1}/Partial/{0}.cshtml",
                "~/Views/Shared/Partial/{0}.cshtml",
                "~/Views/{0}.cshtml",
                "~/Views/Shared/DisplayTemplates/{0}.cshtml"
            };

            PartialViewLocationFormats = PartialViewLocationFormats.Union(newLocationFormat).ToArray();
        }
Esempio n. 14
0
 public FoundationViewEngine()
 {
     PartialViewLocationFormats = PartialViewLocationFormats.Union(new[]
     {
         "~/Views/Shared/Blocks/{0}.cshtml",
         "~/Views/Shared/Blocks/EPiServerForms/{0}.cshtml",
         "~/Views/Shared/Partials/{0}.cshtml",
         "~/Views/Shared/PagePartials/{0}.cshtml",
         "~/Views/Shared/DisplayTemplates/{0}.cshtml",
         "~/Views/Shared/DisplayTemplates/{1}/{0}.cshtml"
     }).ToArray();
 }
Esempio n. 15
0
        public ApplicationFormViewEngine()
        {
            PartialViewLocationFormats = PartialViewLocationFormats.Union(new[]
            {
                "~/Views/Blocks/{0}.cshtml"
            }).ToArray();

            AreaMasterLocationFormats      = Filter(AreaMasterLocationFormats);
            AreaPartialViewLocationFormats = Filter(AreaPartialViewLocationFormats);
            AreaViewLocationFormats        = Filter(AreaViewLocationFormats);
            FileExtensions             = Filter(FileExtensions);
            MasterLocationFormats      = Filter(MasterLocationFormats);
            PartialViewLocationFormats = Filter(PartialViewLocationFormats);
            ViewLocationFormats        = Filter(ViewLocationFormats);
        }
Esempio n. 16
0
        public FeatureViewEngine()
        {
            var featureFolderViewLocationFormats = new[]
            {
                "~/Features/{0}.cshtml",
                "~/Features/{1}/{0}.cshtml",
                "~/Features/{1}/Views/{0}.cshtml"
            }
            .Union(FeatureFolders())
            .ToArray();

            ViewLocationFormats        = ViewLocationFormats.Union(featureFolderViewLocationFormats).ToArray();
            MasterLocationFormats      = MasterLocationFormats.Union(featureFolderViewLocationFormats).ToArray();
            PartialViewLocationFormats = PartialViewLocationFormats.Union(featureFolderViewLocationFormats).ToArray();
        }
Esempio n. 17
0
        public MultiDeviceRazorViewEngine()
        {
            var newViewLocations = new[]
            {
                "~/Views/{1}/{0}/{0}.cshtml",
                "~/Views/{1}/{0}/Partials/{0}.cshtml",
                "~/Views/{1}/Partials/{0}.cshtml",
                "~/Views/{1}/Partials/{0}/{0}.cshtml",
                "~/Views/Shared/{0}/{0}.cshtml",
                "~/Views/Shared/Partials/{0}.cshtml",
                "~/Views/Shared/Partials/{0}/{0}.cshtml"
            };

            ViewLocationFormats        = ViewLocationFormats.Union(newViewLocations).ToArray();
            MasterLocationFormats      = MasterLocationFormats.Union(newViewLocations).ToArray();
            PartialViewLocationFormats = PartialViewLocationFormats.Union(newViewLocations).ToArray();
        }
Esempio n. 18
0
        public PartialsSubfolderViewEngine()
        {
            Contract.Assume(PartialViewLocationFormats != null);
            Contract.Assume(AreaPartialViewLocationFormats != null);

            var newLocationFormat = new[]
            {
                "~/Views/{1}/Partials/{0}.cshtml",
            };

            var newAreaLocationFormat = new[]
            {
                "~/Areas/{2}/Views/{1}/Partials/{0}.cshtml",
            };

            PartialViewLocationFormats     = PartialViewLocationFormats.Union(newLocationFormat).ToArray();
            AreaPartialViewLocationFormats = AreaPartialViewLocationFormats.Union(newAreaLocationFormat).ToArray();
        }
Esempio n. 19
0
        /*
         * Placeholders:
         *      {2} - Name of the Mvc area
         *      {1} - Name of the controller
         *      {0} - Name of the action (name of the partial view)
         */

        public SiteViewEngine()
        {
            var featureFolders = new[]
            {
                "~/Features/{0}.cshtml",
                "~/Features/{1}{0}.cshtml",
                "~/Features/{1}/{0}.cshtml",
                "~/Features/{1}/Views/{0}.cshtml",
                "~/Features/{1}/Views/{1}.cshtml",
            }
            .Union(SubFeatureFolders("~/Features"))
            .ToArray();

            ViewLocationFormats = ViewLocationFormats
                                  .Union(featureFolders)
                                  .ToArray();

            PartialViewLocationFormats = PartialViewLocationFormats
                                         .Union(featureFolders)
                                         .ToArray();
        }
 public CustomLocationViewEngine()
 {
     ViewLocationFormats        = ViewLocationFormats.Union(Locations).ToArray();
     PartialViewLocationFormats = PartialViewLocationFormats.Union(Locations).ToArray();
 }
Esempio n. 21
0
 public SiteViewEngine()
 {
     PartialViewLocationFormats = PartialViewLocationFormats.Union(AdditionalPartialViewFormats).ToArray();
 }
 public PartialRazorViewEngine()
 {
     PartialViewLocationFormats = PartialViewLocationFormats.Union(NewPartialViewLocationFormats).ToArray();
 }