public void InitializeParameter(MainWindow mainWindow)
 {
     XGrid.OpacityMask = this.Resources["OpenBrush"] as LinearGradientBrush;
     CB_Size.ItemsSource = Constant.Sizes;
     CB_Region.ItemsSource = Constant.Regions;
     SettingInstant = new Setting();
     XGrid.DataContext = SettingInstant;
     _mainWindow = mainWindow;
 }
Пример #2
0
 public Crawler(Setting s)
 {
     _region = s.Region;
     _storeDirectory = s.StoreDirectory;
     if (!Directory.Exists(_storeDirectory))
     {
         try
         {
             Directory.CreateDirectory(_storeDirectory);
         }
         catch (Exception)
         {
             _storeDirectory = ".\\";
         }
     }
     _size = s.Size;
 }
Пример #3
0
 public static void Process()
 {
     bool flag = true;
     while(flag)
     {
         try
         {
             Setting s = new Setting();
             Crawler c = new Crawler(s);
             string storePath = c.Download(0);
             c.SetWallpaper(storePath);
             flag = false;
         }
         catch(WebException)
         {
             flag = true;
         }
     }
 }
 public void InitializeParameter(Setting s, MainWindow mainWindow)
 {
     _maxCount = 7;
     _clickCount = 0;
     _current = -1;
     _imagePathList = new List<string>();
     _crawler = new Crawler(s);
     _autoSet = s.AutoSet;
     _mainWindow = mainWindow;
 }