-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml.cs
121 lines (96 loc) · 3.39 KB
/
MainWindow.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using System.ComponentModel;
using System.Windows.Media.Animation;
using HtmlAgilityPack;
namespace FIRST
{
public class Test : INotifyPropertyChanged
{
string name;
public string Name
{
get
{
return name;
}
set
{
name = value;
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs("Name"));
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
}
/// <summary>
/// US First Loader
///
/// Important links that we are scrapeing off of
/// https://my.usfirst.org/myarea/index.lasso?page=searchform
/// https://my.usfirst.org/myarea/index.lasso?page=event_details&eid=3749&-session=myarea:C77D64051d5f729EDDNsI1002DFE
///
/// </summary>
public partial class MainWindow : Window
{
Event selectedEvent;
public static readonly DependencyProperty scale_prop = DependencyProperty.Register("Scale", typeof(double), typeof(MainWindow));
public static readonly DependencyProperty fade_prop = DependencyProperty.Register("Fade", typeof(double), typeof(MainWindow));
public double Scale { get { return (double)GetValue(scale_prop); } set { SetValue(scale_prop, value); } }
public double Fade { get { return (double)GetValue(fade_prop); } set { SetValue(fade_prop, value); } }
EventSelector selector = new EventSelector();
public MainWindow()
{
Scale = 1.0;
Fade = 1.0;
InitializeComponent();
System.Net.WebRequest.Create("https://my.usfirst.org/myarea/index.lasso");
Tester.Items.Add(new Test { Name = "BEN1" });
Tester.Items.Add(new Test { Name = "BEN2" });
Tester.Items.Add(new Test { Name = "BEN3" });
Tester.Items.Add(new Test { Name = "BEN4" });
//new EventPage("http://www2.usfirst.org/2011comp/events/SDC/matchresults.html");
}
void Animate()
{
(FindResource("ItemAnimation") as Storyboard).Begin();
}
private void Main_Loaded(object sender, RoutedEventArgs e)
{
}
private void MenuItem_Click(object sender, RoutedEventArgs e)
{
selector.Owner = this;
bool? result = selector.ShowDialog();
if (result.Value)
{
//selectedEvent = selector.SelectedEvent;
//selectedEvent.LoadEventDetails();
}
else
{
}
}
private void MenuItem_Click_1(object sender, RoutedEventArgs e)
{
EventResultParser parser = new EventResultParser();
EventResults result = parser.ParseLink("blah");
ResultViewer viewer = new ResultViewer(result);
viewer.ShowDialog();
}
}
}