コード例 #1
0
        private void frmSettings_Load(object sender, EventArgs e)
        {
            var binder = new ControlBinder <Settings>();

            binder.Add(tbConnectionString, model => model.ConnectionString);
            binder.Add(tbContainerName, model => model.ContainerName);
            binder.Document = Settings;
        }
コード例 #2
0
 private void frmMain_Load(object sender, System.EventArgs e)
 {
     _settings        = JsonSettingsBase.Load <AppSettings>();
     _binder.Document = _settings;
     _binder.Add(tbUrl, m => m.Url);
     _binder.Add(bldLocalPath, m => m.LocalPath);
     _binder.LoadValues();
 }
コード例 #3
0
        private async void frmMain_Load(object sender, EventArgs e)
        {
            _settings = JsonSettingsBase.Load <AppSettings>();

            var binder = new ControlBinder <AppSettings>();

            binder.Document = _settings;
            binder.Add(tbAccountName, m => m.AccountName);
            binder.Add(tbAccountKey, m => m.AccountKey);
            binder.Add(bldLocalPath, m => m.LocalPath);
            binder.LoadValues();

            if (StartAutomatically())
            {
                await RunBackupInnerAsync();

                this.Close();
                Application.Exit();
            }
        }
コード例 #4
0
        private async void frmMain_Load(object sender, System.EventArgs e)
        {
            var monthValues = new int[] { 3, 6, 9, 12 }.Select(i => new ListItem <int>(i, i.ToString()));

            _settings = SettingsBase.Load <Settings>();
            _binder   = new ControlBinder <Settings>();

            _binder.Add(tbSourcePath, model => model.SourcePath);
            _binder.Add(chkDelete, model => model.Delete);
            _binder.Add(chkDeleteBinObj, model => model.DeleteBinAndObj);
            _binder.Add(chkDeletePackages, model => model.DeletePackages);

            _binder.AddItems(cbDeleteMonths,
                             (model) => model.DeleteMonthsOld = cbDeleteMonths.GetValue <int>(),
                             (model) => cbDeleteMonths.SetValue(model.DeleteMonthsOld), monthValues);

            _binder.Add(chkArchive, model => model.Archive);
            _binder.Add(tbArchivePath, model => model.ArchivePath);
            _binder.AddItems(cbArchiveMonths,
                             (model) => model.ArchiveMonthsOld = cbArchiveMonths.GetValue <int>(),
                             (model) => cbArchiveMonths.SetValue(model.ArchiveMonthsOld), monthValues);

            _binder.Document = _settings;
            UpdateArchiveInfo();
            UpdateDeleteInfo();
        }