コード例 #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            Cfg.interval  = (int)(interval.Value);
            Cfg.zoom      = (int)(image_zoom.Value);
            Cfg.autostart = autostart.Checked;
            if (radioButton_CDN.Checked)
            {
                Cfg.source_selection = 1;
                Cfg.cloud_name       = cloud_name.Text;
                Cfg.image_source     = "http://res.cloudinary.com/" + Cfg.cloud_name + "/image/fetch/http://himawari8-dl.nict.go.jp/himawari8/img/D531106";
            }
            else
            {
                Cfg.source_selection = 0;
                Cfg.image_source     = "http://himawari8-dl.nict.go.jp/himawari8/img/D531106";
            }
            switch (image_size.SelectedIndex)
            {
            case 0: Cfg.size = 1; break;

            case 1: Cfg.size = 2; break;

            case 2: Cfg.size = 4; break;

            case 3: Cfg.size = 8; break;

            case 4: Cfg.size = 16; break;

            default: Cfg.size = 1; break;
            }
            Cfg.Save();
            Autostart.Set(Cfg.autostart);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            if (File.Exists(Application.StartupPath + @"\trace.log"))
            {
                File.Delete(Application.StartupPath + @"\trace.log");
            }
            Trace.Listeners.Add(new TextWriterTraceListener(Application.StartupPath + @"\trace.log"));
            Trace.AutoFlush = true;

            try
            {
                Cfg.Load();
            }
            catch
            {
                return;
            }
            if (Cfg.source_selection == 0 & Cfg.cloud_name.Equals("demo"))
            {
                #if DEBUG
                #else
                DialogResult dr = MessageBox.Show("WARNING: it's recommended to get images from CDN. \n 注意:推荐使用CDN方式来抓取图片,以提高稳定性。", "EarthLiveSharp");
                if (dr == DialogResult.OK)
                {
                    Process.Start("https://github.com/bitdust/EarthLiveSharp/issues/32");
                }
                #endif
            }
            Cfg.image_folder = Application.StartupPath + @"\images";
            Cfg.Save();
            // scraper.image_source = "http://himawari8-dl.nict.go.jp/himawari8/img/D531106";
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Cfg.satellite = satellite.Text;
            Cfg.interval  = (int)(interval.Value);
            Cfg.zoom      = (int)(image_zoom.Value);
            Cfg.autostart = autostart.Checked;
            if (radioButton_CDN.Checked)
            {
                Cfg.source_selection = 1;
                Cfg.cloud_name       = cloud_name.Text;
                Cfg.api_key          = api_key.Text;
                Cfg.api_secret       = api_secret.Text;
            }
            else
            {
                Cfg.source_selection = 0;
            }
            switch (image_size.SelectedIndex)
            {
            case 0: Cfg.size = 1; break;

            case 1: Cfg.size = 2; break;

            case 2: Cfg.size = 4; break;

            case 3: Cfg.size = 8; break;

            case 4: Cfg.size = 16; break;

            default: Cfg.size = 1; break;
            }
            Cfg.Save();
            Autostart.Set(Cfg.autostart);
            this.Close();
        }
コード例 #4
0
 private void button3_Click(object sender, EventArgs e)
 {
     Cfg.source_select = comboBox1.Text;
     Cfg.interval      = (int)(numericUpDown1.Value);
     Cfg.max_number    = (int)(numericUpDown2.Value);
     Cfg.autostart     = checkBox1.Checked;
     Cfg.display_mode  = comboBox_DisplayMode.SelectedIndex;
     Cfg.Save();
     Autostart.Set(Cfg.autostart);
 }
コード例 #5
0
ファイル: settingsForm.cs プロジェクト: imcc/EarthLiveSharp
        private void Save()
        {
            Cfg.SourceSelect = CbImageSource.Text;
            Cfg.Interval     = (int)(TxtUpdateMinutes.Value);
            Cfg.MaxNumber    = (int)(TxtMaxImageNumber.Value);
            Cfg.Autostart    = CbAutoStart.Checked;
            Cfg.DisplayMode  = CbDisplayMode.SelectedIndex;
            Cfg.Save();

            Autostart.Set(Cfg.Autostart);
        }
