daily pastebin goal
63%
SHARE
TWEET

Untitled

a guest Aug 13th, 2017 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace Unidux.Example.Todo
  6. {
  7.     [Serializable]
  8.     public class State : StateBase
  9.     {
  10.         public TodoState Todo = new TodoState();
  11.     }
  12.  
  13.     [Serializable]
  14.     public class TodoState : StateElement
  15.     {
  16.         public uint Index = 0;
  17.         public List<Todo> List = new List<Todo>();
  18.         public VisibilityFilter Filter = VisibilityFilter.All;
  19.  
  20.         public List<Todo> ListByFilter
  21.         {
  22.             get
  23.             {
  24.                 return this.List.Where(todo =>
  25.                         this.Filter == VisibilityFilter.All ||
  26.                         (this.Filter == VisibilityFilter.Active && !todo.Completed) ||
  27.                         (this.Filter == VisibilityFilter.Completed && todo.Completed)
  28.                     )
  29.                     .ToList();
  30.             }
  31.         }
  32.     }
  33. }
RAW Paste Data
Top