예제 #1
0
        public MainForm()
        {
            InitializeComponent();

            // Initialize Tray Icon
            TrayIcon = new NotifyIcon
            {
                Icon        = Icon,
                ContextMenu = new ContextMenu(new[] {
                    new MenuItem("Price Alerts", TrayPriceAlerts),
                    new MenuItem("Setup Price Alerts", TraySetupPriceAlerts),
                    new MenuItem("-"),
                    new MenuItem("Set WoW directory", TraySetWoWDir),
                    new MenuItem("-"),
                    new MenuItem("Exit", Exit)
                }),
                Visible = true
            };

            MinimizeBox = true;

            if (string.IsNullOrEmpty(Settings.Default.WoWLocation))
            {
                SelectWoWDirectory();
            }
            else
            {
                ValidateWoWDirectory();
            }


            foreach (var item in Enum.GetValues(typeof(Servers)).Cast <Servers>())
            {
                serverSelectorCombo.Items.Add(item);
            }

            serverSelectorCombo.DropDownWidth = serverSelectorCombo.Width;

            serverSelectorCombo.SelectedItem  = (Servers)Settings.Default.SelectedServer;
            serverSelectorCombo.DropDownStyle = ComboBoxStyle.DropDownList;
            TrayIcon.MouseDoubleClick        += TrayIcon_MouseDoubleClick;

            FetchAppData();

            ServicePointManager.Expect100Continue = true;
            ServicePointManager.SecurityProtocol  = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

            PriceTrackerUtils.PriceTrackerRequest();

            HideForm();
        }
예제 #2
0
 private void timerCheckPrices_Tick(object sender, EventArgs e)
 {
     PriceTrackerUtils.PriceTrackerRequest();
 }