Napisałem kod i w miejscu gdzie umieściłem komentarz chciałbym wywołać metodę odswiez, jednak nie wiem jak to zrobić
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Timers;
namespace odswiezanieStrony
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private static System.Timers.Timer aTimer;
public static void OnTimedEvent(object source, ElapsedEventArgs e)
{
//Tu chciałbym wywyłać metodę odswież lub wywołać webBrowser1.Refresh();
}
public void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
aTimer = new System.Timers.Timer(10000);
aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
aTimer.Interval = 10000;
aTimer.Enabled = true;
}
public void odswiez()
{
webBrowser1.Refresh();
}
}
}