示例#1
0
        public void SetPost(Post p)
        {
            post = p;
            IsMatch = post.Categories.Contains(category);

            foreach (var vm in Categories)
                vm.SetPost(p);
        }
示例#2
0
        public static Post RandomPost()
        {
            var p = new Post();

            // Generate random date
            var start = new DateTime(2000, 1, 1);
            var range = (DateTime.Today - start).Days;
            p.Date = start.AddDays(rand.Next(range));

            // Generate random text
            p.Text = Wordlist.Instance.Random(3);

            // Generate random value
            p.Value = rand.NextDouble() * 1000;

            return p;
        }
示例#3
0
 public bool IsMatch(Post post)
 {
     return Filters.All(pattern => pattern.IsMatch(post));
 }