Example #1
0
        private async void SettingsTabCtrl_TabIndexChangedAsync(object sender, EventArgs e)
        {
            if (SettingsTabCtrl.SelectedIndex == 3)
            {
                TwoFaCheckbox.CheckedChanged -= TwoFaCheckbox_CheckedChangedAsync;

                //account tab -> load settings
                TwoFaCheckbox.Checked = await clientManager.GetHasTwoFaEnabled();

                //settings loaded enable buttons
                TwoFaCheckbox.Enabled = true;

                TwoFaCheckbox.CheckedChanged += TwoFaCheckbox_CheckedChangedAsync;
            }
            else
            {
                //hide the qrcode and lable
                picture_qr.Visible = false;
                scanLable.Visible  = false;
            }

            if (SettingsTabCtrl.SelectedIndex == 2)
            {
                ExplorerIntegrationBox.Checked = ExplorerIntegrationHandler.IsEnabled();
                autostartCheckbox.Checked      = AutostartHandler.IsEnabled();
            }
        }
Example #2
0
 private void CheckBox1_CheckedChanged(object sender, EventArgs e)
 {
     if (autostartCheckbox.Checked)
     {
         AutostartHandler.SetToCurrentPath();
     }
     else
     {
         AutostartHandler.DeleteKey();
     }
 }
Example #3
0
        static void Main(string[] args)
        {
            var f = new FileInfo(System.Reflection.Assembly.GetEntryAssembly().Location);

            Directory.SetCurrentDirectory(f.Directory.FullName);

            var rollingFileAppender = new RollingFileAppender()
            {
                Layout             = new PatternLayout("%date{HH:mm:ss} [%thread] %-3level %logger - %message%newline"),
                File               = "rollingLog.txt",
                AppendToFile       = true,
                MaximumFileSize    = "100KB",
                MaxSizeRollBackups = 2
            };

            rollingFileAppender.ActivateOptions();

            BasicConfigurator.Configure(
                new ConsoleAppender(),
                rollingFileAppender
                );

            if (HandleSquirrel(args))
            {
                return;
            }

            var configFileMap = new ExeConfigurationFileMap();

#if DEBUG
            configFileMap.ExeConfigFilename = "App.Release.config";
#else
            configFileMap.ExeConfigFilename = "App.Release.config";
#endif
            Config.Configuration = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None);



            log.Info("Starting...");

            log.Info("Working Directory: " + Directory.GetCurrentDirectory());

            Application.ThreadException += Application_ThreadException;

            Task.Run(Update);


            if (PipeHandler.IsServer)
            {
                ExplorerIntegrationHandler.Init();
                AutostartHandler.Init();

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new IconHandler(args));
            }
            else
            {
                PipeHandler.SendMessage(args);
            }
        }