Inheritance: System.Windows.Forms.UserControl
Beispiel #1
0
 private void SaveSettings(RM RMdata)
 {
     try
     {
         RegistryKey reg = Registry.CurrentUser.OpenSubKey("Software\\RatioMaster.NET", true);
         if (reg == null)
         {
             // The key doesn't exist; create it / open it
             reg = Registry.CurrentUser.CreateSubKey("Software\\RatioMaster.NET");
         }
         reg.SetValue("Version", versionChecker.PublicVersion, RegistryValueKind.String);
         reg.SetValue("NewValues", BtoI(RMdata.chkNewValues.Checked), RegistryValueKind.DWord);
         reg.SetValue("BallonTip", BtoI(checkShowTrayBaloon.Checked), RegistryValueKind.DWord);
         reg.SetValue("MinimizeToTray", BtoI(chkMinimize.Checked), RegistryValueKind.DWord);
         reg.SetValue("CloseToTray", BtoI(closeToTrayToolStripMenuItem.Checked), RegistryValueKind.DWord);
         reg.SetValue("Client", RMdata.cmbClient.SelectedItem, RegistryValueKind.String);
         reg.SetValue("ClientVersion", RMdata.cmbVersion.SelectedItem, RegistryValueKind.String);
         reg.SetValue("UploadRate", RMdata.uploadRate.Text, RegistryValueKind.String);
         reg.SetValue("DownloadRate", RMdata.downloadRate.Text, RegistryValueKind.String);
         reg.SetValue("Interval", RMdata.interval.Text, RegistryValueKind.String);
         reg.SetValue("fileSize", RMdata.fileSize.Text, RegistryValueKind.String);
         reg.SetValue("Directory", RMdata.DefaultDirectory, RegistryValueKind.String);
         reg.SetValue("TCPlistener", BtoI(RMdata.checkTCPListen.Checked), RegistryValueKind.DWord);
         reg.SetValue("ScrapeInfo", BtoI(RMdata.checkRequestScrap.Checked), RegistryValueKind.DWord);
         reg.SetValue("EnableLog", BtoI(RMdata.checkLogEnabled.Checked), RegistryValueKind.DWord);
         // Radnom value
         reg.SetValue("GetRandUp", BtoI(RMdata.chkRandUP.Checked), RegistryValueKind.DWord);
         reg.SetValue("GetRandDown", BtoI(RMdata.chkRandDown.Checked), RegistryValueKind.DWord);
         reg.SetValue("MinRandUp", RMdata.txtRandUpMin.Text, RegistryValueKind.String);
         reg.SetValue("MaxRandUp", RMdata.txtRandUpMax.Text, RegistryValueKind.String);
         reg.SetValue("MinRandDown", RMdata.txtRandDownMin.Text, RegistryValueKind.String);
         reg.SetValue("MaxRandDown", RMdata.txtRandDownMax.Text, RegistryValueKind.String);
         // Custom values
         reg.SetValue("CustomKey", RMdata.customKey.Text, RegistryValueKind.String);
         reg.SetValue("CustomPeerID", RMdata.customPeerID.Text, RegistryValueKind.String);
         reg.SetValue("CustomPeers", RMdata.customPeersNum.Text, RegistryValueKind.String);
         reg.SetValue("CustomPort", RMdata.customPort.Text, RegistryValueKind.String);
         // Stop after...
         reg.SetValue("StopWhen", RMdata.cmbStopAfter.SelectedItem, RegistryValueKind.String);
         reg.SetValue("StopAfter", RMdata.txtStopValue.Text, RegistryValueKind.String);
         // Proxy
         reg.SetValue("ProxyType", RMdata.comboProxyType.SelectedItem, RegistryValueKind.String);
         reg.SetValue("ProxyAdress", RMdata.textProxyHost.Text, RegistryValueKind.String);
         reg.SetValue("ProxyUser", RMdata.textProxyUser.Text, RegistryValueKind.String);
         reg.SetValue("ProxyPass", RMdata.textProxyPass.Text, RegistryValueKind.String);
         reg.SetValue("ProxyPort", RMdata.textProxyPort.Text, RegistryValueKind.String);
         // Radnom value on next
         reg.SetValue("GetRandUpNext", BtoI(RMdata.checkRandomUpload.Checked), RegistryValueKind.DWord);
         reg.SetValue("GetRandDownNext", BtoI(RMdata.checkRandomDownload.Checked), RegistryValueKind.DWord);
         reg.SetValue("MinRandUpNext", RMdata.RandomUploadFrom.Text, RegistryValueKind.String);
         reg.SetValue("MaxRandUpNext", RMdata.RandomUploadTo.Text, RegistryValueKind.String);
         reg.SetValue("MinRandDownNext", RMdata.RandomDownloadFrom.Text, RegistryValueKind.String);
         reg.SetValue("MaxRandDownNext", RMdata.RandomDownloadTo.Text, RegistryValueKind.String);
         reg.SetValue("IgnoreFailureReason", BtoI(RMdata.checkIgnoreFailureReason.Checked), RegistryValueKind.DWord);
     }
     catch (Exception e)
     {
         Log += "Error in SetSettings(): " + e.Message + "\n";
     }
 }
