Ejemplo n.º 1
0
        public override void Init()
        {
            Controller = new MacintoshGarden.MacGardenController();

            this.Routes = new List <Route>()
            {
                new TypedRoute <string>("Bin", "BIN:(.+)", Controller.DoDownload),                              // Proxy Download
                new TypedRoute <string>("Search", Settings.HomePath + @"\/search\/*\t(.+)", Controller.Search), // Search
                new TypedRoute <string>("Search", Settings.HomePath + @"\/search\/(http://macintoshgarden.org\/.+)", Controller.SearchPage),
                new TypedRoute <string>("App", Settings.HomePath + @"\/app\/(.+)", Controller.ShowApp),         // App Result
                PrebuiltRoutes.GifRoute(),                                                                      // Screenshot
            };
        }
Ejemplo n.º 2
0
        public override void Init()
        {
            this.WordPressUrl = ConfigurationManager.AppSettings[this.GetType().Name + ".Url"];

            // TODO Read in Config
            client = new WordPressClient(this.WordPressUrl);

            // Build our route list for teh selector
            routes = new List <Route>()
            {
                // Get Post
                new TypedRoute <int>("Posts", @"\/posts\/(\d+)", client.GetPost),

                // Get Post as Text
                new TypedRoute <int>("Posts", @"\/posts\/text\/(\d+)", client.GetPostText),

                // Categories List
                new Route("Categories", @"\/categories\/", client.GetCategories),

                // Posts by Category
                new TypedRoute <int>("CategoryPosts", @"\/category\/(\d+)", client.GetCategoryPosts),

                // Search
                new TypedRoute <string>("Search", @"\/search\/*\t(.+)", client.Search),


                // Get Image
                //new TypedRoute<string>("Gif", @"\/gif\/(.+)", client.GetGif),
                PrebuiltRoutes.GifRoute(),

                // External Link
                //new TypedRoute<string>("Url", @"URL:(.+)", client.Redirect),
                PrebuiltRoutes.UrlResult(),

                // Proxy Link
                //new TypedRoute<string>("Proxy", @"\/proxy\/(.+)", client.ProxyPage),
                PrebuiltRoutes.HtmlProxy(),
            };
        }