private EvilDPSArea RegisterNewAreaSync(string name) { if (this.InvokeRequired) { EvilDPSArea result = null; this.Invoke(new MethodInvoker(delegate() { result = RegisterNewAreaSync(name); })); return result; } EvilDPSArea newArea = new EvilDPSArea(); newArea.DisplayName = name; this.Controls.Add(newArea); newArea.Left = evilDPSArea1.Left; newArea.Width = evilDPSArea1.Width; newArea.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; newArea.SizeChanged += new EventHandler(newArea_SizeChanged); areas.Add(newArea); RefreshLayout(); return newArea; }
private static int AddAreaToGraphForm(Form simpleForm, int currentX, EvilDPSArea area, List<EvilDPSGraph> allGraphs) { Label l = new Label(); l.Text = string.IsNullOrEmpty(area.DisplayName) ? "Self" : area.DisplayName; simpleForm.Controls.Add(l); l.Top = currentX + 1; l.Left = 3; currentX += l.Height; foreach (var entry in area.GetShownAsGraph()) { string name = entry.Key; Label l2 = new Label(); l2.Text = name; simpleForm.Controls.Add(l2); l2.Top = currentX + 1; l2.Left = 3; simpleForm.Controls.Add(entry.Value); entry.Value.Top = currentX; entry.Value.Left = 51; entry.Value.Width = 300; entry.Value.Height = 80; currentX += entry.Value.Height+2; allGraphs.Add(entry.Value); } return currentX; }
private void Format(StringBuilder result, string p, EvilDPSArea evilDPSArea1) { if (p == null) { result.Append(";"); result.Append(evilDPSArea1.DisplayName); } else { result.Append(p); } result.Append(";"); float dout, din, hout, hin, dpout, dpin; evilDPSArea1.GetCurrent(out dout, out din, out hout, out hin, out dpout, out dpin); result.Append(dout); result.Append(";"); result.Append(din); result.Append(";"); result.Append(hout); result.Append(";"); result.Append(hin); result.Append(";"); result.Append(dpout); result.Append(";"); result.Append(dpin); }
private void AddToAreaDictionary(Guid connectId, EvilDPSArea evilDPSArea) { lock (areaLookup) { areaLookup.Add(connectId, evilDPSArea); } }
private void UpdateAreaAsync(EvilDPSArea evilDPSArea, int updatePeriod, int averagePeriod, float dpsOut, float dpsIn, float hOut, float hIn, float pdOut, float pdIn) { if (this.InvokeRequired) { this.BeginInvoke(new MethodInvoker(delegate() { UpdateAreaAsync(evilDPSArea, updatePeriod, averagePeriod, dpsOut, dpsIn, hOut, hIn, pdOut, pdIn); })); return; } try { evilDPSArea.UpdateAsync(dpsOut, dpsIn, hOut, hIn, pdOut, pdIn); } catch { } }
private void RemoveAreaAsync(EvilDPSArea evilDPSArea) { if (this.InvokeRequired) { this.BeginInvoke(new MethodInvoker(delegate() { RemoveAreaAsync(evilDPSArea); })); return; } this.Controls.Remove(evilDPSArea); this.areas.Remove(evilDPSArea); RefreshLayout(); }