コード例 #1
0
ファイル: DownloadURLForm.cs プロジェクト: zedseven/B2Sync
        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);
            };
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 private async void OnSyncClicked(object sender, EventArgs e)
 {
     await Synchronization.SynchronizeDbAsync(_host);
 }