コード例 #6
0
        static void Main(string[] args)
        {
            if (File.Exists(Application.StartupPath + @"\trace.log"))
            {
                File.Delete(Application.StartupPath + @"\trace.log");
            }
            if (!File.Exists(Application.ExecutablePath + ".config"))
            {
                // 生成配置文件

                //File.WriteAllText(Application.ExecutablePath + ".config"),Properties.Resources.config,System.Text.Encoding.Default);
                FileStream   fs = new FileStream(Application.ExecutablePath + ".config", FileMode.OpenOrCreate, FileAccess.ReadWrite);
                StreamWriter sw = new StreamWriter(fs);
                sw.WriteLine(Properties.Resources.config);
                sw.Close();
                fs.Close();
                //File.Delete(Application.StartupPath + @"\trace.log");
            }

            Trace.Listeners.Add(new TextWriterTraceListener(Application.StartupPath + @"\trace.log"));
            Trace.AutoFlush = true;

            try
            {
                Cfg.Load();
            }
            catch
            {
                return;
            }
            if (Cfg.source_selection == 0 & Cfg.cloud_name.Equals("demo"))
            {
                //#if DEBUG

                //#else
                //DialogResult dr = MessageBox.Show("WARNING: it's recommended to get images from CDN. \n 注意:推荐使用CDN方式来抓取图片,以提高稳定性。", "EarthLiveSharp");
                //if (dr == DialogResult.OK)
                //{
                //    Process.Start("https://github.com/bitdust/EarthLiveSharp/issues/32");
                //}
                //#endif
            }
            Cfg.image_folder = Application.StartupPath + @"\images";
            Cfg.Save();
            // scraper.image_source = "http://himawari8-dl.nict.go.jp/himawari8/img/D531106";
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
コード例 #7
0
        static void Main(string[] args)
        {
            if (System.Environment.OSVersion.Version.Major >= 6)
            {
                SetProcessDPIAware();
            }
            if (File.Exists(Application.StartupPath + @"\trace.log"))
            {
                File.Delete(Application.StartupPath + @"\trace.log");
            }
            Trace.Listeners.Add(new TextWriterTraceListener(Application.StartupPath + @"\trace.log"));
            Trace.AutoFlush = true;

            try
            {
                Cfg.Load();
            }
            catch
            {
                return;
            }
            if (Cfg.source_selection == 0 & Cfg.cloud_name.Equals("demo"))
            {
                #if DEBUG
                #else
                DialogResult dr = MessageBox.Show("WARNING: it's recommended to get images from CDN. \n 注意:推荐使用CDN方式来抓取图片,以提高稳定性。", "EarthLiveSharp");
                if (dr == DialogResult.OK)
                {
                    Process.Start("https://github.com/bitdust/EarthLiveSharp/issues/32");
                }
                #endif
            }
            //if (Cfg.language.Equals("en")| Cfg.language.Equals("zh-Hans")| Cfg.language.Equals("zh-Hant"))
            //{
            //    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(Cfg.language);
            //}
            Cfg.image_folder = Application.StartupPath + @"\images";
            Cfg.Save();
            Scrap_wrapper.set_scraper();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
コード例 #8
0
        private void save_config()
        {
            Cfg.satellite     = satellite.Text;
            Cfg.interval      = (int)(interval.Value);
            Cfg.zoom          = (int)(image_zoom.Value);
            Cfg.autostart     = autostart.Checked;
            Cfg.setwallpaper  = setwallpaper.Checked;
            Cfg.saveTexture   = Save_Texture.Checked;
            Cfg.saveMaxCount  = (int)Save_Max_Count.Value;
            Cfg.saveDirectory = Directory_Display.Text;

            if (radioButton_CDN.Checked)
            {
                Cfg.source_selection = 1;
                Cfg.cloud_name       = cloud_name.Text;
                Cfg.api_key          = api_key.Text;
                Cfg.api_secret       = api_secret.Text;
            }
            else
            {
                Cfg.source_selection = 0;
            }
            switch (image_size.SelectedIndex)
            {
            case 0: Cfg.size = 1; break;

            case 1: Cfg.size = 2; break;

            case 2: Cfg.size = 4; break;

            case 3: Cfg.size = 8; break;

            case 4: Cfg.size = 16; break;

            default: Cfg.size = 1; break;
            }
            Cfg.Save();
            Autostart.Set(Cfg.autostart);
        }
コード例 #9
0
 //All logic pertaining to stopping the service
 private void stopLogic()
 {
     if (serviceRunning)
     {
         timer1.Stop();
         timer2.Stop();
         timer3.Stop();
         button_start.Enabled    = true;
         button_stop.Enabled     = false;
         button_settings.Enabled = true;
         runningLabel.Text       = "Not Running";
         runningLabel.ForeColor  = Color.DarkRed;
         serviceRunning          = false;
     }
     else if (!serviceRunning)
     {
         MessageBox.Show("Service is not currently running");
     }
     Cfg.showcoastline = radioButton1.Checked;
     Cfg.Save();
     contextMenuSetter();
 }
コード例 #10
0
ファイル: settingsForm.cs プロジェクト: ringsd/EarthLiveSharp
        private void button1_Click(object sender, EventArgs e)
        {
            Cfg.interval       = (int)(interval.Value);
            Cfg.retry_interval = (int)(retry_interval.Value);
            Cfg.delete_timeout = (int)(delete_timeout.Value);
            Cfg.zoom           = (int)(image_zoom.Value);
            Cfg.autostart      = autostart.Checked;
            if (radioButton_CDN.Checked)
            {
                Cfg.source_selection = 1;
                Cfg.cloud_name       = cloud_name.Text;
                Cfg.api_key          = api_key.Text;
                Cfg.api_secret       = api_secret.Text;
                Cfg.image_source     = Cfg.cloud_url_base + Cfg.cloud_name + "/image/fetch/http://himawari8-dl.nict.go.jp/himawari8/img/D531106";
            }
            else
            {
                Cfg.source_selection = 0;
                Cfg.image_source     = "http://himawari8-dl.nict.go.jp/himawari8/img/D531106";
            }
            switch (image_size.SelectedIndex)
            {
            case 0: Cfg.size = 1; break;

            case 1: Cfg.size = 2; break;

            case 2: Cfg.size = 4; break;

            case 3: Cfg.size = 8; break;

            case 4: Cfg.size = 16; break;

            default: Cfg.size = 1; break;
            }
            Cfg.Save();
            Autostart.Set(Cfg.autostart);
            this.Close();
        }
コード例 #11
0
        static void Main(string[] args)
        {
            if (File.Exists(Application.StartupPath + @"\trace.log"))
            {
                File.Delete(Application.StartupPath + @"\trace.log");
            }
            Trace.Listeners.Add(new TextWriterTraceListener(Application.StartupPath + @"\trace.log"));
            Trace.AutoFlush = true;

            try
            {
                Cfg.Load();
            }
            catch
            {
                return;
            }
            Cfg.image_folder = Application.StartupPath + @"\images";
            Cfg.Save();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }