public DownloadUrlForm(IPluginHost host) { InitializeComponent(); downloadUrlDisplay.Text = ""; downloadUrlDisplay.Click += delegate { ProcessStartInfo sInfo = new ProcessStartInfo(downloadUrlDisplay.Text); Process.Start(sInfo); }; createUrlButton.Click += async delegate { string dbName = Synchronization.GetDbFileName(host.Database); int duration = Math.Max((int)Math.Round(durationInput.Value) * SecondsPerHour, 1); downloadUrlDisplay.Text = await Synchronization.GetDownloadUrlWithAuth(dbName, duration); }; }
public override bool Initialize(IPluginHost host) { if (host == null) { return(false); } _host = host; _config = new Configuration(_host.CustomConfig); //Set the version information file signature UpdateCheckEx.SetFileSigKey(UpdateUrl, Resources.B2SyncExt_UpdateCheckFileSigKey); Interface.Init(_host); Synchronization.Init(_config); _host.MainWindow.FileSaved += OnFileSaved; _host.MainWindow.FileOpened += OnFileOpened; return(true); }
private async void OnSyncClicked(object sender, EventArgs e) { await Synchronization.SynchronizeDbAsync(_host); }