/[RomCheater]/trunk/RomCheater.Core/Docking/FloatingRVACalculator.cs
ViewVC logotype

Contents of /trunk/RomCheater.Core/Docking/FloatingRVACalculator.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 892 - (show annotations) (download)
Wed Sep 17 05:56:41 2014 UTC (6 years, 10 months ago) by william
File size: 2640 byte(s)
+ alot of dang work to force an icon to be shown on the docked panels
  ** when it was as simple as setting: DockPanel.ShowDocumentIcon to true

1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9 using WeifenLuo.WinFormsUI.Docking;
10 using System.Diagnostics;
11 using Sojaner.MemoryScanner;
12 using RomCheater.Interfaces;
13
14 namespace RomCheater.Core.Docking
15 {
16 public partial class FloatingRVACalculator : DockContent,
17 IAcceptsPlugin<IConfigPlugin>,
18 IAcceptsProcess<Process>,
19 IAcceptsProcessAndConfig,
20 IAcceptPEData
21 {
22 public FloatingRVACalculator() { InitializeComponent(); this.AcceptedPlugin = null; this.AcceptedProcess = null; }
23 public FloatingRVACalculator(IConfigPlugin config) : this() { this.AcceptedPlugin = config; }
24 public FloatingRVACalculator(IConfigPlugin config, Process process) : this() { this.AcceptedPlugin = config; this.AcceptedProcess = process; }
25 #region IAcceptsProcess<Process> Members
26 public Process AcceptedProcess { get; set; }
27 #endregion
28 #region IAcceptsPlugin<IConfigPlugin> Members
29 public IConfigPlugin AcceptedPlugin { get; set; }
30 #endregion
31 #region IAcceptPEData members
32 private IPEDData peData { get; set; }
33 public void SetPEViewerData(IPEDData peData)
34 { this.peData = peData;
35
36 if(peData.Is32bitAssembly())
37 {
38 txtImageBase.Value = (uint)peData._VirtualImageBase;
39 }
40 else
41 {
42 txtImageBase.Value = (ulong)peData._VirtualImageBase;
43 }
44
45 }
46 #endregion
47
48 private void btnConvertMemoryToFile_Click(object sender, EventArgs e)
49 {
50 if (txtMemToFile_ImageAddress.Value < txtImageBase.Value)
51 {
52 MessageBox.Show("Image Address cannot be less than Image Base!", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
53 return;
54 }
55
56 txtMemToFile_FileAddress.Value = (txtMemToFile_ImageAddress.Value - txtImageBase.Value);
57
58 }
59
60 private void btnConvertFileToMemory_Click(object sender, EventArgs e)
61 {
62 if (txtFileToMem_FileAddress.Value < txtFileBase.Value)
63 {
64 MessageBox.Show("File Address cannot be less than File Base!", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
65 return;
66 }
67 txtFileToMem_ImageAddress.Value = (txtFileToMem_FileAddress.Value + txtImageBase.Value);
68 }
69 }
70 }

  ViewVC Help
Powered by ViewVC 1.1.22