Ejemplo n.º 1
0
        /// <summary>
        /// Initializes the instance of this MainView.
        /// Because error logging mechanism uses the MainView's console, it needs to be called only after the handle for the window
        /// has been created --> during the "Load" event or later (after the form has been created and shown).
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void initialize(object sender, EventArgs e)
        {
            Config         = new MKMToolConfig();
            timer.Interval = 1440 * 1000 * 60; // set the interval to one day (1440 minutes in ms)
            try
            {
                var doc2 = MKMInteract.RequestHelper.getAccount();

                if (Config.MyCountryCode == "") // signifies user wants auto-detect, otherwise the chosen setting overrides what we get from MKM
                {
                    Config.MyCountryCode = doc2["response"]["account"]["country"].InnerText;
                }
                MKMHelpers.sMyId = doc2["response"]["account"]["idUser"].InnerText;
            }
            catch (Exception eError)
            {
                MKMHelpers.LogError("initializing product list and account info", eError.Message, true);
            }
            bot                      = new MKMBot();
            settingsWindow           = new UpdatePriceSettings("LastSettingsPreset", "Settings of Update Price");
            stockViewWindow          = new StockView();
            checkCheapDealsWindow    = new CheckWantsView();
            checkDisplayPricesWindow = new CheckDisplayPrices();
            wantlistEditorViewWindow = new WantlistEditorView();
            priceExternalListWindow  = new PriceExternalList();
        }
Ejemplo n.º 2
0
 private void buttonPriceExternal_Click(object sender, EventArgs e)
 {
     if (priceExternalListWindow.IsDisposed)
     {
         priceExternalListWindow = new PriceExternalList();
     }
     if (priceExternalListWindow.Visible)
     {
         priceExternalListWindow.Hide();
     }
     else
     {
         priceExternalListWindow.Show(this);
     }
 }