Ejemplo n.º 1
0
        public static string NoRecordsMessage(this HtmlHelper html, Application app, bool isLanguageSet)
        {
            if (app.Tweets.Count > 0)
            {
                RouteBuilder routeBuilder = html.CurrentRoute();

                bool hasSearch = routeBuilder.ContainsKey("search");
                bool isLatestPage = routeBuilder.Action.Equals("latest", StringComparison.InvariantCultureIgnoreCase);

                if (!isLatestPage && !hasSearch && !isLanguageSet)
                {
                    return "No one has voted yet.";
                }
                else
                {
                    string message = "No tweets found. Try broadening your search criteria";

                    if (isLanguageSet)
                    {
                        message += ", or selecting a different language";
                    }

                    message += ".";

                    return message;
                }
            }
            else
            {
                return "No tweets have been indexed yet. Please wait a while, I'm sure there will be some soon.";
            }
        }
Ejemplo n.º 2
0
 public Tweet(Application app, Tweeter tweeter)
     : this()
 {
     this.App = app;
     this.Tweeter = tweeter;
 }
Ejemplo n.º 3
0
 public MasterFrontEndView(Application app, LanguageSelectForm languages, TagCloudView tagCloud)
 {
     this.App = app;
     this.Languages = languages;
     this.TagCloud = tagCloud;
 }
Ejemplo n.º 4
0
 public Stylesheet(Application app)
 {
     this.App = app;
 }
Ejemplo n.º 5
0
        private Tweet CreateTweet()
        {
            Application app = new Application();
            Tweeter tweeter = new Tweeter();

            return new Tweet(app, tweeter);
        }