示例#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.";
            }
        }
示例#2
0
文件: Tweet.cs 项目: Sironfoot/T3ME
 public Tweet(Application app, Tweeter tweeter)
     : this()
 {
     this.App = app;
     this.Tweeter = tweeter;
 }
示例#3
0
 public MasterFrontEndView(Application app, LanguageSelectForm languages, TagCloudView tagCloud)
 {
     this.App = app;
     this.Languages = languages;
     this.TagCloud = tagCloud;
 }
示例#4
0
 public Stylesheet(Application app)
 {
     this.App = app;
 }
示例#5
0
        private Tweet CreateTweet()
        {
            Application app = new Application();
            Tweeter tweeter = new Tweeter();

            return new Tweet(app, tweeter);
        }