예제 #1
0
        protected void OnBtnApplyClicked(object sender, EventArgs e)
        {
            if (chkAntivirus.Active && chkClamd.Active)
            {
                if (string.IsNullOrEmpty(txtClamdHost.Text))
                {
                    MessageDialog dlgMsg = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok,
                                                             "clamd host cannot be empty");
                    dlgMsg.Run();
                    dlgMsg.Destroy();
                    return;
                }
            }

            // TODO: Check sanity
            Core.Settings.Current.TemporaryFolder      = txtTmp.Text;
            Core.Settings.Current.UnArchiverPath       = txtUnar.Text;
            Core.Settings.Current.DatabasePath         = txtDatabase.Text;
            Core.Settings.Current.RepositoryPath       = txtRepository.Text;
            Core.Settings.Current.UseAntivirus         = chkAntivirus.Active;
            Core.Settings.Current.UseClamd             = chkClamd.Active;
            Core.Settings.Current.ClamdHost            = txtClamdHost.Text;
            Core.Settings.Current.ClamdPort            = (ushort)spClamdPort.Value;
            Core.Settings.Current.ClamdIsLocal         = chkClamdIsLocal.Active;
            Core.Settings.Current.CompressionAlgorithm = (AlgoEnum)Enum.Parse(typeof(AlgoEnum), cmbCompAlg.ActiveText);
            if (!chkClamd.Active || !chkAntivirus.Active)
            {
                Core.Settings.Current.UseClamd     = false;
                Core.Settings.Current.ClamdHost    = null;
                Core.Settings.Current.ClamdPort    = 3310;
                Core.Settings.Current.ClamdIsLocal = false;
            }

            if (chkVirusTotal.Active && chkAntivirus.Active)
            {
                Core.Settings.Current.UseVirusTotal = true;
                Core.Settings.Current.VirusTotalKey = txtVirusTotal.Text;
                Workers.InitVirusTotal(Core.Settings.Current.VirusTotalKey);
            }
            else
            {
                Core.Settings.Current.UseVirusTotal = false;
                Core.Settings.Current.VirusTotalKey = null;
            }

            Core.Settings.SaveSettings();
            Workers.CloseDB();
            Workers.InitDB();
            Context.ClamdVersion = null;
            Workers.InitClamd();
            Context.CheckUnar();
            btnDialog.Click();
        }
예제 #2
0
 public static void Main(string[] args)
 {
     Settings.LoadSettings();
     Context.CheckUnar();
     if (Settings.Current.UseAntivirus)
     {
         if (Settings.Current.UseClamd)
         {
             Workers.InitClamd();
         }
         if (Settings.Current.UseVirusTotal)
         {
             Context.VirusTotalEnabled = Workers.InitVirusTotal(Settings.Current.VirusTotalKey);
         }
     }
     Context.UsableDotNetZip = false;
     new Application(Platforms.XamMac2).Run(new frmMain());
 }
예제 #3
0
        protected void OnBtnApplyClicked(object sender, EventArgs e)
        {
            // TODO: Check sanity
            Settings.Current.TemporaryFolder      = txtTmp.Text;
            Settings.Current.UnArchiverPath       = txtUnar.Text;
            Settings.Current.DatabasePath         = txtDatabase.Text;
            Settings.Current.RepositoryPath       = txtRepository.Text;
            Settings.Current.CompressionAlgorithm = cmbCompAlg.SelectedValue;

            if (!chkClamd.Checked.Value ||
                !chkAntivirus.Checked.Value)
            {
                Settings.Current.UseClamd     = false;
                Settings.Current.ClamdHost    = null;
                Settings.Current.ClamdPort    = 3310;
                Settings.Current.ClamdIsLocal = false;
            }

            if (chkVirusTotal.Checked.Value &&
                chkAntivirus.Checked.Value)
            {
                Settings.Current.UseVirusTotal = true;
                Settings.Current.VirusTotalKey = txtVirusTotal.Text;
                Workers.InitVirusTotal(Settings.Current.VirusTotalKey);
            }
            else
            {
                Settings.Current.UseVirusTotal = false;
                Settings.Current.VirusTotalKey = null;
            }

            Settings.SaveSettings();
            Workers.CloseDB();
            Workers.InitDB();
            Context.ClamdVersion = null;
            Workers.InitClamd();
            Context.CheckUnar();
            Close();
        }
예제 #4
0
        public static void Main(string[] args)
        {
            Settings.LoadSettings();
            Context.CheckUnar();
            Context.UsableDotNetZip = true;
            if (Settings.Current.UseAntivirus)
            {
                if (Settings.Current.UseClamd)
                {
                    Workers.InitClamd();
                }
                if (Settings.Current.UseVirusTotal)
                {
                    Context.VirusTotalEnabled = Workers.InitVirusTotal(Settings.Current.VirusTotalKey);
                }
            }

            Application.Init();
            frmMain win = new frmMain();

            win.Show();
            Application.Run();
        }