예제 #1
0
        /// <summary>
        /// Refreshes the histogram.
        /// </summary>
        /// <param name="minerals">The minerals.</param>
        private void RefreshHistogram(MineralsOut minerals)
        {
            histogram1.Suffix = "k Isk";
            histogram1.ListBars.Clear();
            Bar bar = new Bar
                          {
                              Color1 = Color.FromArgb(255, 228, 175),
                              Color2 = Color.FromArgb(88, 61, 31),
                              Name = "Tritanium",
                              Value = minerals.Tritanium*Config<Settings>.Instance.PriceTritanium/1000
                          };
            histogram1.ListBars.Add(bar);

            bar = new Bar
                      {
                          Color1 = Color.FromArgb(0xff, 0xa3, 0x66),
                          Color2 = Color.FromArgb(0x5c, 0x2c, 0x18),
                          Name = "Pyerite",
                          Value = minerals.Pyerite*Config<Settings>.Instance.PricePyerite/1000
                      };
            histogram1.ListBars.Add(bar);

            bar = new Bar
                      {
                          Color1 = Color.FromArgb(0xf2, 0xff, 0xc7),
                          Color2 = Color.FromArgb(0x3c, 0x50, 0x18),
                          Name = "Mexallon",
                          Value = minerals.Mexallon*Config<Settings>.Instance.PriceMexallon/1000
                      };
            histogram1.ListBars.Add(bar);

            bar = new Bar
                      {
                          Color1 = Color.FromArgb(0xe4, 0xf3, 0xf7),
                          Color2 = Color.FromArgb(0x2a, 0x80, 0x9c),
                          Name = "Isogen",
                          Value = minerals.Isogen*Config<Settings>.Instance.PriceIsogen/1000
                      };
            histogram1.ListBars.Add(bar);

            bar = new Bar
                      {
                          Color1 = Color.Silver,
                          Name = "Nocxium",
                          Value = minerals.Nocxium*Config<Settings>.Instance.PriceNocxium/1000
                      };
            histogram1.ListBars.Add(bar);
            bar = new Bar
                      {
                          Color1 = Color.FromArgb(0x54, 0x98, 0x3a),
                          Color2 = Color.FromArgb(0x0b, 0x30, 0x10),
                          Name = "Zydrine",
                          Value = minerals.Zydrine*Config<Settings>.Instance.PriceZydrine/1000
                      };
            histogram1.ListBars.Add(bar);
            bar = new Bar
                      {
                          Color1 = Color.FromArgb(0xc7, 0xbb, 0xa8),
                          Color2 = Color.FromArgb(0x44, 0x37, 0x24),
                          Name = "Megacyte",
                          Value = minerals.Megacyte*Config<Settings>.Instance.PriceMegacyte/1000
                      };
            histogram1.ListBars.Add(bar);
            bar = new Bar
                      {
                          Color1 = Color.FromArgb(0xda, 0x4e, 0x40),
                          Color2 = Color.FromArgb(0x48, 0x04, 0x03),
                          //Color1 = Color.DarkRed,
                          Name = "Morphite",
                          Value = minerals.Morphite*Config<Settings>.Instance.PriceMorphite/1000
                      };
            histogram1.ListBars.Add(bar);

            histogram1.Invalidate();
            textBoxProfit.Text = Resources.CalculatorForm_RefreshHistogram_Total_Profit__ + minerals.GetMineralProfit().ToString("#,#.##") + Resources.CalculatorForm_RefreshHistogram__ISK;
        }
예제 #2
0
 /// <summary>
 /// Handles the MouseMove event of the Histogram control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
 private void Histogram_MouseMove(object sender, MouseEventArgs e)
 {
     Bar fb = null;
     foreach (Bar bar in ListBars)
     {
         if (e.X > bar.Rect.Left && e.X < bar.Rect.Right &&
             e.Y < bar.Rect.Bottom && e.Y > bar.Rect.Top)
             fb = bar;
     }
     if (fb != null)
     {
         if (BarEnterEvent != null && _mouseEnteredBar != fb)
             BarEnterEvent(this, new HistogramEnterEventHandlerArgs {Bar = fb});
         _mouseEnteredBar = fb;
     }
     else if (_mouseEnteredBar != null && BarLeaveEvent != null)
     {
         BarLeaveEvent(this, new HistogramEnterEventHandlerArgs {Bar = _mouseEnteredBar});
         _mouseEnteredBar = null;
     }
 }