private void Form1_Load(object sender, EventArgs e) { SpiderHost = new Spider.SpiderHost(); SpiderHost.RegistredAppTypes.Add("main", typeof(Spider.Apps.main)); tmrReload = new System.Windows.Forms.Timer(); this.Controls.Add(SpiderHost); SpiderHost.Dock = DockStyle.Fill; SPListView listView = new SPListView(this.Stylesheet); this.Controls.Add(listView); listView.AddItem("Test", new Uri("leros:internal:test")); listView.Dock = DockStyle.Left; listView.Width = 270; SpiderHost.Navigate("spider:main:t"); }
public main(SpiderHost host) : base(host) { tmrReload = new Timer(); tmrReload.Tick += tmrReload_Tick; tmrReload.Interval = 1000; tmrReload.Start(); this.Spider.LoadFile("testlua.xml"); OAuthForm oauthForm = new OAuthForm("http://leros.cobresia.webfactional.com/test", "http://home:8080/myproject/oauth2/authorize", "4c5b175ea7cd6e51022cb999da4c0d", "2fa2469afcb2be1ee6133ede33e384"); if (LerosClient.Properties.Settings.Default.access_token == null) { if (oauthForm.ShowDialog() == DialogResult.OK) { String code = oauthForm.Code; } } WebClient wc = new WebClient(); wc.DownloadStringCompleted += wc_DownloadStringCompleted; wc.DownloadStringAsync(new Uri("http://home:8080/myproject/leros/api/v1/session/?format=json&bearer_token=" + LerosClient.Properties.Settings.Default.access_token)); }