public MainFrm() { this.InitializeComponent(); this.MaximumSize = this.Size; this.MinimumSize = this.Size; this.BackColor = Color.FromArgb(0x74, 0x74, 0x74); this.DoubleBuffered = true; this.StartPosition = FormStartPosition.CenterScreen; this.m_loading = new LoadingPane(this.panelCanvas.Width, this.panelCanvas.Height); this.m_map = new Map(); this.m_canvas = new Canvas(16, 16); this.m_timer = new System.Windows.Forms.Timer() { Interval = 5 }; this.m_timer.Tick += new EventHandler(this.timer_Tick); this.m_keyHook = new KeyboardHook(); this.m_keyHook.KeyDown += new KeyEventHandler(this.keyHook_KeyDown); }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { this.m_timer.Stop(); if (this.m_processThread != null) { this.m_processThread.Abort(); this.m_processThread = null; } if (this.m_keyHook != null) { this.m_keyHook.Stop(); this.m_keyHook = null; } if (this.m_loading != null) { this.m_loading.Dispose(); this.m_loading = null; } if (this.m_canvas != null) { this.m_canvas.Dispose(); this.m_canvas = null; } if (this.m_map != null) { this.m_map.Dispose(); this.m_map = null; } if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }