using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.Mvc.Routes;

namespace EditorButtonPack {
    public class Routes : IRouteProvider {

        public void GetRoutes(ICollection<RouteDescriptor> routes) {
            foreach (var routeDescriptor in GetRoutes())
                routes.Add(routeDescriptor);
        }

        public IEnumerable<RouteDescriptor> GetRoutes() {
            const string areaName = "EditorButtonPack";
            var emptyConstraints = new RouteValueDictionary();
            var socialIconsRouteValueDictionary = new RouteValueDictionary { { "area", areaName } };
            var mvcRouteHandler = new MvcRouteHandler();

            return new[] {
                new RouteDescriptor {
                    Route = new Route(
                        "Script/TinyMceScript",
                        new RouteValueDictionary {
                            {"area", areaName},
                            {"controller", "Script"},
                            {"action", "TinyMceScript"}
                        },
                        emptyConstraints, socialIconsRouteValueDictionary, mvcRouteHandler)
                }
            };
        }
    }
}