Beispiel #2
0
 private static void NewMainItem(XmlDocument aXmlDoc, XmlElement aXmlElement, RM data, string name)
 {
     AppendItem(aXmlDoc, aXmlElement, name, "Name");
     if (data.currentTorrent.filename != null) AppendItem(aXmlDoc, aXmlElement, data.currentTorrent.filename, "Address");
     else AppendItem(aXmlDoc, aXmlElement, data.torrentFile.Text, "Address");
     AppendItem(aXmlDoc, aXmlElement, data.trackerAddress.Text, "Tracker");
     AppendItem(aXmlDoc, aXmlElement, data.uploadRate.Text, "UploadSpeed");
     AppendItem(aXmlDoc, aXmlElement, data.chkRandUP.Checked.ToString(), "UploadRandom");
     AppendItem(aXmlDoc, aXmlElement, data.txtRandUpMin.Text, "UploadRandMin");
     AppendItem(aXmlDoc, aXmlElement, data.txtRandUpMax.Text, "UploadRandMax");
     AppendItem(aXmlDoc, aXmlElement, data.downloadRate.Text, "DownloadSpeed");
     AppendItem(aXmlDoc, aXmlElement, data.chkRandDown.Checked.ToString(), "DownloadRandom");
     AppendItem(aXmlDoc, aXmlElement, data.txtRandDownMin.Text, "DownloadRandMin");
     AppendItem(aXmlDoc, aXmlElement, data.txtRandDownMax.Text, "DownloadRandMax");
     AppendItem(aXmlDoc, aXmlElement, data.cmbClient.SelectedItem.ToString(), "Client");
     AppendItem(aXmlDoc, aXmlElement, data.cmbVersion.SelectedItem.ToString(), "Version");
     AppendItem(aXmlDoc, aXmlElement, data.fileSize.Text, "Finished");
     AppendItem(aXmlDoc, aXmlElement, data.cmbStopAfter.SelectedItem.ToString(), "StopType");
     AppendItem(aXmlDoc, aXmlElement, data.txtStopValue.Text, "StopValue");
     AppendItem(aXmlDoc, aXmlElement, data.customPort.Text, "Port");
     AppendItem(aXmlDoc, aXmlElement, data.checkTCPListen.Checked.ToString(), "UseTCP");
     AppendItem(aXmlDoc, aXmlElement, data.checkRequestScrap.Checked.ToString(), "UseScrape");
     AppendItem(aXmlDoc, aXmlElement, data.comboProxyType.SelectedItem.ToString(), "ProxyType");
     AppendItem(aXmlDoc, aXmlElement, data.textProxyUser.Text, "ProxyUser");
     AppendItem(aXmlDoc, aXmlElement, data.textProxyPass.Text, "ProxyPass");
     AppendItem(aXmlDoc, aXmlElement, data.textProxyHost.Text, "ProxyHost");
     AppendItem(aXmlDoc, aXmlElement, data.textProxyPort.Text, "ProxyPort");
     AppendItem(aXmlDoc, aXmlElement, data.checkRandomUpload.Checked.ToString(), "NextUpdateUpload");
     AppendItem(aXmlDoc, aXmlElement, data.RandomUploadFrom.Text, "NextUpdateUploadFrom");
     AppendItem(aXmlDoc, aXmlElement, data.RandomUploadTo.Text, "NextUpdateUploadTo");
     AppendItem(aXmlDoc, aXmlElement, data.checkRandomDownload.Checked.ToString(), "NextUpdateDownload");
     AppendItem(aXmlDoc, aXmlElement, data.RandomDownloadFrom.Text, "NextUpdateDownloadFrom");
     AppendItem(aXmlDoc, aXmlElement, data.RandomDownloadTo.Text, "NextUpdateDownloadTo");
     AppendItem(aXmlDoc, aXmlElement, data.checkIgnoreFailureReason.Checked.ToString(), "IgnoreFailureReason");
 }
Beispiel #3
0
 private void Add(string FileName)
 {
     items++;
     allit++;
     RM rm1 = new RM();
     data.Add(rm1);
     //current = rm1;
     TabPage page1 = new TabPage("RM " + allit.ToString());
     page1.Name = "RM" + items.ToString();
     page1.Controls.Add(rm1);
     //page1.Enter += new EventHandler(this.TabPage_Enter);
     //page1.BorderStyle = BorderStyle.FixedSingle;
     //page1.BackColor = Color.White;
     tab.Controls.Add(page1);
     tab.SelectedTab = page1;
     lblTabs.Text = allit.ToString();
     if (FileName != "")
     {
         ((RM)tab.SelectedTab.Controls[0]).loadTorrentFileInfo(FileName);
     }
 }