private void SetIsOn(IPlugin item) { var key = item.GetType().Name; bool result = ConfigUtil.Parse <Boolean>(key, false); item.IsOn = result; }
public void Init() { _queue = new Queue <string>(); _repo = new RentRepository(); _expireDays = ConfigUtil.Parse <Int32>("到期日", 30); TimeSpan result = ConfigUtil.Parse <TimeSpan>("到期提醒间隔", TimeSpan.FromHours(0.5d)); _timer = new Timer(DoWork, null, TimeSpan.FromSeconds(10d), result); }
public void Init() { _queue = new Queue <Book>(); _apiFormat = ConfigurationManager.AppSettings["DoubanApi"]; TimeSpan result = ConfigUtil.Parse <TimeSpan>("DoubanTimeout", TimeSpan.FromSeconds(30d)); _timer = new Timer(DoWork, null, result, result); Messenger.Default.Register <IsbnMsg>(this, IsbnAction.Request, OnIsbnRequest); }
protected RentManageVm() { _repo = new RentRepository(); _repoPerson = new PersonRepository(); _repoBook = new BookRepository(); _canRentCount = ConfigUtil.Parse <Int32>("每人能借多少本", 10); _rentCount = 0; Persons = new ObservableCollection <Person>(); Books = new ObservableCollection <Book>(); Rents = new ObservableCollection <Rent>(); CurrentRents = new ObservableCollection <Rent>(); ToBeRents = new ObservableCollection <Rent>(); Messenger.Default.Register <ItemChangedMsg <Person> >(this, OnPersonChanged); Messenger.Default.Register <ItemChangedMsg <Book> >(this, OnBookChanged); Messenger.Default.Register <UpdateCountMsg>(this, OnUpdateCount); Init(); }
public void Init() { TimeSpan result = ConfigUtil.Parse <TimeSpan>("备份间隔", TimeSpan.FromMinutes(5d)); _timer = new Timer(DoWork, null, result, result); }